branch: externals/shell-command+
commit 2e160f1979e28efde162df41a04b2a3cc5c6e4f3
Author: Philip Kaludercic <[email protected]>
Commit: Philip Kaludercic <[email protected]>
Kill *Shell Command Output* before running new commands
---
shell-command+.el | 3 +++
1 file changed, 3 insertions(+)
diff --git a/shell-command+.el b/shell-command+.el
index 5cd95e1..25d7fc8 100644
--- a/shell-command+.el
+++ b/shell-command+.el
@@ -345,6 +345,9 @@ between BEG and END. Otherwise the whole buffer is
processed."
(if (use-region-p) (region-end) (point-max))))
(pcase-let* ((`(,path ,mode ,command ,rest) (shell-command+-parse command))
(default-directory (shell-command+-expand-path (or path "."))))
+ ;; Make sure the previous output buffer was killed, to prevent
+ ;; TRAMP paths from persisting between commands.
+ (kill-buffer shell-command-buffer-name)
(cond ((eq mode 'input)
(delete-region beg end)
(shell-command rest t shell-command-default-error-buffer)