Repository navigation
fix: type image path when pasting clipboard images into terminals - #11998
HIMANSHU11827 wants to merge 1 commit into
Conversation
Terminals only accept text, so picking an image from clipboard history while a terminal is focused silently pasted nothing. Detect terminal focus via hyprctl and type the file path instead; GUI targets keep the shift-insert image paste.
b46c339 to
0f8191e
Compare
Automated AI review
Verified: picking an image from clipboard history with Return while a stock foot, Alacritty, kitty or Ghostty window is focused classifies that terminal correctly and types the stored image's absolute path. Hyprland keeps reporting the origin window through The main suggestion is to reuse Omarchy's existing Terminal detection diverges from the
|
|
Nice idea. Before review, a couple of notes:
|
Problem
Picking an image (e.g. a screenshot) from clipboard history (
Super + Ctrl + V) while a terminal is focused silently pastes nothing:omarchy-clipboard-paste-fileputsimage/pngon the clipboard and sends Shift+Insert, but terminals only accept text.Fix
In
bin/omarchy-clipboard-paste-file, when the mime isimage/*and the Hyprland focused window is a terminal (foot/kitty/ghostty/alacritty/wezterm/konsole/tilix or any*term*class), type the file path withwtypeinstead of sending Shift+Insert. GUI targets and non-image files behave exactly as before, as does everything when focus can't be determined. No QML changes needed — the history picker calls the same command.Verification
commandcode --version-> 1.54.0,qwenaudio --help(full gateway/tui/webui tree), colibri engine built from source with gcc+OpenMP (make -C c colibri, engine +colilauncher run).test/shell.d/clipboard-test.shgreen, including 4 new cases: path typed into terminals, shift-insert preserved for GUI apps / non-images / undetectable focus../test/cligreen.manual/08-unified-clipboard-history.md.