zsh-users
 help / color / mirror / code / Atom feed
* Best place to put `mesg n` into?
@ 1999-06-22  7:21 Roland Jesse
  1999-06-22  7:53 ` Bart Schaefer
  1999-06-22 18:08 ` Stefan Monnier
  0 siblings, 2 replies; 6+ messages in thread
From: Roland Jesse @ 1999-06-22  7:21 UTC (permalink / raw)
  To: zsh-users

Hi,

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 &`. This makes sense as the
manpage states

     Then,  if  the  shell is interactive, commands are read from
     /etc/zshrc and then $ZDOTDIR/.zshrc.

and this xterm is not interactive. But as `mesg` has nothing to do with
the shell's environment, I avoided to put it into ~/.zshenv. Am I wrong
here and should I put it into .zshenv to affect _all_ possibly opended
terminals?

Ideas are welcome.

	Roland


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Best place to put `mesg n` into?
  1999-06-22  7:21 Best place to put `mesg n` into? Roland Jesse
@ 1999-06-22  7:53 ` Bart Schaefer
  1999-06-22  7:59   ` Roland Jesse
  1999-06-22 18:08 ` Stefan Monnier
  1 sibling, 1 reply; 6+ messages in thread
From: Bart Schaefer @ 1999-06-22  7:53 UTC (permalink / raw)
  To: Roland Jesse, zsh-users

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


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Best place to put `mesg n` into?
  1999-06-22  7:53 ` Bart Schaefer
@ 1999-06-22  7:59   ` Roland Jesse
  0 siblings, 0 replies; 6+ messages in thread
From: Roland Jesse @ 1999-06-22  7:59 UTC (permalink / raw)
  To: zsh-users

Bart Schaefer wrote:

> If you put "mesg" in .zshenv, you'll have to protect it with something
> like
> 
> 	[[ -t 0 ]] && mesg n

Which is exactly what I wanted to avoid.

> A better solution is
> 
> 	xterm -ut -e wnewmail &

Man, you are just it. Thanks a lot.

	Roland


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Best place to put `mesg n` into?
  1999-06-22  7:21 Best place to put `mesg n` into? Roland Jesse
  1999-06-22  7:53 ` Bart Schaefer
@ 1999-06-22 18:08 ` Stefan Monnier
  1999-06-22 21:55   ` Roland Jesse
  1 sibling, 1 reply; 6+ messages in thread
From: Stefan Monnier @ 1999-06-22 18:08 UTC (permalink / raw)
  To: zsh-users

>>>>> "Roland" == Roland Jesse <jesse@mail.CS.Uni-Magdeburg.De> writes:
> xterms opened in a way like `xterm -e wnewmail &`. This makes sense as the

I might be hopelessly confused, but I seemed to remember that

	xterm -e foo bar

does *not* use any shell whatsoever.  If you want a shell to be involved,
You'll have to call it explicitly:

	xterm -e zsh -c 'blobla'

And then indeed, this zsh will not be interactive, etc...


	Stefan


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Best place to put `mesg n` into?
  1999-06-22 18:08 ` Stefan Monnier
@ 1999-06-22 21:55   ` Roland Jesse
  1999-06-22 22:29     ` Thomas Koehler
  0 siblings, 1 reply; 6+ messages in thread
From: Roland Jesse @ 1999-06-22 21:55 UTC (permalink / raw)
  To: zsh-users

Stefan Monnier writes:

 > I might be hopelessly confused, but I seemed to remember that
 > 
 > 	xterm -e foo bar
 > 
 > does *not* use any shell whatsoever.

That's hard to believe. But Bart's sollution (using xterm -ut) works
great. 

Thank you much anyway. Your help is very much appreciated.

	Roland


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Best place to put `mesg n` into?
  1999-06-22 21:55   ` Roland Jesse
@ 1999-06-22 22:29     ` Thomas Koehler
  0 siblings, 0 replies; 6+ messages in thread
From: Thomas Koehler @ 1999-06-22 22:29 UTC (permalink / raw)
  To: Roland Jesse; +Cc: zsh-users

On Tue, Jun 22, 1999 at 11:55:33PM +0200, Roland Jesse wrote:
> 
> Stefan Monnier writes:
> 
>  > I might be hopelessly confused, but I seemed to remember that
>  > 
>  > 	xterm -e foo bar
>  > 
>  > does *not* use any shell whatsoever.
> 
> That's hard to believe.

~> xterm -e slrn &
~> pstree

[...]
     |-xterm---zsh-+-mozilla---mozilla
     |             |-pstree
     |             `-xterm---slrn
                     ^^^^^   ^^^^
                     No shell here
Still unbelievable? :-)

> But Bart's sollution (using xterm -ut) works great. 

good :-)

> Thank you much anyway. Your help is very much appreciated.

Another (more complicated) solution would use zsh :-)
xterm -e zsh -c "mesg n ; your_command"
Of course, this adds an extra zsh to the process table...

> 	Roland

CU,
Thomas

-- 
    Thomas Köhler    Email:     jean-luc@picard.franken.de
        <><           WWW:    http://home.pages.de/~jeanluc/
                      IRC:               jeanluc
      LCARS --- Linux for Computers on All Real Starships


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~1999-06-22 22:31 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1999-06-22  7:21 Best place to put `mesg n` into? Roland Jesse
1999-06-22  7:53 ` Bart Schaefer
1999-06-22  7:59   ` Roland Jesse
1999-06-22 18:08 ` Stefan Monnier
1999-06-22 21:55   ` Roland Jesse
1999-06-22 22:29     ` Thomas Koehler

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).