Skip to content

feat(pane-menu): smart top row anticipates Copy selection from tmux buffer#146

Merged
NagyVikt merged 1 commit into
mainfrom
agent/claude/tmux-menu-smart-top-row-2026-05-16-01-28
May 15, 2026
Merged

feat(pane-menu): smart top row anticipates Copy selection from tmux buffer#146
NagyVikt merged 1 commit into
mainfrom
agent/claude/tmux-menu-smart-top-row-2026-05-16-01-28

Conversation

@NagyVikt
Copy link
Copy Markdown
Contributor

Automated by gx branch finish (PR flow).

…uffer

When tmux already holds selection text in its paste buffer, surface a one-tap
"Copy selection · <preview>…" row at the top of the shift+right-click pane
context menu so the operator's most-probable next action is on the cursor by
default. Cursor lands on it via the existing arrow-nav focus seeker; one Enter
copies the selection to the system clipboard. Hidden when the buffer is empty.

bash (scripts/codex-fleet/bin/pane-context-menu.sh):
- Probe BUFFER_SIZE / BUFFER_SAMPLE via `tmux show-buffer` before render.
- Conditionally prepend "Copy selection · <preview>…" row (hotkey 'S').
- Wire dispatch through pane-menu-clip-dual.sh for dual-clipboard parity.

rust (rust/fleet-tui-poc/src/main.rs):
- Add ctx_buffer_preview: Option<String> on App; probe in open_context_menu.
- Extend context_menu_items signature with buffer_preview parameter.
- Switch CtxItem.label to String so the runtime preview can be embedded;
  drop Copy from CtxItem (Clone is enough — only the renderer iterates).
- Add 'S' branch to context_menu_tmux_args: tmux save-buffer | wl-copy.

Verification:
- bash -n scripts/codex-fleet/bin/pane-context-menu.sh -> exit 0
- shellcheck -> exit 0 (1 finding, identical to base: pre-existing SC1091)
- cargo check -p fleet-tui-poc -> exit 0
- cargo build --release -p fleet-tui-poc -> exit 0
- cargo test -p fleet-tui-poc -> 3 passed; 0 failed

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@NagyVikt NagyVikt merged commit 8db44a8 into main May 15, 2026
@NagyVikt NagyVikt deleted the agent/claude/tmux-menu-smart-top-row-2026-05-16-01-28 branch May 15, 2026 23:46
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