zsh-users
 help / color / mirror / code / Atom feed
From: Andreas Hartmann <hartan@7x.de>
To: zsh-users@zsh.org
Subject: Reverting the effect of 'setopt nomonitor' executed during shell startup
Date: Fri, 14 Jan 2022 15:07:50 +0100	[thread overview]
Message-ID: <6886b4278c2d2ce627ce3e48bd9d3034e5f66e78.camel@7x.de> (raw)

Hello,


I'm currently fighting with some zsh behavior that I can't quite explain to
myself. I use zplug along with zsh, and I believe that whenever zplug calls
'setopt nomonitor' during its setup, any subsequent call to e.g. `stty icanon`
will suspend the shell with a SIGTTOU. At least if I comment out calls to 'setopt
nomonitor' in zplugs startup, this behavior doesn't occur.

This change in shell options is so persistent in fact, that even passing "setopt
monitor" to negate the effect along in the same command doesn't change this
behavior back to the unmodified one. Using setopt I can see that this is the only
change performed to the shell, and furthermore no changes are applied to the stty
(like `stty nostop`, which has the same effect).

Here's a minimal working example (if you use zplug it works, can't reproduce it
without zplug and I don't know why...):

  #!/usr/bin/zsh
  
  /usr/bin/zsh -i -c "echo foo;"
  stty icanon
  echo "bar"

If you run this script it will become suspended upon calling `stty icanon`.
`icanon` here is just one of many options, I think pretty much any argument to
stty will work for that matter...

Is there a way to "fix" options at shell startup such that they cannot ever be
overwritten from within the shell? Or has someone else experienced this already
and knows how to mitigate it?


Thank you in advance!

Best,
hartan


             reply	other threads:[~2022-01-14 14:08 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-01-14 14:07 Andreas Hartmann [this message]
2022-01-14 14:27 ` Roman Perepelitsa
2022-01-14 17:26   ` Bart Schaefer

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=6886b4278c2d2ce627ce3e48bd9d3034e5f66e78.camel@7x.de \
    --to=hartan@7x.de \
    --cc=zsh-users@zsh.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).