From 43b7759b093cb6b10dd0d4dcb2aff72212b6070d Mon Sep 17 00:00:00 2001 From: Lars Ingebrigtsen Date: Wed, 11 May 2022 17:10:30 +0200 Subject: [PATCH] Allow giving switches to the program in `M-x term' * lisp/term.el (term, ansi-term): Allow giving switches to the program (bug#18105). --- lisp/term.el | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) 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) -- 2.39.2