Dont bother with new escape code for setting title

Since we are only sending the last command, it cannot have CSI
sequences in it anyway except in extremely contrived situations, so just
strip all ctrl chars out.
This commit is contained in:
Kovid Goyal
2022-02-27 10:55:02 +05:30
parent 33abd31d1a
commit ef5c66ee17
4 changed files with 1 additions and 13 deletions

View File

@@ -139,8 +139,7 @@ _ksi_main() {
last_cmd=$(HISTTIMEFORMAT= builtin history 1)
last_cmd="${last_cmd#*[[:digit:]]*[[:space:]]}" # remove leading history number
last_cmd="${last_cmd#"${last_cmd%%[![:space:]]*}"}" # remove remaining leading whitespace
last_cmd=$(builtin printf "%s" "$last_cmd" | base64)
builtin printf "\e]22222;%s\a" "${last_cmd//[[:space:]]}"
builtin printf "\e]2;%s\a" "${last_cmd//[[:cntrl:]]}" # remove any control characters
}
_ksi_prompt[ps0_suffix]+='$(_ksi_get_current_command)'
fi