Merge pull request #4203 from apjanke/title-protect-promptsubst
termsupport: protect title() with `emulate -L zsh` for portability
Diff
1diff --git a/lib/termsupport.zsh b/lib/termsupport.zsh
2index d667861ab65687736c452a2105a35c9c80e7c0cf..f4a996552e6f6ed3e51e212a0e6e5c9947874725 100644
3--- a/lib/termsupport.zsh
4+++ b/lib/termsupport.zsh
5@@ -7,6 +7,9 @@
6 # (In screen, only short_tab_title is used)
7 # Limited support for Apple Terminal (Terminal can't set window and tab separately)
8 function title {
9+ emulate -L zsh
10+ setopt prompt_subst
11+
12 [[ "$EMACS" == *term* ]] && return
1314 # if $2 is unset use $1 as default