Skip to content

feat(keys): keep agent sessions open, and "Copied" for an agent's own copy (0.54.0) - #237

Merged
Maxaubert merged 2 commits into
mainfrom
feat/agent-guard
Oct 16, 2026
Merged

Maxaubert merged 2 commits into
mainfrom
feat/agent-guard

Conversation

@Maxaubert

Copy link
Copy Markdown
Owner

Owner, 2026-10-16: "when i click ctrl c with nothing marked in claude it clears the input text and says click ctrl c again to close claude. add settings that are by default on dont close sessions with keyboard shortcuts, this stops ctrl c and ctrl d from doing anything like that, one setting", and yes to a "Copied" badge for Claude's own copies ("the copied chip dont always show").

Keep agent sessions open (Settings > Terminal > Keys, on by default)

  • Where an agent (Claude, Codex) runs in the tab in front: Ctrl+D never reaches it; Ctrl+C reaches it only while it works, where it is how you stop it.
  • A selection's Ctrl+C still copies (that rule comes first). Plain shells keep both keys.
  • Why the app does it: Claude Code hardcodes both keys; its keybindings refuse to rebind Ctrl+C and Ctrl+D.
  • Code: lib/agentGuardPrefs.ts, a keymap chord agent-guard fed the agent in front and its working state (guardContext), App drops the key.

"Copied" for an agent's own copy (core)

  • Claude Code's fullscreen view draws its own selection and copies it on the mouse's release through the system clipboard, never through the terminal, so the app showed nothing.
  • core/renderer/lib/appCopyNotice.ts: after a selecting press (a drag, a double or triple click) in a program that has the mouse, the clipboard's text is checked at 150, 500 and 1000 ms; changed since the press, the badge shows. The text is compared and dropped, never kept or logged.

Tests: unit 2164 pass (4 for the guard rule, 4 for the copy notice). e2e imagePaste now checks Ctrl+D and Ctrl+C never reach an idle stand-in agent (passes). Full e2e: two full runs had windows closed from outside mid-scenario (7 to 26 scenarios hit, at random points, while something also wrote the real clipboard 17 and 34 times; the Prism session ran nothing then). Every affected scenario passes rerun alone: attention, clickCaret, findKey, agentHooks, caretHold, mouseReport, selectionEdit.

Core 0.40.11 -> 0.40.12, app 0.53.4 -> 0.54.0. Installed for the owner to try.

🤖 Generated with Claude Code

https://claude.ai/code/session_017XYVRPzvhLpPCr75uB6uaA

Maxaubert and others added 2 commits October 16, 2026 05:06
… copy (0.54.0, core 0.40.12)

Owner, 2026-10-16: "when i click ctrl c with nothing marked in claude it
clears the input text and says click ctrl c again to close claude. add
settings that are by default on dont close sessions with keyboard shortcuts,
this stops ctrl c and ctrl d from doing anything like that, one setting",
and yes to "Copied" for Claude's own copies ("the copied chip dont always
show").

- Keep agent sessions open (Settings > Terminal > Keys, on by default):
  where an agent runs in the tab in front, Ctrl+D never reaches it and
  Ctrl+C only while it works (where it stops it). A selection's Ctrl+C still
  copies; plain shells keep both keys. Claude Code hardcodes both keys (its
  keybindings refuse to rebind them), so the app takes them first: a
  keymap chord, `agent-guard`, fed the agent in front and its working state.
- core lib/appCopyNotice: Claude Code's fullscreen view copies its own
  selection on release, past the terminal, so no badge showed. A selecting
  press (a drag, a double or triple click) in a program that has the mouse
  is followed by a look at the clipboard's text (at 150, 500 and 1000 ms):
  changed since the press, the badge shows. Compared and dropped, never kept.
- e2e imagePaste: Ctrl+D and Ctrl+C never reach an idle stand-in agent.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017XYVRPzvhLpPCr75uB6uaA
…e badge

Owner, 2026-10-16, trying #237: "highlighting text then clicking ctrl c
does nothing, it does not show the copied chip". Claude Code's fullscreen
view holds its own selection, invisible to the terminal, and Ctrl+C is its
copy then; the keep-agents-open rule took it as a "clear the prompt". Now a
selecting release (a drag, a double or triple click) in a program that has
the mouse marks its selection as standing until the next press, the next
other key or the Ctrl+C that copies it; while it stands Ctrl+C goes through,
and the clipboard is looked at after it for the badge.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017XYVRPzvhLpPCr75uB6uaA
@Maxaubert
Maxaubert merged commit 9304691 into main Oct 16, 2026
2 checks passed
github-actions Bot pushed a commit that referenced this pull request Oct 16, 2026
… copy (0.54.0) (#237)

* feat(keys): keep agent sessions open, and "Copied" for an agent's own copy (0.54.0, core 0.40.12)

Owner, 2026-10-16: "when i click ctrl c with nothing marked in claude it
clears the input text and says click ctrl c again to close claude. add
settings that are by default on dont close sessions with keyboard shortcuts,
this stops ctrl c and ctrl d from doing anything like that, one setting",
and yes to "Copied" for Claude's own copies ("the copied chip dont always
show").

- Keep agent sessions open (Settings > Terminal > Keys, on by default):
  where an agent runs in the tab in front, Ctrl+D never reaches it and
  Ctrl+C only while it works (where it stops it). A selection's Ctrl+C still
  copies; plain shells keep both keys. Claude Code hardcodes both keys (its
  keybindings refuse to rebind them), so the app takes them first: a
  keymap chord, `agent-guard`, fed the agent in front and its working state.
- core lib/appCopyNotice: Claude Code's fullscreen view copies its own
  selection on release, past the terminal, so no badge showed. A selecting
  press (a drag, a double or triple click) in a program that has the mouse
  is followed by a look at the clipboard's text (at 150, 500 and 1000 ms):
  changed since the press, the badge shows. Compared and dropped, never kept.
- e2e imagePaste: Ctrl+D and Ctrl+C never reach an idle stand-in agent.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017XYVRPzvhLpPCr75uB6uaA

* fix(keys): an agent's own selection takes Ctrl+C as its copy, with the badge

Owner, 2026-10-16, trying #237: "highlighting text then clicking ctrl c
does nothing, it does not show the copied chip". Claude Code's fullscreen
view holds its own selection, invisible to the terminal, and Ctrl+C is its
copy then; the keep-agents-open rule took it as a "clear the prompt". Now a
selecting release (a drag, a double or triple click) in a program that has
the mouse marks its selection as standing until the next press, the next
other key or the Ctrl+C that copies it; while it stands Ctrl+C goes through,
and the clipboard is looked at after it for the badge.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017XYVRPzvhLpPCr75uB6uaA

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Maxaubert added a commit that referenced this pull request Oct 16, 2026
…0.41.0)

Both sides added to TerminalPanel's session setup (the question watch and the
agent copy watch); both kept. App 0.54.0 was taken on main by #237.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017XYVRPzvhLpPCr75uB6uaA
@Maxaubert
Maxaubert deleted the feat/agent-guard branch October 16, 2026 03:22
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.

1 participant