diff options
author | Kim F. Storm <storm@cua.dk> | 2002-10-31 23:37:15 +0000 |
---|---|---|
committer | Kim F. Storm <storm@cua.dk> | 2002-10-31 23:37:15 +0000 |
commit | 969a0631069a18e2b9a7fa2f59a4f4336c5c616c (patch) | |
tree | dc9337cc1172b96a42a1d3e45bfe136d43d6ca41 /lisp/shell.el | |
parent | 32f53dacac15bde9f79a1c57717360836f668381 (diff) | |
download | emacs-969a0631069a18e2b9a7fa2f59a4f4336c5c616c.tar.gz |
(explicit-bash-args): Bash 1.x doesn't grook
--noediting option; added run-time check to exclude it.
Diffstat (limited to 'lisp/shell.el')
-rw-r--r-- | lisp/shell.el | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/lisp/shell.el b/lisp/shell.el index 0eaea9af27f..fa4f31ce5f0 100644 --- a/lisp/shell.el +++ b/lisp/shell.el @@ -276,8 +276,18 @@ Value is a list of strings, which may be nil." :group 'shell) (defcustom explicit-bash-args - ;; Tell bash not to use readline. - '("--noediting" "-i") + ;; Tell bash not to use readline, except for bash 1.x which doesn't grook --noediting. + ;; Bash 1.x has -nolineediting, but process-send-eof cannot terminate bash if we use it. + (let* ((prog (or (and (boundp 'explicit-shell-file-name) explicit-shell-file-name) + (getenv "ESHELL") shell-file-name)) + (name (file-name-nondirectory prog))) + (if (and (not purify-flag) + (equal name "bash") + (file-executable-p prog) + (string-match "bad option" + (shell-command-to-string (concat prog " --noediting")))) + '("-i") + '("--noediting" "-i"))) "*Args passed to inferior shell by M-x shell, if the shell is bash. Value is a list of strings, which may be nil." :type '(repeat (string :tag "Argument")) |