From: Lars Ingebrigtsen Date: Wed, 11 May 2022 15:10:30 +0000 (+0200) Subject: Allow giving switches to the program in `M-x term' X-Git-Tag: emacs-29.0.90~1910^2~791 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=43b7759b093cb6b10dd0d4dcb2aff72212b6070d;p=emacs.git Allow giving switches to the program in `M-x term' * lisp/term.el (term, ansi-term): Allow giving switches to the program (bug#18105). --- diff --git a/lisp/term.el b/lisp/term.el index 54e19a3ea92..f81cbf72930 100644 --- a/lisp/term.el +++ b/lisp/term.el @@ -1581,7 +1581,8 @@ commands to use in that buffer. (or explicit-shell-file-name (getenv "ESHELL") shell-file-name)))) - (set-buffer (make-term "terminal" program)) + (let ((prog (split-string-shell-command program))) + (set-buffer (apply #'make-term "terminal" (car prog) nil (cdr prog)))) (term-char-mode) (pop-to-buffer-same-window "*terminal*")) @@ -4399,7 +4400,10 @@ and `C-x' being marked as a `term-escape-char'." ;; for now they have the *term-ansi-term* form but we'll see... (setq term-ansi-buffer-name (generate-new-buffer-name term-ansi-buffer-name)) - (setq term-ansi-buffer-name (term-ansi-make-term term-ansi-buffer-name program)) + (let ((prog (split-string-shell-command program))) + (setq term-ansi-buffer-name + (apply #'term-ansi-make-term term-ansi-buffer-name (car prog) + nil (cdr prog)))) (set-buffer term-ansi-buffer-name) (term-mode)