kilocode icon indicating copy to clipboard operation
kilocode copied to clipboard

[FEATURE]: Option to disable Escape-to-abort in the VS Code extension (Agent Manager / chat)

Open bamboo98 opened this issue 2 months ago • 3 comments

Problem

In the VS Code extension, pressing Escape while a session is busy aborts/interrupts the running agent task. This includes pressing Escape in the prompt input box of Agent Manager sessions.

Current behavior

  • Escape→abort is hardcoded in the webview: a global document keydown listener in webview-ui/src/components/chat/ChatView.tsx plus a handler in PromptInput.tsx that call session.abort().
  • The CLI TUI's session_interrupt keybind in tui.jsonc does not affect the VS Code extension; webview key handling is isolated from VS Code-level keybindings (see #6973), so there is no user-side workaround.
  • I verified the latest packages/kilo-vscode/package.json (contributes.configuration, v7.5.15): no setting exists to control Escape behavior.

Requested change

Add a configuration option to disable or remap the Escape-to-abort behavior in the extension webview, for example:

  • a boolean setting like kilo-code.new.abortOnEscape (default true to preserve current behavior), or
  • a "session interrupt key" setting (default escape, none to disable), mirroring the TUI's session_interrupt keybind.

Environment

  • VS Code extension: Kilo Code v7.5.x
  • Windows 11

bamboo98 avatar Sep 06 '26 20:09 bamboo98

Would a double escape setting not make more sense here? So that an abort requires to esc presses?

In those cases: 'dismiss a dialog, cancel a rename, or clear focus' the agent should not abort, so I am wondering what the reproducing case here is?

Finally you mention 'work cannot be resumed'. Which work cannot be resumed? Do you have an example.

Thanks, much appreciated.

marius-kilocode avatar Sep 07 '26 09:09 marius-kilocode

TL;DR Try Kilo Code KB Patch extension on VS Marketplace or Open VSX

A state-based split has worked better for me than a timing-based one:

  • Escape aborts only when the chat box is empty
  • Escape with text in the box dismisses an open autocomplete and does nothing else
  • Shift+Escape always aborts

The appeal over a double tap is that the signal is the state you are already in: if you have typed something, you are mid-compose, so an abort is unlikely to be what you meant. It also keeps one deliberate key for the intentional abort. Spaces and newlines do not count as text.

On reproducing cases, two older reports cover this ground, both auto-closed by the stale bot rather than decided:

  • #8080: the @ or / menu is open when a permission request arrives, and Escape to close the menu denies the permission.
  • #9271: the abort leaves the prompt on screen. @imanolmzd-svg noted there that "when the chat area is focused, it breaks, but when it's not, it works fine", which is the same focus and state dependency.

That routing is what the Kilo Code KB Patch extension does today (also available on OpenVSX), in case it is useful as a reference before a native setting lands.

zeyutang avatar Sep 11 '26 18:09 zeyutang

A clarification and an apology regarding the original report.

The statement that interrupted work "cannot be resumed" was an unsupported inference — exaggerated wording that got into this issue while it was drafted with AI assistance. I should not have included it, and the issue body has been updated to remove it. Sorry for the confusion the claim caused.

For accuracy: aborting sends a cooperative stop signal that ends the current turn; the session itself remains and can be continued by sending a follow-up message — the interrupted turn just does not resume on its own.

On the reproducing case: the main scenario in which this causes real trouble is accidental Escape presses while switching between and operating across multiple windows.

bamboo98 avatar Sep 11 '26 18:09 bamboo98