Launch cygwin input shell to handle Ctrl+C without "Terminate batch job" prompt

1

In general, a Windows user cannot launch a batch file and suppress the Terminate batch job (Y/N) prompt on Ctrl+C without some serious workarounds or limitations.

But, I am wondering with a Cygwin shell (bash) in particular, can I launch it in such a way as to handle Ctrl+C without encountering the Terminate batch job (Y/N) prompt on the exit of the shell.

Perhaps, if launching it via a batch file necessarily causes that prompt on Ctrl+C, then does an effective way to launch it exist outside of a batch file? I know that the Cygwin.bat file does configure some variables, so I would prefer to be able to configure similar variables with another workaround.

I would like a general answer, but I am using the ConsoleZ wrapper to contain the terminal session(s), so I would give more weight to answers that work within this framework.

palswim

Posted 2018-03-08T23:30:05.787

Reputation: 2 793

Answers

0

Note that the Cygwin.bat file invokes the shell (bash --login -i in my instance), so why not invoke the shell directly? So, however you launched the batch file, launch the bash executable instead.

In ConsoleZ, this means that for your Tab (in the Tabs section), set the Shell parameter to the location of your bash.exe file, instead of your Cygwin.bat file. But, don't forget to set your parameters (e.g. --login -i) in that Shell field as well. Thankfully, ConsoleZ has an Environment tab in your Tabs section, where you can also set additional environment variables, as necessary.

palswim

Posted 2018-03-08T23:30:05.787

Reputation: 2 793