mirror of
https://github.com/kovidgoyal/kitty
synced 2026-07-20 15:35:03 +02:00
Fix typo in bash integration script caught by the test
This commit is contained in:
@@ -464,4 +464,7 @@ kitty also optionally supports sending the cmdline going to be executed with ``<
|
|||||||
|
|
||||||
|
|
||||||
Here, *encoded by %q* means the encoding produced by the %q format to printf in
|
Here, *encoded by %q* means the encoding produced by the %q format to printf in
|
||||||
bash and similar shells.
|
bash and similar shells. Which is basically shell escaping with the addition of
|
||||||
|
using `ANSI C quoting
|
||||||
|
<https://www.gnu.org/software/bash/manual/html_node/ANSI_002dC-Quoting.html#ANSI_002dC-Quoting>`__
|
||||||
|
for control characters (``$''`` quoting).
|
||||||
|
|||||||
@@ -195,19 +195,21 @@ _ksi_main() {
|
|||||||
_ksi_prompt[ps0_suffix]+="\[\e[0 q\]" # blinking default cursor
|
_ksi_prompt[ps0_suffix]+="\[\e[0 q\]" # blinking default cursor
|
||||||
fi
|
fi
|
||||||
|
|
||||||
_ksi_get_current_command() {
|
if [[ "${_ksi_prompt[title]}" == "y" || "${_ksi_prompt[mark]}" ]]; then
|
||||||
builtin local last_cmd
|
_ksi_get_current_command() {
|
||||||
last_cmd=$(HISTTIMEFORMAT= builtin history 1)
|
builtin local last_cmd
|
||||||
last_cmd="${last_cmd#*[[:digit:]]*[[:space:]]}" # remove leading history number
|
last_cmd=$(HISTTIMEFORMAT= builtin history 1)
|
||||||
last_cmd="${last_cmd#"${last_cmd%%[![:space:]]*}"}" # remove remaining leading whitespace
|
last_cmd="${last_cmd#*[[:digit:]]*[[:space:]]}" # remove leading history number
|
||||||
if [[ "${_ksi_prompt[title]}" == "y" ]]; then
|
last_cmd="${last_cmd#"${last_cmd%%[![:space:]]*}"}" # remove remaining leading whitespace
|
||||||
builtin printf "\e]2;%s%s\a" "${_ksi_prompt[hostname_prefix]@P}" "${_ksi_prompt[last_cmd]//[[:cntrl:]]}" # remove any control characters
|
if [[ "${_ksi_prompt[title]}" == "y" ]]; then
|
||||||
fi
|
builtin printf "\e]2;%s%s\a" "${_ksi_prompt[hostname_prefix]@P}" "${last_cmd//[[:cntrl:]]}" # removes any control characters
|
||||||
if [[ "${_ksi_prompt[mark]}" == "y" ]]; then
|
fi
|
||||||
builtin printf "\e]133;C;cmdline=%q\a" "$last_cmd"
|
if [[ "${_ksi_prompt[mark]}" == "y" ]]; then
|
||||||
fi
|
builtin printf "\e]133;C;cmdline=%q\a" "$last_cmd"
|
||||||
}
|
fi
|
||||||
if [[ "${_ksi_prompt[title]}" == "y" || "${_ksi_prompt[mark]}" ]]; then _ksi_prompt[ps0]+='$(_ksi_get_current_command)'; fi
|
}
|
||||||
|
_ksi_prompt[ps0]+='$(_ksi_get_current_command > /dev/tty)';
|
||||||
|
fi
|
||||||
|
|
||||||
if [[ "${_ksi_prompt[title]}" == "y" ]]; then
|
if [[ "${_ksi_prompt[title]}" == "y" ]]; then
|
||||||
if [[ -z "$KITTY_PID" ]]; then
|
if [[ -z "$KITTY_PID" ]]; then
|
||||||
|
|||||||
Reference in New Issue
Block a user