Description
When typing in the "Other" option field of ExitPlanMode or AskUserQuestion pan
els, pressing Alt+Backspace (or Alt+Delete) to delete a word backward unexpect
edly closes/interrupts the question panel instead of performing the word delet
ion.
Steps to Reproduce
- Start kimi-cli and enter plan mode
- Make the AI generate a plan that requires user input (e.g., using ExitPlanM
with options)
- When the question panel appears, select the "Other" option to enter custom
t
- Type some text (e.g., "this is a test")
- Press Alt+Backspace to delete the last word
Expected Behavior
The last word ("test") should be deleted, leaving "this is a ".
Actual Behavior
The entire question panel closes/interrupts, and the conversation is cancelled
.
Environment
• OS: Linux (Ubuntu 24.04)
• Terminal: tmux/Ghostty
• kimi-cli version: (latest)
Technical Details
The issue is in kimi_cli/ui/shell/prompt.py. The Alt+Backspace key combination
sends an escape sequence (ESC + Backspace). The code has an eager key binding
for the escape key that exits the question panel, which intercepts the first p
art of the sequence before the backspace is processed.
Suggested Fix: Add key bindings for escape backspace and escape delete sequenc
es that call backward_kill_word() when the question panel is in text input mod
e. These bindings need to be registered before the simple escape binding to ta
ke precedence.
Description
When typing in the "Other" option field of ExitPlanMode or AskUserQuestion pan
els, pressing Alt+Backspace (or Alt+Delete) to delete a word backward unexpect
edly closes/interrupts the question panel instead of performing the word delet
ion.
Steps to Reproduce
with options)
t
Expected Behavior
The last word ("test") should be deleted, leaving "this is a ".
Actual Behavior
The entire question panel closes/interrupts, and the conversation is cancelled
.
Environment
• OS: Linux (Ubuntu 24.04)
• Terminal: tmux/Ghostty
• kimi-cli version: (latest)
Technical Details
The issue is in kimi_cli/ui/shell/prompt.py. The Alt+Backspace key combination
sends an escape sequence (ESC + Backspace). The code has an eager key binding
for the escape key that exits the question panel, which intercepts the first p
art of the sequence before the backspace is processed.
Suggested Fix: Add key bindings for escape backspace and escape delete sequenc
es that call backward_kill_word() when the question panel is in text input mod
e. These bindings need to be registered before the simple escape binding to ta
ke precedence.