Never open Vim for text clipboard entries

This commit is contained in:
2026-09-05 23:55:27 +01:00
parent 6b0a2ac494
commit ac3b5ef4dc
2 changed files with 4 additions and 9 deletions
+3 -8
View File
@@ -30,14 +30,9 @@ open_text() {
exec omarchy-launch-browser "$url"
fi
fi
local dir file
dir="${XDG_STATE_HOME:-$HOME/.local/state}/omarchy/clipboard-open"
mkdir -p "$dir"
# Prune temp copies older than a week; nothing else reclaims them.
find "$dir" -type f -name 'clipboard.*.txt' -mtime +7 -delete 2>/dev/null || true
file=$(mktemp --tmpdir="$dir" clipboard.XXXXXX.txt)
printf '%s' "$text" >"$file"
exec omarchy-launch-editor "$file"
# Text entries are clipboard data, not editor documents. Return pastes them;
# Ctrl+O/Alt+Enter must not unexpectedly open Vim for shell commands or prose.
exit 0
}
case $(jq -r '.type' <<<"$entry") in