diff options
| author | Craig Jennings <c@cjennings.net> | 2026-05-09 11:58:52 -0500 |
|---|---|---|
| committer | Craig Jennings <c@cjennings.net> | 2026-05-09 11:58:52 -0500 |
| commit | 554b32db5da9630fa24fb2abf3f93f21b03ff7a0 (patch) | |
| tree | d9f2650ef6b305f215fcbca36d65cc9bd63f589e /tests/test-org-webclipper-process.el | |
| parent | 26e97633c2141051dee418aff5d8993700cf39b2 (diff) | |
| download | dotemacs-554b32db5da9630fa24fb2abf3f93f21b03ff7a0.tar.gz dotemacs-554b32db5da9630fa24fb2abf3f93f21b03ff7a0.zip | |
feat(vterm): F12 toggle that excludes claude and preserves geometry
vterm-toggle picked the most-recently-selected vterm buffer as F12's toggle target. After using F9 on a claude vterm, the most-recent vterm IS claude, so F12 ended up toggling claude, which has its own F9 / C-F9 / M-F9 surface in ai-vterm.el and shouldn't be affected. The display rule also had a hard-coded `(window-height . 0.7)` that overrode mouse-resize and orientation flips on every toggle.
I replaced the F12 binding with `cj/vterm-toggle` in `eshell-vterm-config.el`, mirroring the pattern shipped in ai-vterm.el:
- `cj/--vterm-toggle-buffer-p` excludes claude-prefixed buffers from F12's candidate set.
- `cj/--vterm-toggle-capture-state` records direction + body size at toggle-off.
- `cj/--vterm-toggle-display-saved` replays via `(body-columns . N)` / `(body-lines . N)` cons forms with the cardinal direction mapped to its frame-edge variant (`right` -> `rightmost`, `below` -> `bottom`, etc.) so vterm always lands at the captured edge regardless of selected window.
- `cj/vterm-toggle` uses `delete-window` (with `one-window-p` guard) on toggle-off so buffer-move scenarios don't leak ghost windows.
Default direction is `'below` to match F12's traditional bottom split. The vterm-toggle package stays installed so `M-x vterm-toggle` still works. Only the F12 binding changes.
19 new tests across three files: buffer-filter, dispatch, display. Full make test green.
Tradeoff: ~150 lines of geometry helpers and capture/display action logic are duplicated from ai-vterm.el. Worth extracting into a shared module now that two consumers exist. I filed it as a follow-up rather than blocking this ship.
Diffstat (limited to 'tests/test-org-webclipper-process.el')
0 files changed, 0 insertions, 0 deletions
