Skip to content

Commit d398fec

Browse files
committed
Fix missing double-quote escaping in zsh ghostel_cmd
The bash and fish integrations escaped both \ and " in arguments, but the zsh version only escaped \. Arguments containing literal double quotes would produce malformed OSC 51 payloads.
1 parent d70a022 commit d398fec

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

etc/ghostel.zsh

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,9 +42,11 @@ preexec_functions=(__ghostel_preexec "${preexec_functions[@]}")
4242
# Usage: ghostel_cmd FUNCTION [ARGS...]
4343
# The function must be in `ghostel-eval-cmds'.
4444
ghostel_cmd() {
45-
local payload=""
45+
local payload="" arg
4646
while (( $# )); do
47-
payload="$payload\"${1//\\/\\\\}\" "
47+
arg="${1//\\/\\\\}"
48+
arg="${arg//\"/\\\"}"
49+
payload="$payload\"$arg\" "
4850
shift
4951
done
5052
printf '\e]51;E%s\e\\' "$payload"

0 commit comments

Comments
 (0)