Windows, Emacs 27.2.
I execute fairly simple cygwin commands from an Emacs shell - first tried unzip then backed up to test ls - and the shell exits. Why?
Windows, Emacs 27.2.
I execute fairly simple cygwin commands from an Emacs shell - first tried unzip then backed up to test ls - and the shell exits. Why?
I think I figured it out. The default shell-file-name is changed for my newly installed emacs 29.4, I have to explicitly asking emacs to use the bash.exe by (setq shell-file-name "C:/cygwin64/bin/bash.exe") Otherwise, it shows a different program used for shell-file-name:
Its value is "C:/Emacs/emacs-29.4/libexec/emacs/29.4/x86_64-w64-mingw32/cmdproxy.exe" Original value was "G:/rel/emacs-29.4/nt/cmdproxy.exe" And my shell gets terminated every time I issues a unix command if I use this cmdproxy.exe.
Now I need to fix a complaint in emacs for my set prompt PS1 in .bashrc:
bash: cannot set terminal process group (-1): Inappropriate ioctl for device bash: no job control in this shell But this is just a nuisance, I can also ignore it and my shell stays! :)
I have this issue on
GNU Emacs 30.1 (build 2, x86_64-w64-mingw32) of 2025-02-23
Having dug a little bit further into the long history of this problem, I find that there are two causes listed, both of which look a lot like a problem in search of a maintainer
Running MSYS programs in M-x shell on a native build of Emacs should be considered "not really supported". see https://lists.gnu.org/archive/html/bug-gnu-emacs/2024-03/msg00781.html
emacs comint sends an EOF character into the pipe to flush the buffer, which then gets misinterpreted by CMD.exe causing it to exit because it is runing on a pipe, not a PTY. see https://lists.gnu.org/archive/html/emacs-devel/2023-01/msg00242.html
I would lean towards the second problem above, as cmdproxy.exe works just fine when I run it standalone. That said, the non-fix suggested in the email thread doesn't work for me either.
https://lists.gnu.org/archive/html/bug-gnu-emacs/2024-03/msg00864.html
Sorry for no help here, but the first point above is probably the actual answer.