Skip to content

Add in-app text selection for TUI copy#1

Merged
edwin-zvs merged 1 commit into
mainfrom
mouse-selection-toggle
May 16, 2026
Merged

Add in-app text selection for TUI copy#1
edwin-zvs merged 1 commit into
mainfrom
mouse-selection-toggle

Conversation

@edwin-zvs

@edwin-zvs edwin-zvs commented May 16, 2026

Copy link
Copy Markdown
Contributor

Summary

  • add drag selection over the rendered TUI frame and copy selected visible text via OSC 52 on mouse release
  • preserve existing click/resize/tool-block mouse behavior by treating non-drag mouse up as the normal click
  • keep C-x m as a fallback toggle for native terminal mouse selection
  • document drag-to-copy and the fallback toggle in help and README

Test

  • cargo check -p agentd-cli

@edwin-zvs
edwin-zvs force-pushed the mouse-selection-toggle branch 2 times, most recently from 6154b0b to f38692f Compare May 16, 2026 20:00
@edwin-zvs edwin-zvs changed the title Allow toggling mouse capture for text selection Add in-app text selection for TUI copy May 16, 2026
@edwin-zvs
edwin-zvs force-pushed the mouse-selection-toggle branch 5 times, most recently from 86cd630 to 90297a7 Compare May 16, 2026 20:38
@edwin-zvs
edwin-zvs force-pushed the mouse-selection-toggle branch from 90297a7 to 0dd6934 Compare May 16, 2026 20:43
@edwin-zvs
edwin-zvs merged commit 220b369 into main May 16, 2026
1 check passed
@edwin-zvs
edwin-zvs deleted the mouse-selection-toggle branch May 16, 2026 20:45
edwin-zvs added a commit that referenced this pull request Jun 23, 2026
…enabled mode 2004 (#457)

Dragging an image into a Claude Code session running inside construct
landed the image *path* as literal text instead of an `[image #N]`
reference like the native Claude Code CLI produces.

Root cause: the client received the drag correctly as a bracketed-paste
event from the outer terminal, but forwarded it to the child PTY as raw
bytes, dropping the `ESC[200~`/`ESC[201~` framing. Claude Code's
drag-image detection (and its multiline-paste guard) only fire on a real
bracketed paste, so the path was treated as typed keystrokes.

The client already models each child's terminal via vt100, which tracks
DEC mode 2004 (`screen.bracketed_paste()`) — it just never consulted it
when forwarding a paste. Now `dispatch_paste_text` wraps the payload in
the bracketed-paste markers a real terminal would send, but only when the
target child currently has mode 2004 enabled (claude/codex/shell do;
synth/smith sessions fall back to raw, preserving prior behavior). The
closing marker is stripped from the payload first so an embedded
`ESC[201~` can't end the paste early.

Verified end-to-end against the real claude binary in a PTY: a
bracketed-pasted image path renders as `[Image #1]`; the same path sent
raw stays literal text.

Adds spec 0034.
edwin-zvs added a commit that referenced this pull request Jun 29, 2026
…g (0053) (#576)

Diagnosed from the 'construct improvements' session: after the planning pass
declared the task pending, dispatching a subagent moved the task into the
"In progress" section and appended a @{session} clip — which changes the
block's text and therefore its id. The old id dropped from the pending set
before the new id was declared, so the set transiently emptied; the daemon
reaped the whole run on that empty, and the agent's follow-up re-declaration
of the new id hit a removed run and was a silent no-op. All shimmer vanished.
The agent's own narration: "the system won't re-light a settled/new block".

Fix #1 — survive transient empty. narrow_program_run / set_program_run_pending
no longer remove a run when its pending set empties; program_run_snapshot
reports no active run on empty but KEEPS the record so a later declaration
revives it. An empty run is reaped only on a terminal owning-session state,
the owning session going idle with nothing pending, or the inactivity
backstop (note_session_state handles the idle case).

Fix #2 — atomic keep_pending. Re-introduce a per-edit ProgramEdit.keep_pending
flag: an edit that changes a still-pending block re-adds the resulting block's
new id in the SAME narrowing call (anchored on the edit's new_string), so a
move/annotate never transiently empties the set and the agent needn't know the
post-edit id. The call-level shimmer id-list still handles declaring arbitrary
existing blocks (planning pass).

Specs 0042 (stop lifecycle: transient empty is not a stop), 0048 (contract:
use keep_pending when editing an in-flight block), 0053 (both mechanisms +
transient-empty survival). Three new daemon tests; #567/#569 tests unaffected.
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