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

Re: showing 'talk' status in PROMPT



} 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