On 2020-05-07 10:28:38 +0200, Christopher Zimmermann wrote:
> On Thu, May 07, 2020 at 09:52:14AM +1000, Cameron Simpson wrote:
> > > uses cbreak and therefore the terminal will still catch and
> > > interpret \Cc (SIGINT), \034 (SIGQUIT), \Cy (SIGSTOP on next read),
> > > \Cz (SIGSTOP).
> > 
> > That is desirable, so that mutt can act like any other well behaved
> > terminal programme.
> 
> I do consider vi and emacs well behaved terminal programs.

I don't know about vi, but emacs is rather special due to its internal
use of SIGINT, which is actually triggered by Ctrl-G instead of Ctrl-C.
Moreover, it can itself act as a terminal (even when started as an
editor).

> On Thu, May 07, 2020 at 03:57:37AM +0200, Vincent Lefevre wrote:
> 
> > On my Mutt pages https://www.vinc17.net/mutt/index.en.html
> > I mention a little script apptty which I have used with Mutt
> > in GNU screen for more than 12 years, with in particular:
> > 
> >  stty susp undef
> >  stty dsusp undef 2> /dev/null
> > 
> > Like susp (^Z by default) and dsusp (^Y when it exists), you
> > can normally disable whatever you wish. "stty -a" gives the
> > current mappings.
> 
> I learned about stty only a few days ago and thats what triggered me to
> prepare the merge request.
> Maybe this information should be put into the mutt manual?

Perhaps. BTW, Mutt can itself disable susp:

3.373. suspend

   Type: boolean
   Default: yes

   When unset, mutt won't stop when the user presses the terminal's susp
   key, usually "^Z". This is useful if you run mutt inside an xterm
   using a command like "xterm -e mutt".

I'm wondering whether this option should be removed since this can be
done with stty, taking the context into account, e.g. whether the user
has run mutt directly in xterm or from a shell (which is not possible
with this option).

Note that concerning ^Y, the request to disable dsusp under MacOS X
(it seems that it does not exist under Linux) was already requested
in the old BTS, ticket 3780, in 2015. The conclusion was not to bloat
Mutt.

On this subject, one could say the same thing about ^Q and ^S, but
perhaps you don't use these ones or your terminal is configured
without XON/XOFF flow control (or you disabled it with "stty -ixon").
I suppose that most users could complain that they are unusable with
Mutt. However, they might still be useful under some occasion, and
disabling them unconditionally would not be acceptable.

> > That's bad because it doesn't honor the way the user has configured
> > his terminal. Moreover, I fear that in case of crash, this may leave
> > the terminal settings in the altered state (zsh offers protection,
> > though).

That said, concerning the crash, I could just test that with mutt run
from sh, a "kill -9" leaves my xterm terminal in a completely unusable
state, even after a full reset. No issue from zsh, though.

> You convinced me with sufficient reasons that mutt should stay in cbreak
> mode and therefore I will drop the merge request. But still I believe a
> pointer to stty should be put into the manual. It took me several days to
> understand why mutt did not manage to use CTRL-Y while vim did.

Since stty can do a lot of things that would be no interest for
Mutt, perhaps mentioning specifically dsusp (when it exists),
susp, and [-]ixon. And the behavior of SIGINT (intr) and SIGQUIT
(quit) should be documented.

-- 
Vincent Lefèvre <vinc...@vinc17.net> - Web: <https://www.vinc17.net/>
100% accessible validated (X)HTML - Blog: <https://www.vinc17.net/blog/>
Work: CR INRIA - computer arithmetic / AriC project (LIP, ENS-Lyon)

Reply via email to