Suprimir o aviso do cygwin sobre processos em execução

Suprimir o aviso do cygwin sobre processos em execução

Quando fecho as janelas do terminal cygwin, a mensagem abaixo aparece:

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

E eu odeio pressionar o botão OK todas as vezes. Como suprimir esse aviso irritante? Estou cansado de pesquisar esse problema no Google ...

Estou trabalhando no ambiente Win7-10.

Responder1

Isso bastará.

mintty.exe -o ConfirmExit=no

Isto é muito útil para *.lnkarquivos de atalho. Por exemplo, este é um link que criei para assistir a um log com 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'

Isso -s 54,78faz com que a janela tenha a altura total da exibição e exatamente a largura das entradas do log. Eles -l -csão necessários para tornar o bash capaz de encontrar executáveis ​​em seu$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.

Encontrei as opções para -oemhttps://mintty.github.io/mintty.1.html#CONFIGURATION

Responder2

Parece que você está um pouco confuso: cygwin é uma biblioteca compartilhada.
Você está executando programas que usam essa biblioteca.

Vou tentar explicar a situação:

Você iniciou um terminal (mintty) que obviamente invoca o shell de comando (bash). Se você executar programas adicionais a partir do shell de comando, a árvore de processos será semelhante a:

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

Este é um caso de árvore mínimo.

Se você executar programas adicionais a partir do shell e não esperar ou solicitar seu final, quando você exigir que o mintty termine, ele irá destacar que você tem processos em execução e que fechar o processo pai (mintty) forçará o fechamento de todos as crianças. Se o único filho for o shell de comando e estiver inativo, o mintty não exigirá confirmação e encerrará a si mesmo e ao shell.

Então você precisa encerrar todos os processos em execução para que o mintty pare para pedir a confirmação de matar todos os filhos.

informação relacionada