1
0
mirror of https://git.savannah.gnu.org/git/emacs.git synced 2024-12-01 08:17:38 +00:00

Support `shell-resync-dirs' on msys bash (Bug#70012)

* lisp/shell.el (w32-application-type): Declare.
(shell-mode): Set `shell-dirstack-query' to `pwd -W` when using msys bash.
This commit is contained in:
Sam Steingold 2024-03-29 10:36:43 -04:00
parent 1f19ddec5b
commit 6f7cb96543

View File

@ -606,6 +606,9 @@ Shell buffers. It implements `shell-completion-execonly' for
(defvar sh-shell-file)
(declare-function w32-application-type nil ; "src/w32proc.c"
(program) t)
(define-derived-mode shell-mode comint-mode "Shell"
"Major mode for interacting with an inferior shell.
\\<shell-mode-map>
@ -754,6 +757,11 @@ command."
((string-equal shell "ksh") "echo $PWD ~-")
;; Bypass any aliases. TODO all shells could use this.
((string-equal shell "bash") "command dirs")
((and (string-equal shell "bash.exe")
(eq system-type 'windows-nt)
(eq (w32-application-type (executable-find "bash.exe"))
'msys))
"command pwd -W")
((string-equal shell "zsh") "dirs -l")
(t "dirs")))
;; Bypass a bug in certain versions of bash.