Skip to content

Paste an image's path into terminals from clipboard history - #19143

Open
pedro757 wants to merge 1 commit into
omacom:quattrofrom
pedro757:clipboard-paste-image-path-in-terminals
Open

pedro757 wants to merge 1 commit into
omacom:quattrofrom
pedro757:clipboard-paste-image-path-in-terminals

Conversation

@pedro757

Copy link
Copy Markdown

What changes

Picking an image from the clipboard history (Super + Ctrl + V) while a terminal is focused pastes nothing (#10526). omarchy-clipboard-paste-file puts the image/png on the clipboard and sends Shift+Insert, and a terminal's paste only takes text.

When the focused window has Omarchy's terminal tag, this puts the image's file path on the clipboard instead and pastes it with the same Shift+Insert. OpenCode attaches an image whose path is pasted, the same way it does when you copy a PNG in the file manager and paste it into the terminal. Outside terminals, and for Shift+Return (copy only), nothing changes.

It builds on #11998 by @HIMANSHU11827, with two differences:

  • It pastes the path instead of typing it with wtype. OpenCode leaves a typed path as plain text and only attaches a pasted one.
  • It reads the terminal tag from default/hypr/apps/terminals.lua, the same definition default/hypr/bindings/clipboard.lua uses, instead of matching class names.

Trade-off: after the paste, the clipboard and the history hold the path rather than the image. Compared with sending Ctrl+V (#10536), a pasted path is harmless at a plain shell prompt or in vim, where Ctrl+V starts quoted-insert or block selection.

Verification

  • bash test/shell.d/clipboard-test.sh: all 70 checks pass. The new check fails on quattro without the fix.
  • Manual, on Omarchy 4.0.0 with Hyprland 0.57.2 and Ghostty running OpenCode 2.3.0, through a cloned clipboard plugin that runs the patched script: picking a screenshot pasted its path with Shift+Insert and OpenCode attached the image. With fix: type image path when pasting clipboard images into terminals #11998's typed path, OpenCode showed the path as plain text.
  • The tag check against live hyprctl activewindow -j output: Ghostty (terminal*) matches, Brave (chromium-based-browser*) doesn't.
  • Not checked: foot, Alacritty, Kitty, and other agent harnesses such as Claude Code. Kitty's stock binding for Shift+Insert pastes the primary selection, which already affects text pastes from the history.

Screenshots

No visible change: the history panel looks the same; only what gets pasted into a terminal changes.

Terminals paste only text, so picking an image from clipboard history while
a terminal is focused pasted nothing. Paste the image's file path instead,
which image-aware terminal apps like OpenCode attach as an image.

Co-authored-by: HIMANSHU11827 <HIMANSHU11827@users.noreply.github.com>
@greptile-apps

greptile-apps Bot commented Nov 16, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerView in GreptileConfidence Score: 5/5

[Medium impact] The PR appears safe to merge; no actionable issues were found.

Summary

Image picks from clipboard history now paste the saved file path into tagged terminals.

  • Terminal image pastes now use the image’s file path.

Reviews (1) · Last reviewed commit: "Paste an image's path into terminals fro..." · Reviewed by Greptile

@omarchybot

Copy link
Copy Markdown
Collaborator

GPT-6 in Codex read the diff, the clipboard helper and its caller, the base branch's rules, and #10526, and classified this as a bug fix for image selections that paste nothing into terminals. The separate classifier, deepseek-v4p1-flash, returned enhancement. Neither model's effort setting was reported. The classification remains unsettled: fixing the reported paste failure versus introducing image-path paste behavior.

No worker tests or full code review were run, and no class or verification labels were added. Waiting on the maintainer to resolve the classification before verification continues.

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.

2 participants