Suppress cygwin’s warning about running processes

3

1

When I close cygwin terminal windows the message like bellow shows up:

Processes are running in session.
<list of processes>
Close anyway?
---------------------------
OK   Cancel   
---------------------------

And I hate pressing OK button every time. How to suppress this annoying warning? I’ve tired to google this issue…

I’m working on Win7-10 env.

zhekaus

Posted 2016-09-22T05:50:39.087

Reputation: 201

Mintty is likely asking permission to kill bash. Why you are not closing bash with exit ? – matzeri – 2016-09-24T19:46:05.410

I don't open bash deliberately. It opens automatically when I start cygwin. – zhekaus – 2016-09-26T07:20:33.053

We want to be able to hit the close button without a warning. I have shortcuts that do things like tail -f a log file. I don't need to be warned when closing that. – Bruno Bronosky – 2016-12-24T05:34:35.733

Answers

1

This will do it.

mintty.exe -o ConfirmExit=no

This is very useful for Shortcut *.lnk files. For example, this is a link I've made for watching a log with tail -f:

C:\tools\cygwin\bin\mintty.exe -o ConfirmExit=no -s 54,78 -e /usr/bin/bash -l -c 'tail -n 200 -f /cygdrive/c/logs/NSSM.log'

The -s 54,78 causes the window to be the full height of the display and exactly the width of the log entries. The -l -c are needed to make bash able to find executables in its $PATH

See:

$ mintty.exe --help
Usage: mintty [OPTION]... [ PROGRAM [ARG]... | - ]

Start a new terminal session running the specified program or the user's shell.
If a dash is given instead of a program, invoke the shell as a login shell.

Options:
  -c, --config FILE     Load specified config file (cf. -C or -o ThemeFile)
  -e, --exec ...        Treat remaining arguments as the command to execute
  -h, --hold never|start|error|always  Keep window open after command finishes
  -p, --position X,Y    Open window at specified coordinates
  -p, --position center|left|right|top|bottom  Open window at special position
  -p, --position @N     Open window on monitor N
  -s, --size COLS,ROWS  Set screen size in characters (also COLSxROWS)
  -s, --size maxwidth|maxheight  Set max screen size in given dimension
  -t, --title TITLE     Set window title (default: the invoked command) (cf. -T)
  -w, --window normal|min|max|full|hide  Set initial window state
  -i, --icon FILE[,IX]  Load window icon from file, optionally with index
  -l, --log FILE|-      Log output to file or stdout
      --nobidi|--nortl  Disable bidi (right-to-left support)
  -o, --option OPT=VAL  Set/Override config file option with given value
  -B, --Border frame|void  Use thin/no window border
  -R, --Reportpos s|o   Report window position (short/long) after exit
      --nopin           Make this instance not pinnable to taskbar
  -D, --daemon          Start new instance with Windows shortcut key
  -H, --help            Display help and exit
  -V, --version         Print version information and exit
See manual page for further command line options and configuration.

I found the options for -o at https://mintty.github.io/mintty.1.html#CONFIGURATION

Bruno Bronosky

Posted 2016-09-22T05:50:39.087

Reputation: 1 251

0

It seems you are a bit confused: cygwin is a shared library.
You are running programs that use that library.

I will try to explain the situation:

You started a terminal (mintty) that of course invoke the command shell (bash). If you run additional programs from the command shell, the process tree will be like :

$ pstree
?───mintty───bash───pstree

This is a minimal tree case.

If you run additional program from the shell and you don't wait or request their end, when you require mintty to terminate itself it will highlight you that you have running processes and that closing the father process (mintty) will force the closure of all the children. If the only child is the command shell, and it is inactive, mintty will not require confirmation and will terminate itself and the shell.

So you need to terminate all the running processes for mintty stopping to ask you the confirmation to kill all the children.

matzeri

Posted 2016-09-22T05:50:39.087

Reputation: 1 662

We understand why we get the warning. We want an option to suppress it so we can just click the close button. – Bruno Bronosky – 2016-12-24T05:35:32.527