Skip to content

fix(tui): restore prompt on early escape - #2953

Open
PaiduiXiaowangzi wants to merge 1 commit into
MoonshotAI:mainfrom
PaiduiXiaowangzi:fix/restore-prompt-on-escape
Open

fix(tui): restore prompt on early escape#2953
PaiduiXiaowangzi wants to merge 1 commit into
MoonshotAI:mainfrom
PaiduiXiaowangzi:fix/restore-prompt-on-escape

Conversation

@PaiduiXiaowangzi

Copy link
Copy Markdown

Related Issue

Resolve #2781

Problem

See linked issue.

What changed

  • Keep a directly submitted plain-text prompt restorable until thinking, assistant text, hook output, or a tool call becomes visible.
  • Restore the prompt when Esc cancels during that window, preserving any newer editor draft and suppressing only the matching empty interruption marker.
  • Preserve existing cancellation behavior after visible output and for queued, media, skill, plugin-command, shell, and Ctrl-C flows.

Verification

  • vitest run apps/kimi-code/test/tui/kimi-tui-message-flow.test.ts --testNamePattern "pre-response cancellation|newer draft|after visible output" (3 passed)
  • vitest run apps/kimi-code/test/tui/controllers/editor-keyboard.test.ts (28 passed)
  • tsc -p apps/kimi-code/tsconfig.json --noEmit
  • oxlint on all changed source and test files (0 errors)

Checklist

  • I have read the CONTRIBUTING document.
  • I have linked a related issue, or explained the problem above.
  • I have added tests that prove my feature works.
  • Ran gen-changesets skill, or this PR needs no changeset.
  • Ran gen-docs skill, or this PR needs no doc update.

@changeset-bot

changeset-bot Bot commented Aug 15, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 3b052f1

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@moonshot-ai/kimi-code Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feature Request] 提交后收到回复前按 Esc 应还原输入框,而非留下 "Interrupted by user"

1 participant