summaryrefslogtreecommitdiff
path: root/modules
diff options
context:
space:
mode:
authorCraig Jennings <c@cjennings.net>2026-05-13 15:39:40 -0500
committerCraig Jennings <c@cjennings.net>2026-05-13 15:39:40 -0500
commitc3ec8508a8ff414d099d9e567eb5ffd43a9c93f2 (patch)
tree4229514bcfe38d3c569eeadfc5a04226d8816c39 /modules
parent9600611d5f8382ffc849d56a67ba5eb980d64e04 (diff)
downloaddotemacs-c3ec8508a8ff414d099d9e567eb5ffd43a9c93f2.tar.gz
dotemacs-c3ec8508a8ff414d099d9e567eb5ffd43a9c93f2.zip
feat(vterm): show tmux scrollback history in place
`cj/vterm-tmux-history' previously used `pop-to-buffer', which routed the history view through display-buffer-alist -- in an agent window that often meant a split or a hand-off to another window, costing the agent its frame slot. `switch-to-buffer' instead drops the history into the selected window directly; the existing quit handler already restores the origin in that same window via `set-window-buffer'. New test asserts the in-place behavior: starting single-window with a vterm origin, invoking the command leaves `(one-window-p)` t with the history buffer in the original slot. The existing render test no longer needs its `pop-to-buffer' stub since `switch-to-buffer' works in batch.
Diffstat (limited to 'modules')
-rw-r--r--modules/vterm-config.el9
1 files changed, 7 insertions, 2 deletions
diff --git a/modules/vterm-config.el b/modules/vterm-config.el
index 764c9dcd..954e096a 100644
--- a/modules/vterm-config.el
+++ b/modules/vterm-config.el
@@ -121,7 +121,12 @@ returns to the vterm without copying. RET is left unbound."
The history buffer uses normal Emacs navigation and selection. `M-w'
copies the active region and stays open, so several pieces can be
copied in a row; `q', `<escape>', or `C-g' returns point to the vterm
-buffer that launched it."
+buffer that launched it.
+
+The history view replaces the origin vterm buffer in the same window
+(via `switch-to-buffer'), not a split or a popped-up window -- reading
+past output should keep the agent's frame slot intact, and quit puts
+the live terminal back where it was."
(interactive)
(let* ((origin-buffer (current-buffer))
(origin-window (selected-window))
@@ -139,7 +144,7 @@ buffer that launched it."
(setq-local cj/vterm-tmux-history--origin-window origin-window)
(setq-local cj/vterm-tmux-history--origin-point origin-point)
(goto-char (point-max)))
- (pop-to-buffer buffer)))
+ (switch-to-buffer buffer)))
(defun cj/vterm-copy-mode-cancel ()
"Exit `vterm-copy-mode' without copying."