diff options
| author | Craig Jennings <c@cjennings.net> | 2026-07-20 08:36:14 -0500 |
|---|---|---|
| committer | Craig Jennings <c@cjennings.net> | 2026-07-20 08:36:14 -0500 |
| commit | d9a8a6382854bb06c3aac6a5a4779a48cc82b48a (patch) | |
| tree | 833b5629f884b8acc52e76deb43775280ab8f0c1 /tests/test-ai-term--keybindings.el | |
| parent | 836b386e0a19fe49d35a65ea4d0faa63e6d6e1d2 (diff) | |
| download | dotemacs-d9a8a6382854bb06c3aac6a5a4779a48cc82b48a.tar.gz dotemacs-d9a8a6382854bb06c3aac6a5a4779a48cc82b48a.zip | |
feat(ai-term): M-SPC cycles attached agents, M-S-SPC cycles all
M-SPC now steps only through attached agents (the ones with a live
on-screen buffer), so the fast chord stays among what's already up.
M-S-SPC steps through all active agents and attaches a detached tmux
session when it lands on one, which is what M-SPC used to do.
I moved the shared step logic into cj/--ai-term-step-among and added
cj/--ai-term-attached-agent-dirs to filter the queue to attached
buffers. I bound both chords globally and in eat-semi-char-mode-map so
they work from inside an agent buffer. C-; a n keeps cycling all.
Diffstat (limited to 'tests/test-ai-term--keybindings.el')
| -rw-r--r-- | tests/test-ai-term--keybindings.el | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/tests/test-ai-term--keybindings.el b/tests/test-ai-term--keybindings.el index 6f7f53a5..8b1f8fa5 100644 --- a/tests/test-ai-term--keybindings.el +++ b/tests/test-ai-term--keybindings.el @@ -33,14 +33,18 @@ (should (eq (keymap-lookup cj/custom-keymap "a") cj/ai-term-keymap))) (ert-deftest test-ai-term-next-bound-to-meta-space-globally () - "Normal: M-SPC runs `cj/ai-term-next' (the fast swap chord)." - (should (eq (lookup-key (current-global-map) (kbd "M-SPC")) #'cj/ai-term-next))) + "Normal: M-SPC runs `cj/ai-term-next-attached' (cycle attached only) and +M-S-SPC runs `cj/ai-term-next' (cycle all, including detached)." + (should (eq (lookup-key (current-global-map) (kbd "M-SPC")) #'cj/ai-term-next-attached)) + (should (eq (lookup-key (current-global-map) (kbd "M-S-SPC")) #'cj/ai-term-next))) (ert-deftest test-ai-term-meta-space-bound-in-eat-semi-char-mode-map () - "Normal: M-SPC is bound in `eat-semi-char-mode-map' so swap works inside an -agent. EAT forwards unbound keys to the pty, so the bind is what lets it reach -Emacs -- no ghostel-style exception list or rebuild is needed." - (should (eq (keymap-lookup eat-semi-char-mode-map "M-SPC") #'cj/ai-term-next))) + "Normal: both swap chords are bound in `eat-semi-char-mode-map' so they work +inside an agent. EAT forwards unbound keys to the pty, so the bind is what lets +them reach Emacs -- no ghostel-style exception list or rebuild is needed. M-SPC +cycles attached only; M-S-SPC cycles all." + (should (eq (keymap-lookup eat-semi-char-mode-map "M-SPC") #'cj/ai-term-next-attached)) + (should (eq (keymap-lookup eat-semi-char-mode-map "M-S-SPC") #'cj/ai-term-next))) (ert-deftest test-ai-term-f9-family-removed-globally () "Regression: the old F9 family no longer binds the ai-term commands globally." |
