fix(tui): ESC no longer exits YOLO; Ctrl+C copies selection to clipboard#3051
Merged
Merged
Conversation
Two behavioral fixes: 1. ESC no longer disables YOLO mode (--dangerously-skip-permissions). Previously, pressing ESC while idle in YOLO mode called SetBypass(false), silently reverting to 'auto'. Now ESC when idle in YOLO mode just clears input or arms the double-Esc rewind gesture — same as normal mode. YOLO is only exited via Shift+Tab cycle or --yolo flag restart. 2. Ctrl+C on an empty composer with an active text selection copies the selected text to clipboard (standard terminal convention) instead of arming the double-press-to-quit gesture. The selection state is saved before the generic keystroke-clears-selection path at the top of the KeyPress handler. Fixes: ESC → YOLO exit; Ctrl+C → copy selection
esengine
pushed a commit
that referenced
this pull request
Jun 9, 2026
Complete #3051: drop the plan-mode arm from the Esc handler so mode switches are exclusively Shift+Tab driven (Esc must not silently drop to a less-permissive mode). Also hoist Ctrl+C selection-copy above clear-input so copying a selection no longer wipes a half-typed draft.
SuMuxi66
pushed a commit
to SuMuxi66/DeepSeek-Reasonix
that referenced
this pull request
Jun 10, 2026
Complete esengine#3051: drop the plan-mode arm from the Esc handler so mode switches are exclusively Shift+Tab driven (Esc must not silently drop to a less-permissive mode). Also hoist Ctrl+C selection-copy above clear-input so copying a selection no longer wipes a half-typed draft.
dorokuma
pushed a commit
to dorokuma/DeepSeek-Reasonix
that referenced
this pull request
Jun 10, 2026
Complete esengine#3051: drop the plan-mode arm from the Esc handler so mode switches are exclusively Shift+Tab driven (Esc must not silently drop to a less-permissive mode). Also hoist Ctrl+C selection-copy above clear-input so copying a selection no longer wipes a half-typed draft.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
问题
1. ESC 意外退出 YOLO 模式
空闲时按 ESC 会调用
SetBypass(false),将 YOLO 模式(--dangerously-skip-permissions)静默还原为 auto。用户仅想清空输入或双击 ESC 呼出回滚选择器时,却丢失了 YOLO 状态。2. Ctrl+C 无法复制选中文本
空闲时用鼠标选中文本后按 Ctrl+C,触发的却是"再按一次退出"序列,而不是复制到剪贴板。Ctrl+C 复制是标准终端约定。
修复
ESC → YOLO
删除了 ESC 处理中的
case m.ctrl.Bypass()分支。YOLO 模式现在仅通过Shift+Tab循环(normal → plan → YOLO → normal)退出。修改文件:
internal/cli/chat_tui.go— ESC switch 分支(删除了case m.ctrl.Bypass(): m.ctrl.SetBypass(false))Ctrl+C → 复制选中文本
在通用按键清除选中状态之前保存它;Ctrl+C 处理中先检查是否有选中文本,有则复制到剪贴板,不触发退出序列。
修改文件:
internal/cli/chat_tui.go— 在 KeyPress 入口处保存sel := m.sel,Ctrl+C 分支新增选中文本检测+复制逻辑测试
新增
TestCtrlCCopySelection— 验证选中+Ctrl+C 复制、清除选中、不启动退出、后续 Ctrl+C 正常退出。Closes: N/A (无对应 issue)