Skip to content

Paste with Ctrl+Shift+V in terminals and Herdr - #72

Open
nchudleigh wants to merge 1 commit into
typecraft-dev:mainfrom
nchudleigh:fix/terminal-paste
Open

nchudleigh wants to merge 1 commit into
typecraft-dev:mainfrom
nchudleigh:fix/terminal-paste

Conversation

@nchudleigh

Copy link
Copy Markdown

"Paste to Active App" did nothing in Herdr and pasted the wrong thing in most terminals.

Why: the paste script always sent Shift+Insert, the keystroke Omarchy's clipboard history uses. Herdr binds paste to Ctrl+Shift+V and passes Shift+Insert to the program in the pane as an Insert key. Alacritty, Kitty and Ghostty map Shift+Insert to the primary selection, not the clipboard. SPEC §5.3 already asks for Ctrl+Shift+V in terminals.

Change: after the launcher unmaps, services/ClipboardWriter.qml reads the focused window's class from hyprctl activewindow -j. It sends Ctrl+Shift+V to herdr, alacritty, kitty, foot, wezterm, ghostty, konsole, gnome-terminal and ptyxis, and Shift+Insert to everything else. The script is still constant, so no user text reaches argv. This affects every paste that goes through clipboard.paste, such as the calculator's Paste Answer.

Tested: I ran the script with stand-in wl-copy, hyprctl and wtype. herdr-app, Alacritty, Ghostty and Kitty got Ctrl+Shift+V; Slack and Chromium got Shift+Insert. The plugin reloaded with no QML errors. I haven't done a real paste into Herdr yet.

Limit: a terminal not on that list still gets Shift+Insert.

🤖 Generated with Claude Code

Shift+Insert pastes the primary selection in Alacritty, Kitty and Ghostty,
and Herdr passes it to the pane's program as an Insert key. Read the
focused window's class and send Ctrl+Shift+V to terminals (SPEC §5.3);
other apps keep Shift+Insert.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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