3

I'm trying to set Windows Terminal to launch mintty.exe with the setting bellow. However, when opening a new bash session, it opens mintty in a new window and not inside a Windows Terminal tab.

    {
        "guid": "{3C0F968A-D8F8-437A-A41C-439293E22EBB}",
        "hidden": false,
        "name": "Mintty",
        "commandline": "C:\\cygwin64\\bin\\mintty.exe -i /Cygwin-Terminal.ico -",
        "icon": "C:\\cygwin64\\Cygwin-Terminal.ico"
    }
Rom098
  • 2,445
  • 4
  • 35
  • 52
Shimon Shrem
  • 125
  • 8

2 Answers2

6

After some research, I have found an explanation about the different between Cygwin bash.exe and mintty.exe . I used the following setting to resolve the issue.

{
    "guid": "{3C0F968A-D8F8-437A-A41C-439293E22EB1}",
    "hidden": false,
    "name": "Bash",
    "commandline": "C:\\cygwin64\\bin\\bash.exe -l",
    "icon": "C:\\cygwin64\\Cygwin-Terminal.ico"
}
Shimon Shrem
  • 125
  • 8
  • Use the Windows Terminal Tweaker to configure the terminal : https://github.com/nateshmbhat/windows-terminal-tweaker – Natesh bhat Jul 26 '20 at 07:14
  • This worked for me, once I realised the 'l' of "commandline" shouldn't be capitalised. – Mike P Apr 20 '21 at 13:51
  • if this 'Windows Terminal Tweaker' app goes out of date, how do you access this JSON file directly? as Windows Terminal only has GUI to do the settings but can't add addtional params like '-l' (based on some articles it seems like in the past clicking Settings it would open the JSON file). Note: one of the answers below by @MohamedShafi also worked (the Cygwin.bat option) – armyofda12mnkeys Apr 01 '22 at 16:00
  • 1
    Sadly this does not give the same behavior. Try running tmux inside of the bash terminal above and note that it will give you an error. Running it in mintty works. – R Schultz Aug 15 '22 at 22:41
2

Instead of mintty you can invoke the cygwin terminal directly, which is just an indirect call to bash : bash --login -i

        {
            "commandline": "C:\\cygwin64\\Cygwin.bat",
            "icon": "C:\\cygwin64\\Cygwin-Terminal.ico",
            "hidden": false,
            "name": "Cygwin"
        },