# HG changeset patch # User Kim F. Storm # Date 1036107435 0 # Node ID 5fbd632e11092ebc12509ae4e98db1b7b6337863 # Parent 8916f1f744c8486bb8b609314273207c1ca2fa82 (explicit-bash-args): Bash 1.x doesn't grook --noediting option; added run-time check to exclude it. diff -r 8916f1f744c8 -r 5fbd632e1109 lisp/shell.el --- a/lisp/shell.el Thu Oct 31 23:36:56 2002 +0000 +++ b/lisp/shell.el Thu Oct 31 23:37:15 2002 +0000 @@ -276,8 +276,18 @@ :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"))