Replies: 6 comments 3 replies
-
So, yup, that is definitely weird. At the heart of the issue is MSYS's use of a batch file with (potentially) improper signal handling characteristics. I'm not sure what they're setting up in there; however, we should probably support whatever it is so they don't need to ship a batch file! That message only really originates when CMD² receives a Apart from trying to change how you spawn MSYS, the only knob Terminal really offers here takes effect a little too late to address your main pain point. That knob is to set ¹ Or a |
Beta Was this translation helpful? Give feedback.
-
This is really annoying so I ended up tracing MSYS2 advertise two launch options for Windows Terminal. One is Despite that slightly different launch option they both identically run The unique variables for UCRT64 which matter are:
And the unique variables for the MSYS launch option are:
(Both also contain unrelated unique variables for WT_PROFILE_ID and WT_SESSION too.) The most important feature and difference between the two are their MSYSTEM variables. This variable influences the environment that bash will load into once invoked at the end of the batch script. Bash achieves this by reading To avoid creating various shortcuts just to set these two variables, I've changed the "Command line" entry for each of my MSYS2 Windows Terminal shells (UCRT64 and MSYS) to just run Now Windows Terminal is actually running bash directly itself and I can still access both MSYSTEM types just fine. Avoiding this E: I've gone to compile things and realised the above wasn't enough for According to To finish off, here are my two profiles for MINGW64 and MSYS in Windows Terminal for easy pasting: Click to reveal json
E2: As @angelog0 has mentioned on msys2/MSYS2-packages#1684 (comment) ; With Windows Terminal 1.18+ you can set variables right in the terminal startup. Much cleaner looking profiles without needing to juggle cmd.exe prior. |
Beta Was this translation helpful? Give feedback.
-
Hey, I was just looking at this discussion after my Windows Terminal started to ask me to "terminate batch job" too, the solution provided by @ipaqmaster plus the I used the instructions from the MSYS2 docs, but in VSCode it asks me to terminate the batch job when closing the terminal emulator, and it also shows me this error: Is there any fix for VScode? I want to use msys2 as my default profile, but this makes it annoying... |
Beta Was this translation helpful? Give feedback.
-
I just use this (there are some years now) and it works (no need of
|
Beta Was this translation helpful? Give feedback.
-
@NullDott, my solution does not use |
Beta Was this translation helpful? Give feedback.
-
I do not use VSCode. If you get the message to terminate batch job and do not use |
Beta Was this translation helpful? Give feedback.
-
I use Windows Terminal mostly to run MSYS2/MSYS or MSYS2/MINGW64 (
bash
) shells; I have them set up as per instructions in https://www.msys2.org/docs/terminals/ - basically, in setting.json under "profiles" key you might have:This mostly works for me - apart from one thing:
If I start a new tab, then do not do anything there, and I want to exit immediately, I just do:
... which is great, exactly as I want it to.
But then, if I do work in the terminal for some hours (and I cannot tell exactly what triggers this condition), and then I want to exit the shell/terminal tab - the following happens:
[process exited with code 1 (0x00000001)]
and the tab remainsAll I want, is to just do one thing - CTRL+D - and have the shell close properly, and the corresponding terminal tab to exit. Is there anything I can do in my setup, to ensure that these tabs close immediately always on CTRL+D?
EDIT: possibly related: microsoft/vscode#45693 (even though, as far as I can see, here I do not explicitly use anything called "winpty")
Beta Was this translation helpful? Give feedback.
All reactions