Skip to content

feat(terminal): right-click send for selected text#85

Merged
attson merged 8 commits into
mainfrom
feat/terminal-right-click-send
May 30, 2026
Merged

feat(terminal): right-click send for selected text#85
attson merged 8 commits into
mainfrom
feat/terminal-right-click-send

Conversation

@attson
Copy link
Copy Markdown
Owner

@attson attson commented May 30, 2026

Summary

Add a 发送 / Send item to the desktop terminal's right-click menu. Sends the current xterm selection back to the same pane's PTY with a trailing \r, executing immediately. Bypasses term.paste() deliberately so bracketed-paste mode doesn't swallow the Enter in zsh / bash / TUIs that have bracketed paste on.

  • Selection is C1-stripped (same path as typed input) and every newline shape (\n, \r\n, \r) normalized to a single \r per line, with one final \r appended.
  • Enabled iff: non-empty selection AND session attached AND remote_permission != view AND this client is the current driver. Greyed otherwise.
  • Two pure helpers (canSendSelection, prepareSendPayload) live in desktop/frontend/src/lib/terminalContextMenu.ts so the SFC stays a thin wrapper.

Spec: docs/superpowers/specs/2026-05-30-terminal-right-click-send-design.md
Plan: docs/superpowers/plans/2026-05-30-terminal-right-click-send.md

Test Plan

  • cd desktop/frontend && npx vitest run — 71 files / 607 tests pass
  • cd desktop/frontend && npm run build — vue-tsc + vite clean
  • In wails dev: select an old command from scrollback → right-click → 发送 → command re-runs
  • Multi-line: select two consecutive command lines → 发送 → both run in order, no spurious trailing prompt
  • No selection → 发送 is greyed
  • remote_permission = view → 发送 is greyed
  • Let another client claim driver (overlay shows) → 发送 is greyed
  • Switch UI language zh-CN ↔ en → label flips 发送 ↔ send; menu still fits viewport near bottom edge

@attson attson merged commit 0e9ae11 into main May 30, 2026
7 checks passed
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