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

Re: Best place to put `mesg n` into?



On Jun 22,  9:21am, Roland Jesse wrote:
} Subject: Best place to put `mesg n` into?
} 
} I have `mesg n` in my ~/.zshrc file to avoid getting all these `talk`
} messages. This works fine for the interactive shell. It does not for
} xterms opened in a way like `xterm -e wnewmail &`.  [...] Am I wrong
} here and should I put it into .zshenv to affect _all_ possibly opended
} terminals?

If you put "mesg" in .zshenv, you'll have to protect it with something
like

	[[ -t 0 ]] && mesg n

so that you don't get "stdin: is not a tty" or similar errors for shells
that have no associated terminal.

A better solution is

	xterm -ut -e wnewmail &

The -ut means that xterm should not write an /etc/utmp (or equivalent)
entry.  `talk' et al. won't be able to find the terminal to ask for a
connection if there's no utmp entry.

-- 
Bart Schaefer                                 Brass Lantern Enterprises
http://www.well.com/user/barts              http://www.brasslantern.com



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