Skip to content

Commit 2e2f539

Browse files
committed
Fix window position in Tramp's shell-command
* lisp/net/tramp.el (tramp-handle-shell-command): Fix `window-start' in output buffer. (Bug#39171)
1 parent 7935551 commit 2e2f539

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

lisp/net/tramp.el

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3721,9 +3721,9 @@ support symbolic links."
37213721
(if (process-live-p p)
37223722
;; Display output.
37233723
(with-current-buffer output-buffer
3724-
(display-buffer output-buffer '(nil (allow-no-window . t)))
37253724
(setq mode-line-process '(":%s"))
3726-
(shell-mode)
3725+
(unless (eq major-mode 'shell-mode)
3726+
(shell-mode))
37273727
(set-process-filter p #'comint-output-filter)
37283728
(set-process-sentinel p #'shell-command-sentinel)
37293729
(when error-file
@@ -3733,7 +3733,8 @@ support symbolic links."
37333733
(with-current-buffer error-buffer
37343734
(insert-file-contents-literally
37353735
error-file nil nil nil 'replace))
3736-
(delete-file error-file)))))
3736+
(delete-file error-file))))
3737+
(display-buffer output-buffer '(nil (allow-no-window . t))))
37373738

37383739
(when error-file
37393740
(delete-file error-file)))))

0 commit comments

Comments
 (0)