b7e5dd35efb0750634eb16b7040337ce80f67684

Author
Marc Cornellà <marc.cornella@live.com>
Committer
Marc Cornellà <marc.cornella@live.com>
Date

Message

Quick-fix code style

Diff

 1diff --git a/lib/termsupport.zsh b/lib/termsupport.zsh
 2index 2fa61c431d0df62a24a50d7e0335a8419d1e363a..f21b0b0419ac5298f50ed323a788dc11377831d5 100644
 3--- a/lib/termsupport.zsh
 4+++ b/lib/termsupport.zsh
 5@@ -7,12 +7,12 @@
 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-  if [[ $2 == "" ]]; then
10-    2="$1"
11-  fi
12-  if [[ "$EMACS" == *term* ]]; then
13-    return
14-  fi
15+  [[ "$EMACS" == *term* ]] && return
16+
17+  # if $2 is unset use $1 as default
18+  # if it is set and empty, leave it as is
19+  : ${2=$1}
20+
21   if [[ "$TERM" == screen* ]]; then
22     print -Pn "\ek$1:q\e\\" #set screen hardstatus, usually truncated at 20 chars
23   elif [[ "$TERM" == xterm* ]] || [[ $TERM == rxvt* ]] || [[ $TERM == ansi ]] || [[ "$TERM_PROGRAM" == "iTerm.app" ]]; then