diff --git a/README.org b/README.org index 556f826..4f095c5 100644 --- a/README.org +++ b/README.org @@ -225,15 +225,20 @@ and error thresholds. ** Common keys ⌨️ -| Key | Context | Description | -|------------------+---------+------------------------------------------------| +| Key | Context | Description | +|------------------+---------+-----------------------------------------------| | =C-c C-c= | input | 📮 Send prompt, or queue follow-up if busy | | =C-c C-s= | input | 🐎 Send steering message while Pi is busy | | =C-c C-k= | input | 🪓 Abort current response or compaction | -| =C-c C-p= | input | 🎛️ Open transient menu | +| =C-c C-p= | input | 🎛️ Open transient menu | +| =C-c C-n= | input | 🌱 New session | | =C-c C-r= | input | 📼 Resume a previous session | -| =M-p= / =M-n= | input | 🕰️ Prompt history (=C-↑= / =C-↓= also work) | -| =C-r= | input | 🕵️ Incremental prompt-history search | +| =C-c C-e= | input | 🖨️ Export session to HTML | +| =C-c C-m= | input | 🧠 Select model | +| =C-c C-t= | input | 🌀 Cycle thinking level | +| =C-c C-y= | input | 📋 Copy last message | +| =M-p= / =M-n= | input | 🕰️ Prompt history (=C-↑= / =C-↓= also work) | +| =C-r= | input | 🕵️ Incremental prompt-history search | | =TAB= | input | 🪄 Complete paths, and =/= commands | | =M+= | input | 🛗 Scroll linked chat window | | =TAB= | chat | 🪗 Toggle thinking block, tool block, or turn | @@ -245,8 +250,8 @@ and error thresholds. | =C-c C-k= | chat | 🪓 Abort current operation | | =C-c C-n= | chat | 🌱 New session | | =C-c C-r= | chat | 📼 Resume a previous session | -| =C-c C-e= | chat | 🖨️ Export session to HTML | -| =C-c C-c= | chat | 🗜️ Compact conversation context | +| =C-c C-e= | chat | 🖨️ Export session to HTML | +| =C-c C-c= | chat | 🗜️ Compact conversation context | | =C-c C-m= | chat | 🧠 Select model | | =C-c C-t= | chat | 🌀 Cycle thinking level | | =C-c C-y= | chat | 📋 Copy last message | diff --git a/pi-coding-agent-ui.el b/pi-coding-agent-ui.el index 4fa674e..ffffb01 100644 --- a/pi-coding-agent-ui.el +++ b/pi-coding-agent-ui.el @@ -882,7 +882,12 @@ removing the instructional header that would otherwise appear." (define-key map (kbd "TAB") #'pi-coding-agent-complete) (define-key map (kbd "C-c C-k") #'pi-coding-agent-abort) (define-key map (kbd "C-c C-p") #'pi-coding-agent-menu) + (define-key map (kbd "C-c C-n") #'pi-coding-agent-new-session) (define-key map (kbd "C-c C-r") #'pi-coding-agent-resume-session) + (define-key map (kbd "C-c C-e") #'pi-coding-agent-export-html) + (define-key map (kbd "C-c C-m") #'pi-coding-agent-select-model) + (define-key map (kbd "C-c C-t") #'pi-coding-agent-cycle-thinking) + (define-key map (kbd "C-c C-y") #'pi-coding-agent-copy-last-message) (define-key map (kbd "M-p") #'pi-coding-agent-previous-input) (define-key map (kbd "M-n") #'pi-coding-agent-next-input) (define-key map (kbd "") #'pi-coding-agent-previous-input) diff --git a/test/pi-coding-agent-input-test.el b/test/pi-coding-agent-input-test.el index a83f72d..ec14efc 100644 --- a/test/pi-coding-agent-input-test.el +++ b/test/pi-coding-agent-input-test.el @@ -4200,11 +4200,34 @@ no spurious faces are applied to plain colon-ending lines." (should (eq (key-binding (kbd "C-c C-c")) 'pi-coding-agent-send)) (should (eq (key-binding (kbd "C-c C-k")) 'pi-coding-agent-abort)) (should (eq (key-binding (kbd "C-c C-p")) 'pi-coding-agent-menu)) + (should (eq (key-binding (kbd "C-c C-n")) 'pi-coding-agent-new-session)) + (should (eq (key-binding (kbd "C-c C-r")) 'pi-coding-agent-resume-session)) + (should (eq (key-binding (kbd "C-c C-e")) 'pi-coding-agent-export-html)) + (should (eq (key-binding (kbd "C-c C-m")) 'pi-coding-agent-select-model)) + (should (eq (key-binding (kbd "C-c C-t")) 'pi-coding-agent-cycle-thinking)) + (should (eq (key-binding (kbd "C-c C-y")) 'pi-coding-agent-copy-last-message)) (should (eq (key-binding (kbd "M-p")) 'pi-coding-agent-previous-input)) (should (eq (key-binding (kbd "M-n")) 'pi-coding-agent-next-input)) (should (eq (key-binding (kbd "TAB")) 'pi-coding-agent-complete)) (should (eq (key-binding (kbd "C-c C-s")) 'pi-coding-agent-queue-steering)))) +(ert-deftest pi-coding-agent-test-input-chat-c-c-key-parity () + "Input mode mirrors chat mode's C-c session-management chords. +Every C-c chord in `pi-coding-agent-chat-mode-map' is bound to the +same command in `pi-coding-agent-input-mode-map', except C-c C-c, +which means `pi-coding-agent-send' in the input buffer." + (let ((chat-c-c (lookup-key pi-coding-agent-chat-mode-map (kbd "C-c"))) + (input-c-c (lookup-key pi-coding-agent-input-mode-map (kbd "C-c")))) + (should (keymapp chat-c-c)) + (map-keymap + (lambda (event def) + (when (symbolp def) + (if (eq event ?\C-c) + (should (eq (lookup-key input-c-c (vector event)) + 'pi-coding-agent-send)) + (should (eq (lookup-key input-c-c (vector event)) def))))) + chat-c-c))) + ;;; Input-Buffer Chat Navigation (ert-deftest pi-coding-agent-test-input-next-message-moves-chat ()