Suprimir la advertencia de cygwin sobre procesos en ejecución

Suprimir la advertencia de cygwin sobre procesos en ejecución

Cuando cierro las ventanas de la terminal cygwin, aparece un mensaje como el siguiente:

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

Y odio presionar el botón Aceptar cada vez. ¿Cómo suprimir esta molesta advertencia? Me cansé de buscar en Google este problema...

Estoy trabajando en el entorno Win7-10.

Respuesta1

Esto lo hará.

mintty.exe -o ConfirmExit=no

Esto es muy útil para *.lnkarchivos de acceso directo. Por ejemplo, este es un enlace que hice para ver un registro con 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'

Esto -s 54,78hace que la ventana tenga la altura total de la pantalla y exactamente el ancho de las entradas del registro. Son -l -cnecesarios para que bash pueda encontrar ejecutables en su$PATH

Ver:

$ 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.

Encontré las opciones para -oenhttps://mintty.github.io/mintty.1.html#CONFIGURACIÓN

Respuesta2

Parece que estás un poco confundido: cygwin es una biblioteca compartida.
Está ejecutando programas que utilizan esa biblioteca.

Intentaré explicar la situación:

Iniciaste una terminal (mintty) que, por supuesto, invoca el shell de comandos (bash). Si ejecuta programas adicionales desde el shell de comandos, el árbol de procesos será como:

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

Este es un caso de árbol mínimo.

Si ejecuta un programa adicional desde el shell y no espera ni solicita su finalización, cuando solicite que mintty finalice, le resaltará que tiene procesos en ejecución y que cerrar el proceso padre (mintty) forzará el cierre de todos. los niños. Si el único hijo es el shell de comandos y está inactivo, mintty no requerirá confirmación y finalizará él mismo y el shell.

Por lo tanto, debe finalizar todos los procesos en ejecución para que Mintty se detenga y le solicite confirmación para matar a todos los niños.

información relacionada