MoonshotAI / MoonshotAI/kimi-cli

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

Open Beginner friendly
#1,744 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
11.4k
Forks
1.3k
Avg merge
9h 47m
Merged PRs (30d)
2

Description

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.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start in kimi_cli/ui/shell/prompt.py and inspect the eager Escape binding and the question panel's text-input mode. Reproduce the issue in kimi-cli using an Other option, then verify that Alt+Backspace and Alt+Delete delete a word without closing or cancelling the panel, while plain Escape still exits it.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
cli
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Quiet
Clarity
Clearly specified
Newbie friendliness
78/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.