Skip to content

fix: Ctrl+C in running state copies selection instead of cancelling turn#3947

Merged
esengine merged 1 commit into
esengine:main-v2from
CnsMaple:fix/ctrl-c-selection-copy
Jun 11, 2026
Merged

fix: Ctrl+C in running state copies selection instead of cancelling turn#3947
esengine merged 1 commit into
esengine:main-v2from
CnsMaple:fix/ctrl-c-selection-copy

Conversation

@CnsMaple

@CnsMaple CnsMaple commented Jun 11, 2026

Copy link
Copy Markdown
Contributor

Problem

When the chat TUI is running (tuiRunning state), selecting text and pressing Ctrl+C should copy the selection to clipboard — same as the idle-state behavior. Instead, it cancels the in-flight turn.

Fix

In the Ctrl+C handler for the tuiRunning state, check for an active text selection first:

  • Selection active -> copy to clipboard (reuses the same copy logic as the idle state)
  • No selection -> cancel the current turn (original behavior)

@github-actions github-actions Bot added v2 Go rewrite (1.x) — main-v2 branch, active development tui Terminal UI / CLI (internal/cli, internal/control) labels Jun 11, 2026

@esengine esengine left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Exactly right — same selection-first contract as the idle path (and it reuses that path's restore/copy/clear dance verbatim, so the two can't diverge in behavior). Losing an in-flight turn because you tried to copy output was a nasty trap. Merging, thanks!

@esengine esengine merged commit 4fbebb3 into esengine:main-v2 Jun 11, 2026
15 checks passed
@CnsMaple CnsMaple deleted the fix/ctrl-c-selection-copy branch June 12, 2026 02:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

tui Terminal UI / CLI (internal/cli, internal/control) v2 Go rewrite (1.x) — main-v2 branch, active development

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants