Do the same for bash and also sanitize control chars in zsh

This commit is contained in:
Kovid Goyal
2025-08-19 09:23:48 +05:30
parent 54ad4fc63b
commit b38b38d17d
2 changed files with 5 additions and 2 deletions

View File

@@ -353,7 +353,10 @@ _ksi_main() {
fi
fi
builtin unset KITTY_IS_CLONE_LAUNCH KITTY_CLONE_SOURCE_STRATEGIES
if [[ -n "$krcs" ]]; then builtin eval "$krcs"; fi
if [[ -n "$krcs" ]]; then builtin
builtin printf "\e]2;%s\a" "${krcs//[[:cntrl:]]}" # removes any control characters
eval "$krcs";
fi
}
_ksi_main
builtin unset -f _ksi_main

View File

@@ -352,7 +352,7 @@ _ksi_deferred_init() {
# run startup command
if [[ -n "$krcs" ]]; then
builtin print -nu "$_ksi_fd" -f '\e]2;%s\e\\' "$krcs"
builtin print -nu "$_ksi_fd" -f '\e]2;%s\e\\' -- "${(V)krcs}"
builtin eval "$krcs"
fi