Skip to content

Paste clipboard history with Ctrl+V outside terminals - #8350

Open
fregys wants to merge 3 commits into
omacom:quattrofrom
fregys:clipboard-paste-follows-universal-paste
Open

fregys wants to merge 3 commits into
omacom:quattrofrom
fregys:clipboard-paste-follows-universal-paste

Conversation

@fregys

@fregys fregys commented Aug 26, 2026 •

Copy link
Copy Markdown

Selecting an entry from clipboard history always sends Shift+Insert. That keystroke is handled by each client application rather than by the compositor, so it is inconsistent across GUI apps — in a browser window nothing pastes at all. The entry lands on the clipboard but never reaches the window, so you have to press Ctrl+V yourself. In a terminal it works, which is why it looks intermittent rather than broken.

Omarchy already solves this for universal paste in default/hypr/bindings/clipboard.lua:

o.bind("SUPER + V", "Universal paste", universal_clipboard_shortcut("CTRL", "V", "SHIFT", "Insert"))

Ctrl+V for normal windows, Shift+Insert for terminals, off the terminal tag from default/hypr/apps/terminals.lua. The clipboard paste helpers just don't follow that rule. This makes them follow it — terminals keep Shift+Insert, everything else gets Ctrl+V.

Same fix in omarchy-clipboard-paste-text and omarchy-clipboard-paste-file. The inline-text path still types instead of pasting, unchanged.

Checked on 4.0.1 with different text in the clipboard and in the primary selection: wtype -M shift -k Insert -m shift pastes nothing into a browser window. I've been running the Ctrl+V half locally since 4.0 and it pastes correctly there and in Electron apps.

test/shell.d/clipboard-test.sh now stubs hyprctl and covers both branches. ./test/shell and ./test/cli pass.

Copilot AI balanced review requested due to automatic review settings August 26, 2026 09:11

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Updates clipboard-history paste behavior to use terminal-aware shortcuts.

Changes:

  • Uses Shift+Insert for terminals and Ctrl+V elsewhere.
  • Adds terminal/non-terminal text-helper tests.

Tip

If you aren't ready for review, convert to a draft PR.
Click "Convert to draft" or run gh pr ready --undo.
Click "Ready for review" or run gh pr ready to reengage.

Reviewed changes

Copilot reviewed 1 out of 3 changed files in this pull request and generated no comments.

File Description
bin/omarchy-clipboard-paste-text Adds adaptive paste shortcut selection.
bin/omarchy-clipboard-paste-file Applies adaptive shortcuts to file pasting.
test/shell.d/clipboard-test.sh Tests text pasting by focused window type.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Clipboard history always sent Shift+Insert, which Electron and browser
windows ignore, so selecting an entry copied it but never pasted it.

Universal paste already splits on the terminal tag in
default/hypr/bindings/clipboard.lua; the paste helpers now do the same.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
omarchybot and others added 2 commits September 28, 2026 20:35
quattro renamed the tensaku-edit test stub to omasnap on the same chmod line this branch adds the hyprctl stub to.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Universal paste on quattro now sends Ctrl+Shift+V to terminals, so the helpers no longer share its split; keep Shift+Insert for terminals and say why instead.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@omarchybot

Copy link
Copy Markdown
Collaborator

Reviewed by Claude Opus 5.5. The second opinion (Codex Medium) did not run on this pull request: the reviewer answered a ping, but its daily review budget was spent, so this is one model's reading.

Could not reproduce the bug on a stock install. On a worker VM built from the Omarchy ISO, running current quattro (b18ab49), the unchanged Shift+Insert paste landed every time in Chromium, the default and only browser installed:

  • omarchy-clipboard-paste-text --shift-insert and omarchy-clipboard-paste-file text/plain into a Chromium <textarea>, with a different string in the primary selection: pasted the clipboard text.
  • The real flow: focus Chromium, open the clipboard manager with omarchy-shell shell toggle omarchy.clipboard, press Enter. Into both a <textarea> and a contenteditable element: pasted, twice each.
  • Terminals (foot, tagged terminal): pasted before and after this change, so the terminal branch is not a regression.

The Ctrl+V branch also pastes correctly, so the change does no harm there. But a fix is only worth merging against a bug somebody has seen, and on a stock install this one did not show. @fregys, which application and browser does nothing on Shift+Insert for you — Firefox or Zen, a particular Electron app, or a particular site's editor? The exact app and version, and the steps, are what would let this be reproduced.

Pushed to your branch:

  • 9a6a75e merges quattro, which had renamed the tensaku-edit test stub to omasnap on the same chmod line you added hyprctl to. That was the only conflict.
  • 5da4e0d rewords the comment on paste_into_focused_window in both helpers. Universal paste in default/hypr/bindings/clipboard.lua now sends Ctrl+Shift+V to terminals, so "same split as universal paste" was no longer true. Keeping Shift+Insert for terminals is still the right call; the comment now says why.

On the worker, test/shell.d/clipboard-test.sh passes (74/74). ./test/cli has one failure, vscode generated theme references current theme file, which fails identically on quattro and is unrelated to this change.

Related: #12377 makes the same change (Ctrl+V outside terminals, through Hyprland send_key_state) and also covers the emoji picker, #12376. The two compete, so choosing between them is for the maintainer. #12991 and #13103 change the same lines of these helpers to fix a different bug: pasting into the window under the pointer, #12987.

Waiting on the author for a reproduction; no verified label until one is seen.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants