mirror of
https://github.com/kovidgoyal/kitty
synced 2026-07-28 03:01:57 +02:00
Move extraction of last cmd into its own function
This commit is contained in:
@@ -70,7 +70,11 @@ _ksi_main() {
|
|||||||
if [[ "$HISTCONTROL" == *"ignoreboth"* ]] || [[ "$HISTCONTROL" == *"ignorespace"* ]]; then
|
if [[ "$HISTCONTROL" == *"ignoreboth"* ]] || [[ "$HISTCONTROL" == *"ignorespace"* ]]; then
|
||||||
_ksi_debug_print "ignoreboth or ignorespace present in bash HISTCONTROL setting, showing running command in window title will not be robust"
|
_ksi_debug_print "ignoreboth or ignorespace present in bash HISTCONTROL setting, showing running command in window title will not be robust"
|
||||||
fi
|
fi
|
||||||
_ksi_prompt[ps0]+='$(printf "\e]2;%s\a" "$(HISTTIMEFORMAT= history 1 | sed -e "s/^[ ]*[0-9]*[ ]*//")")'
|
_ksi_get_current_command() {
|
||||||
|
local last_cmd=$(HISTTIMEFORMAT= builtin history 1 | command sed -e "s/^[ ]*[0-9]*[ ]*//")
|
||||||
|
builtin printf "\e]2;%s\a" "$last_cmd"
|
||||||
|
}
|
||||||
|
_ksi_prompt[ps0]+='$(_ksi_get_current_command)'
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [[ "${_ksi_prompt[mark]}" == "y" ]]; then
|
if [[ "${_ksi_prompt[mark]}" == "y" ]]; then
|
||||||
|
|||||||
Reference in New Issue
Block a user