emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] master dcfe1c4 1/3: Fix Bug#35055


From: Michael Albinus
Subject: [Emacs-diffs] master dcfe1c4 1/3: Fix Bug#35055
Date: Sun, 14 Apr 2019 13:53:46 -0400 (EDT)

branch: master
commit dcfe1c4aba3f54cdd0295e0e21db86143f7cb705
Author: Michael Albinus <address@hidden>
Commit: Michael Albinus <address@hidden>

    Fix Bug#35055
    
    * lisp/net/tramp.el (tramp-handle-shell-command):
    Handle `shell-command-width'.  (Bug#35055)
---
 lisp/net/tramp.el | 29 ++++++++++++++++++-----------
 1 file changed, 18 insertions(+), 11 deletions(-)

diff --git a/lisp/net/tramp.el b/lisp/net/tramp.el
index 32963ac..2e1a096 100644
--- a/lisp/net/tramp.el
+++ b/lisp/net/tramp.el
@@ -3638,17 +3638,24 @@ support symbolic links."
        (erase-buffer)))
 
     (if (and (not current-buffer-p) (integerp asynchronous))
-       (prog1
-           ;; Run the process.
-           (setq p (start-file-process-shell-command
-                    (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)))
+       (let ((tramp-remote-process-environment
+              ;; `shell-command-width' has been introduced with Emacs 27.1.
+              (if (natnump (bound-and-true-p shell-command-width))
+                  (cons (format "COLUMNS=%d"
+                                (bound-and-true-p shell-command-width))
+                        tramp-remote-process-environment)
+                tramp-remote-process-environment)))
+         (prog1
+             ;; Run the process.
+             (setq p (start-file-process-shell-command
+                      (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
          ;; Run the process.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]