[PR #169] [MERGED] feat(tui): add debounce logic to escape key interrupt #9557

Closed
opened 2026-02-16 18:13:45 -05:00 by yindo · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/anomalyco/opencode/pull/169
Author: @monotykamary
Created: 6/17/2025
Status: Merged
Merged: 6/24/2025
Merged by: @adamdotdevin

Base: devHead: feat/escape-key-debounce


📝 Commits (9)

  • 5d6514a fix: remove unused CoreMessage
  • a4ae83a feat(tui): add debounce logic to escape key interrupt to prevent accidental cancellations
  • d9b693f feat(tui): add configurable interrupt key debounce to prevent accidental cancellations
  • fc028bb feat(tui): add dynamic interrupt key text display
  • 61c4895 chore: go fmt
  • 3718847 refactor: remove redundant interrupt key text storage
  • a02668c chore: go fmt
  • 192c3eb Merge remote-tracking branch 'upstream/dev' into feat/escape-key-debounce
  • 43f2bed fix(tui): use keybind for submit hint

📊 Changes

3 files changed (+81 additions, -18 deletions)

View changed files

📝 packages/opencode/src/provider/transform.ts (+1 -1)
📝 packages/tui/internal/components/chat/editor.go (+36 -16)
📝 packages/tui/internal/tui/tui.go (+44 -1)

📄 Description

Summary

• Implements two-stage escape key mechanism to prevent accidental chat operation cancellations
• First escape press shows "esc again interrupt", second press within 2 seconds actually cancels

https://github.com/user-attachments/assets/5849afd0-4f7f-490d-9ede-cf57053c80f2

Test plan

  • Start a chat operation that shows "esc interrupt"
  • Press escape once and verify it shows "esc again interrupt"
  • Press escape again within 2 seconds and verify operation cancels
  • Start another operation, press escape once, wait 2+ seconds and verify it reverts to "esc interrupt"
  • Verify normal escape behavior still works for non-busy states

🤖 Generated with opencode


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/anomalyco/opencode/pull/169 **Author:** [@monotykamary](https://github.com/monotykamary) **Created:** 6/17/2025 **Status:** ✅ Merged **Merged:** 6/24/2025 **Merged by:** [@adamdotdevin](https://github.com/adamdotdevin) **Base:** `dev` ← **Head:** `feat/escape-key-debounce` --- ### 📝 Commits (9) - [`5d6514a`](https://github.com/anomalyco/opencode/commit/5d6514a798f91f3b7611456a929be082d8f89f09) fix: remove unused CoreMessage - [`a4ae83a`](https://github.com/anomalyco/opencode/commit/a4ae83af7ce532ccfb8b34fa1ac3dac607a16b06) feat(tui): add debounce logic to escape key interrupt to prevent accidental cancellations - [`d9b693f`](https://github.com/anomalyco/opencode/commit/d9b693f6c482c19c0d5dafaa25a18b4cd55300ac) feat(tui): add configurable interrupt key debounce to prevent accidental cancellations - [`fc028bb`](https://github.com/anomalyco/opencode/commit/fc028bb35221c45a3263f91538e7a9f0dcec483c) feat(tui): add dynamic interrupt key text display - [`61c4895`](https://github.com/anomalyco/opencode/commit/61c489592a754f6b44d6f21e09d76025f4fed66a) chore: go fmt - [`3718847`](https://github.com/anomalyco/opencode/commit/3718847269be8c6b6aa719864f81961ee61d5043) refactor: remove redundant interrupt key text storage - [`a02668c`](https://github.com/anomalyco/opencode/commit/a02668ca2573c01bc407656e7a6e2513ccefee7e) chore: go fmt - [`192c3eb`](https://github.com/anomalyco/opencode/commit/192c3eb1b2b6510e5e526124accf6b33591a6798) Merge remote-tracking branch 'upstream/dev' into feat/escape-key-debounce - [`43f2bed`](https://github.com/anomalyco/opencode/commit/43f2bedebee9ced5eb21da3750bda6992aad88c9) fix(tui): use keybind for submit hint ### 📊 Changes **3 files changed** (+81 additions, -18 deletions) <details> <summary>View changed files</summary> 📝 `packages/opencode/src/provider/transform.ts` (+1 -1) 📝 `packages/tui/internal/components/chat/editor.go` (+36 -16) 📝 `packages/tui/internal/tui/tui.go` (+44 -1) </details> ### 📄 Description ## Summary • Implements two-stage escape key mechanism to prevent accidental chat operation cancellations • First escape press shows "esc again interrupt", second press within 2 seconds actually cancels https://github.com/user-attachments/assets/5849afd0-4f7f-490d-9ede-cf57053c80f2 ## Test plan - [x] Start a chat operation that shows "esc interrupt" - [x] Press escape once and verify it shows "esc again interrupt" - [x] Press escape again within 2 seconds and verify operation cancels - [x] Start another operation, press escape once, wait 2+ seconds and verify it reverts to "esc interrupt" - [x] Verify normal escape behavior still works for non-busy states 🤖 Generated with [opencode](https://opencode.ai) --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
yindo added the pull-request label 2026-02-16 18:13:45 -05:00
yindo closed this issue 2026-02-16 18:13:45 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#9557