Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: showing 'talk' status in PROMPT
- X-seq: zsh-users 1106
- From: "Bart Schaefer" <schaefer@xxxxxxxxxxxxxxxx>
- To: zsh-users@xxxxxxxxxxxxxxx (Zsh users list)
- Subject: Re: showing 'talk' status in PROMPT
- Date: Mon, 27 Oct 1997 09:21:38 -0800
- In-reply-to: <199710270852.JAA07593@xxxxxxxxxxxx>
- References: <199710270852.JAA07593@xxxxxxxxxxxx>
} Subject: Re: showing 'talk' status in PROMPT
}
} Timothy J Luoma wrote:
}
} > I am using this to let me know if I have turned off messages on my terminal:
Peter Stephenson wrote:
}
} I haven't tried this out, but you have problems if you just run mesg
} with no arguments and it was already turned off. You should test
} for '') and if so just run /usr/bin/mesg without setting $TALK.
How about this:
mesg () {
command mesg $*
setopt localoptions nullglob
local tty
tty=( ${~TTY:s/dev/de[v]/}(I) )
case $tty in
$TTY)
TALK=
;;
'')
TALK="<notalk> "
;;
esac
}
Question: Is there any easier way to get the (I) glob qualifier applied
to the value of $TTY ? I had to invent that de[v] trick just to force
there to be a pattern somewhere in the string.
--
Bart Schaefer Brass Lantern Enterprises
http://www.well.com/user/barts http://www.brasslantern.com
Messages sorted by:
Reverse Date,
Date,
Thread,
Author