Skip to content

feat(tui): atomic multi-line and image paste for terminal chat - #377

Merged
rschardosin merged 3 commits into
mainfrom
feat/tui-paste-placeholders
Jul 29, 2026
Merged

feat(tui): atomic multi-line and image paste for terminal chat#377
rschardosin merged 3 commits into
mainfrom
feat/tui-paste-placeholders

Conversation

@rschardosin

Copy link
Copy Markdown
Contributor

Summary

  • Collapse multi-line clipboard pastes (4+ lines) into atomic [Pasted: N lines] composer tokens; expand to full content on submit for history and the agent.
  • Support pasting images as atomic [image #N] tokens and send them to Studio as multimodal chat attachments.
  • Read system clipboard images on macOS (pasteboard) and Linux (wl-paste / xclip); treat placeholders as single tokens for navigation, typing, and deletion.

Test plan

  • go test ./pkg/tui ./pkg/launcher ./pkg/client -count=1
  • Paste 3 lines of text → inserted as-is and composer grows
  • Paste 4+ lines of text (Ctrl+V and Cmd+V on macOS) → [Pasted: N lines], Enter sends full content
  • Arrow keys / Ctrl+W / Backspace treat text and image placeholders as atomic tokens
  • Paste a screenshot from clipboard → [image #1]; submit includes attachment for the platform
  • Linux: image paste works with wl-paste (Wayland) or xclip (X11) on PATH

Keep the terminal composer readable for multi-line paste while preserving full content on submit. Command+V and Ctrl+V both collapse 4+ line pastes, and placeholders behave as single tokens for navigation, typing, and deletion.
Read clipboard images on paste (macOS), insert atomic [image #N] placeholders, and send them to Studio as multimodal attachments on submit.
Add Wayland and X11 image clipboard support so [image #N] paste works on Linux as well as macOS, without Windows support.
@rschardosin
rschardosin merged commit 076df59 into main Jul 29, 2026
5 checks passed
@rschardosin
rschardosin deleted the feat/tui-paste-placeholders branch July 29, 2026 04:52
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