Commit dcfe1c4a authored by Michael Albinus's avatar Michael Albinus

Fix Bug#35055

* lisp/net/tramp.el (tramp-handle-shell-command):
Handle `shell-command-width'.  (Bug#35055)
parent e233dedd
...@@ -3638,17 +3638,24 @@ support symbolic links." ...@@ -3638,17 +3638,24 @@ support symbolic links."
(erase-buffer))) (erase-buffer)))
(if (and (not current-buffer-p) (integerp asynchronous)) (if (and (not current-buffer-p) (integerp asynchronous))
(prog1 (let ((tramp-remote-process-environment
;; Run the process. ;; `shell-command-width' has been introduced with Emacs 27.1.
(setq p (start-file-process-shell-command (if (natnump (bound-and-true-p shell-command-width))
(buffer-name output-buffer) buffer command)) (cons (format "COLUMNS=%d"
;; Display output. (bound-and-true-p shell-command-width))
(with-current-buffer output-buffer tramp-remote-process-environment)
(display-buffer output-buffer '(nil (allow-no-window . t))) tramp-remote-process-environment)))
(setq mode-line-process '(":%s")) (prog1
(shell-mode) ;; Run the process.
(set-process-sentinel p #'shell-command-sentinel) (setq p (start-file-process-shell-command
(set-process-filter p #'comint-output-filter))) (buffer-name output-buffer) buffer command))
;; Display output.
(with-current-buffer output-buffer
(display-buffer output-buffer '(nil (allow-no-window . t)))
(setq mode-line-process '(":%s"))
(shell-mode)
(set-process-sentinel p #'shell-command-sentinel)
(set-process-filter p #'comint-output-filter))))
(prog1 (prog1
;; Run the process. ;; Run the process.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment