summaryrefslogtreecommitdiff
path: root/lib/termsupport.zsh
diff options
context:
space:
mode:
authorMarc Cornellà <marc.cornella@live.com>2015-02-10 19:43:25 +0100
committerMarc Cornellà <marc.cornella@live.com>2015-02-10 19:52:58 +0100
commitb7e5dd35efb0750634eb16b7040337ce80f67684 (patch)
tree9ff155476ffc7b761669238ec3cc5fd929f0857e /lib/termsupport.zsh
parent4fc6dccb4286828c7cd53d3612ec69b0c0d9aaf2 (diff)
downloadzsh-b7e5dd35efb0750634eb16b7040337ce80f67684.tar.gz
zsh-b7e5dd35efb0750634eb16b7040337ce80f67684.tar.bz2
zsh-b7e5dd35efb0750634eb16b7040337ce80f67684.zip
Quick-fix code style
Diffstat (limited to 'lib/termsupport.zsh')
-rw-r--r--lib/termsupport.zsh12
1 files changed, 6 insertions, 6 deletions
diff --git a/lib/termsupport.zsh b/lib/termsupport.zsh
index 2fa61c431..f21b0b041 100644
--- a/lib/termsupport.zsh
+++ b/lib/termsupport.zsh
@@ -7,12 +7,12 @@
# (In screen, only short_tab_title is used)
# Limited support for Apple Terminal (Terminal can't set window and tab separately)
function title {
- if [[ $2 == "" ]]; then
- 2="$1"
- fi
- if [[ "$EMACS" == *term* ]]; then
- return
- fi
+ [[ "$EMACS" == *term* ]] && return
+
+ # if $2 is unset use $1 as default
+ # if it is set and empty, leave it as is
+ : ${2=$1}
+
if [[ "$TERM" == screen* ]]; then
print -Pn "\ek$1:q\e\\" #set screen hardstatus, usually truncated at 20 chars
elif [[ "$TERM" == xterm* ]] || [[ $TERM == rxvt* ]] || [[ $TERM == ansi ]] || [[ "$TERM_PROGRAM" == "iTerm.app" ]]; then