summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSam Steingold <sds@gnu.org>2024-03-29 10:36:43 -0400
committerSam Steingold <sds@gnu.org>2024-03-29 10:36:43 -0400
commit6f7cb96543285dc8e37135abaec87d0b9a40e2e2 (patch)
treeee65a9454dcda9059c3a648c5177536c705110de
parent1f19ddec5b06720086c67d5d8b7d2184e9eef288 (diff)
downloademacs-6f7cb96543285dc8e37135abaec87d0b9a40e2e2.tar.gz
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.
-rw-r--r--lisp/shell.el8
1 files changed, 8 insertions, 0 deletions
diff --git a/lisp/shell.el b/lisp/shell.el
index c5cfbd985ed..8a5218ae847 100644
--- a/lisp/shell.el
+++ b/lisp/shell.el
@@ -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.