zshrc: Fix status() when $BAUD is unset
authorAlexander Steinböck <z3ttacht@grml.org>
Fri, 30 Jan 2009 20:04:14 +0000 (21:04 +0100)
committerFrank Terbeck <ft@bewatermyfriend.org>
Sun, 8 Feb 2009 12:32:02 +0000 (13:32 +0100)
There are implementations of getty that don't export $BAUD. In these
cases there is an empty value in the output of the status() function.

This fixes it by only printing the baud-information field in case
$BAUD is set to a non-empty value.

etc/zsh/zshrc

index aa49255..edc6865 100644 (file)
@@ -3562,7 +3562,7 @@ status() {
     print ""
     print "Date..: "$(date "+%Y-%m-%d %H:%M:%S")""
     print "Shell.: Zsh $ZSH_VERSION (PID = $$, $SHLVL nests)"
-    print "Term..: $TTY ($TERM), $BAUD bauds, $COLUMNS x $LINES cars"
+    print "Term..: $TTY ($TERM), ${BAUD:+$BAUD bauds, }$COLUMNS x $LINES cars"
     print "Login.: $LOGNAME (UID = $EUID) on $HOST"
     print "System: $(cat /etc/[A-Za-z]*[_-][rv]e[lr]*)"
     print "Uptime:$(uptime)"