From f25edf653f7a7c5344e8dad0bc5ce81a7967b8be Mon Sep 17 00:00:00 2001 From: cono Date: Tue, 2 Jan 2018 03:36:16 +0200 Subject: [PATCH] screen.plugin: Respect DISABLE_AUTO_TITLE variable as in core OMZ --- plugins/screen/screen.plugin.zsh | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/plugins/screen/screen.plugin.zsh b/plugins/screen/screen.plugin.zsh index 7009e7a91..4d8f5a652 100644 --- a/plugins/screen/screen.plugin.zsh +++ b/plugins/screen/screen.plugin.zsh @@ -30,11 +30,14 @@ if [[ "$TERM" == screen* ]]; then # tell GNU screen what the tab window title ($1) and the hardstatus($2) should be function screen_set() { - # set the tab window title (%t) for screen - print -nR $'\033k'$1$'\033'\\\ - # set hardstatus of tab window (%h) for screen print -nR $'\033]0;'$2$'\a' + + if [[ "$DISABLE_AUTO_TITLE" == true ]]; then + return + fi + # set the tab window title (%t) for screen + print -nR $'\033k'$1$'\033'\\\ } # called by zsh before executing a command function preexec() @@ -51,4 +54,4 @@ if [[ "$TERM" == screen* ]]; then eval "tab_hardstatus=$TAB_HARDSTATUS_PREFIX:$TAB_HARDSTATUS_PROMPT" screen_set $tab_title $tab_hardstatus } -fi \ No newline at end of file +fi