From dd76c7123bc0aff17f01983edf98f26a837bcead Mon Sep 17 00:00:00 2001 From: Martin Sekera Date: Mon, 31 Jan 2022 11:14:17 +0100 Subject: [PATCH] prompt: improve tmux compatibility --- lib/prompt-init | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/lib/prompt-init b/lib/prompt-init index e878e74..8c939f4 100755 --- a/lib/prompt-init +++ b/lib/prompt-init @@ -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}"