summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Janke <andrew@apjanke.net>2015-07-31 22:23:12 -0400
committerAndrew Janke <andrew@apjanke.net>2015-07-31 22:23:12 -0400
commit90ea67edf0982923f82905d87bda5b685089f219 (patch)
treeda06e4411b469c859cf437bd99992e3a7f337d4d
parent3d5b3430fd9da12f6e33f534e487fe9b18928ac7 (diff)
downloadzsh-90ea67edf0982923f82905d87bda5b685089f219.tar.gz
zsh-90ea67edf0982923f82905d87bda5b685089f219.tar.bz2
zsh-90ea67edf0982923f82905d87bda5b685089f219.zip
termsupport: protect title() with `emulate -L zsh`
This prevents it from malfunctioning when `setopt prompt_subst` is off.
-rw-r--r--lib/termsupport.zsh3
1 files changed, 3 insertions, 0 deletions
diff --git a/lib/termsupport.zsh b/lib/termsupport.zsh
index e1c2e2f93..973c4dcf6 100644
--- a/lib/termsupport.zsh
+++ b/lib/termsupport.zsh
@@ -7,6 +7,9 @@
# (In screen, only short_tab_title is used)
# Limited support for Apple Terminal (Terminal can't set window and tab separately)
function title {
+ emulate -L zsh
+ setopt prompt_subst
+
[[ "$EMACS" == *term* ]] && return
# if $2 is unset use $1 as default