Add C-c session keybindings to input buffer#252
Open
SayreBlades wants to merge 1 commit into
Open
Conversation
Mirror the chat buffer's C-c session-management chords in pi-coding-agent-input-mode-map so they work without switching windows: C-c C-n (new session), C-c C-e (export HTML), C-c C-m (select model), C-c C-t (cycle thinking), and C-c C-y (copy last message). C-c C-r (resume) was already bound. All of these commands resolve the session process and chat buffer through accessors that work from either buffer, so no command changes are needed. C-c C-c intentionally stays pi-coding-agent-send in the input buffer (compact remains available via C-c C-p c). Add an ERT parity test that walks the chat map's C-c submap and asserts every chord is bound identically in the input map, so future additions cannot drift.
Owner
|
What's a window switch? :-) What do you think about doing the opposite of removing all C-c chords for consistency, and only defining C-c C-p ones? As you noted, there's already a confusion with compaction. I'm open to merging this but just wondering what the real benefit here is over using the C-c C-p chords? |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The chat buffer exposes session management through
C-cchords, but the input buffer only had a subset, forcing a window switch for common operations. This mirrors the remaining chords inpi-coding-agent-input-mode-map:C-c C-npi-coding-agent-new-sessionC-c C-epi-coding-agent-export-htmlC-c C-mpi-coding-agent-select-modelC-c C-tpi-coding-agent-cycle-thinkingC-c C-ypi-coding-agent-copy-last-message(
C-c C-rresume was already bound in the input map.)All five commands resolve the session process and chat buffer through
pi-coding-agent--get-process,pi-coding-agent--get-chat-buffer, andpi-coding-agent--menu-state, which already work from either buffer — so no command changes are needed.C-c C-cintentionally stayspi-coding-agent-sendin the input buffer; compact remains available there viaC-c C-p c.Tests: extended
pi-coding-agent-test-input-mode-keybindingswith the new chords, and addedpi-coding-agent-test-input-chat-c-c-key-parity, which walks the chat map'sC-csubmap and asserts every chord is bound identically in the input map — future additions to either map can't silently drift. Also documented the new input rows in the README key table.