Skip to content

Bug Report: Alt+Backspace incorrectly closes question panels instead of deleting word #1744

@APairOfClaws

Description

@APairOfClaws

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

  1. Start kimi-cli and enter plan mode
  2. Make the AI generate a plan that requires user input (e.g., using ExitPlanM
    with options)
  3. When the question panel appears, select the "Other" option to enter custom
    t
  4. Type some text (e.g., "this is a test")
  5. 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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions