Skip to content

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

Open
phedoreanu wants to merge 1 commit into
omacom:quattrofrom
phedoreanu:clipboard-paste-ctrl-v
Open

Paste clipboard history with Ctrl+V outside terminals#11300
phedoreanu wants to merge 1 commit into
omacom:quattrofrom
phedoreanu:clipboard-paste-ctrl-v

Conversation

@phedoreanu

Copy link
Copy Markdown

Problem

Pressing Enter in the clipboard manager copies the entry and sends Shift+Insert through wtype. Terminals and GTK apps paste on that, Firefox does not, so in Firefox the panel closes and nothing appears. Same for the image paste helper.

Reproduced on 4.0.3 with a page whose textarea mirrors its content into the window title: synthetic Shift+Insert left it unchanged, synthetic Ctrl+V pasted. The same Shift+Insert pastes fine into foot.

Fix

New hidden omarchy-clipboard-paste-keystroke sends the chord the focused window understands, using the same terminal check as the SUPER+V binding in default/hypr/bindings/clipboard.lua:

  • window tagged terminal gets Shift+Insert, since Ctrl+V is a control character there
  • everything else gets Ctrl+V

omarchy-clipboard-paste-text and omarchy-clipboard-paste-file both call it. The --shift-insert flag on paste-text is renamed to --paste, since it no longer means Shift+Insert. Clipboard.qml is the only caller and is updated.

Testing

  • test/shell.d/clipboard-test.sh stubs hyprctl activewindow -j and covers terminal, browser and untagged windows for both helpers.
  • ./test/shell: only locate-test.sh and snapper-test.sh fail, both on the missing omarchy-iso checkout, unrelated.
  • Live on Hyprland 0.56.2: history entry pastes into foot and into a Firefox textarea.

The clipboard manager pasted every entry with a synthetic Shift+Insert.
Terminals and GTK apps accept that, Firefox does not: pressing Enter in
the panel copied the entry and then pasted nothing into the page.

Send the keystroke the focused window understands instead. Windows with
the terminal tag still get Shift+Insert, since Ctrl+V is a control
character there. Everything else gets Ctrl+V. This is the same rule the
SUPER+V binding already applies. Both paste helpers share the new
omarchy-clipboard-paste-keystroke command, and the paste-text flag is
renamed from --shift-insert to --paste to match what it now does.
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