]> git.eshelyaron.com Git - emacs.git/commitdiff
Allow giving switches to the program in `M-x term'
authorLars Ingebrigtsen <larsi@gnus.org>
Wed, 11 May 2022 15:10:30 +0000 (17:10 +0200)
committerLars Ingebrigtsen <larsi@gnus.org>
Wed, 11 May 2022 15:10:30 +0000 (17:10 +0200)
* lisp/term.el (term, ansi-term): Allow giving switches to the
program (bug#18105).

lisp/term.el

index 54e19a3ea92650cffb350592a003c00878743ffd..f81cbf72930f8635d1bd1fae6ae9bd1f18165409 100644 (file)
@@ -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)