prompt: improve tmux compatibility

This commit is contained in:
Martin Sekera 2022-01-31 11:14:17 +01:00
parent c27a3e47f3
commit dd76c7123b

View file

@ -8,11 +8,14 @@ if [[ -a "$OVER_PROMPT_CFG" ]]; then
source "$OVER_PROMPT_CFG"
fi
function __over_prompt_set_title {
if [[ ${TERM} =~ "screen" ]]; then
print -Pn "\033k\033${@}\033\134"
fi
}
# emits garbage on tmux, where it's not really needed anyway
if [[ ! -n "$TMUX" ]]; then
function __over_prompt_set_title {
if [[ ${TERM} =~ "screen" ]]; then
print -Pn "\033k\033${@}\033\134"
fi
}
fi
function __over_prompt_preexec {
__over_prompt_set_title "${USER}: ${PWD} -> ${1}"