Repository navigation
Fix clipboard paste into browsers with Ctrl+V - #12377
AndrijaSkontra wants to merge 1 commit into
Conversation
|
The new helper still sends The new tests force every dispatch to fail and only exercise the |
|
Browser paste via Ctrl+V (terminals keep Shift+Insert) is the right split — live helpers still always Currently CONFLICTING. Please also send |
Shift+Insert via wtype works in terminals but often fails in browsers. Add omarchy-cmd-send-paste, mirroring SUPER+V: Shift+Insert for terminal-tagged windows, Ctrl+V elsewhere, preferring Hyprland send_key_state over wtype. Keys are sent as keycodes (code:55 = V, code:118 = Insert) so non-Latin layouts work (omacom#11201).
1135336 to
ebc8f4d
Compare
|
| send_key_state() { | ||
| local mods="$1" key="$2" state="$3" | ||
|
|
||
| hyprctl dispatch "hl.dsp.send_key_state({ mods = $(lua_string "$mods"), key = $(lua_string "$key"), state = $(lua_string "$state") })" >/dev/null 2>&1 |
There was a problem hiding this comment.
Paste error replies are ignored
send_key_state discards the reply from hyprctl and checks only its exit status. If hyprctl exits successfully but returns an error, the helper skips wtype and paste can silently stop. The existing dispatch_lua_expression also requires an empty reply or ok. Use the same check here and add a test for an error reply with a successful exit status.
| WL_COPY_OUT="$TMPDIR/copied" WTYPE_OUT="$TMPDIR/wtype" PATH="$TMPDIR/bin:$ROOT/bin:$PATH" \ | ||
| "$ROOT/bin/omarchy-clipboard-paste-file" --copy-only image/png "$TMPDIR/image.png" |
There was a problem hiding this comment.
The changed file-paste path has no test that reaches omarchy-cmd-send-paste. Its only test uses --copy-only, which exits before the new call, so the tests would still pass if file paste stopped sending a key. Add a file-paste test without that flag and assert the browser paste chord, while keeping the copied-content check.
|
Thanks for the rebase and the shared LGTM from my side. Greptile's P2s (check hyprctl error replies before skipping wtype; add a non- |
|
I looked at this revision (ebc8f4d) to decide whether it is a bug fix or a new feature before verifying it, and the two models that classify items separately did not agree. Claude Opus 5.5 read it as a bug: pasting a clipboard-manager entry into a browser sends Shift+Insert through Because the classification is unsettled, I have taken the |
Title
Fix clipboard paste into browsers with Ctrl+V
Body
Pasting from the clipboard manager always sent Shift+Insert through
wtype. That works in terminals but often fails in browsers.This adds
omarchy-cmd-send-paste, which works the same way as SUPER+V:send_key_state(down/up) first and only falls back towtypewhen the dispatch fails.code:55(V) andcode:118(Insert), instead ofkey="V". That way paste also works on non-Latin layouts (Universal copy/paste/cut (SUPER+C/V/X) fails on non-Latin keyboard layouts #11201, same approach as Fix universal clipboard shortcuts on non-Latin keyboard layouts #12378).omarchy-clipboard-paste-text --shift-insertandomarchy-clipboard-paste-filenow use the helper.Emoji insert is not part of this PR anymore. #6892 handles it.
Tests
test/shell.d/clipboard-test.shnow covers:send_key_statecalls withcode:55for browsers andcode:118for terminals, and thatwtypeisn't called