Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: showing 'talk' status in PROMPT



	Author:        Peter Stephenson <pws@xxxxxx>
	Original-Date: Mon, 27 Oct 1997 09:52:33 +0100
	Message-ID:    <199710270852.JAA07593@xxxxxxxxxxxx>

> 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.

Ah yes!  Believe it or not I had ``tested'' whether 'mesg' by itself would  
work, but I had only tested it when I had messages ON!  So I never noticed  
this.

Thanks for the pointer.  The new function is as follows:

mesg () {

        case $1 in
                n*|off)
                        TALK="<notalk> "
                        /usr/bin/mesg n
                ;;

                '')
                        /usr/bin/mesg
                ;;

                *)
                        TALK=""
                        /usr/bin/mesg $*
                ;;

        esac
}

	TjL
	



Messages sorted by: Reverse Date, Date, Thread, Author