On Fri, Oct 04 2024,Eli Zaretskii wrote: >> From: Sivaram Neelakantan <nsivaram....@gmail.com> >> Date: Fri, 04 Oct 2024 18:40:15 +0530 >> User-Mail-Address: nsivaram....@gmail.com >> >> on GNU Emacs 29.4 (build 2, x86_64-w64-mingw32) of 2024-07-05, when I >> invoke M-x shell, I get garbled characters which seem to go away with >> with setting PS1; see below
[snipped 36 lines] > The problem is that you are using the MSYS Bash, and that Windows > doesn't support the ioctl calls required for "M-x shell" to work with > Bash. > > Emacs on Windows uses pipes to communicate with sub-processes, so any > Bash settings that are meant for interactive use will likely not work > in "M-x shell", because pipes are not terminal devices. > > You could try customizing explicit-bash-args, maybe it will help. > > I added this to my shell configuration and the issue is gone now. (add-hook 'shell-mode-hook (lambda () (let ((proc (get-process "shell"))) (comint-send-string proc "export PS1=\"\\e[0;31m[\\u@\\h \\W]\\$ \\e[m \"\n")))) Looks like this can be used to set multiple shell settings for the active shell at start up sivaram --