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

Re: reset tty modes on TMOUT



On Mon, Jul 27, 2026 at 6:07 AM Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx> wrote:
>
> On Sat, Jul 25, 2026 at 11:22 AM J.R. Oldroyd <fbsd@xxxxxxxx> wrote:
> >
> > On Fri, 24 Jul 2026 19:36:35 -0700 Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx> wrote:
> > >
> > > On Fri, Jul 24, 2026 at 10:26 AM J.R. Oldroyd <fbsd@xxxxxxxx> wrote:
> > > >
> > > > +               if (zleactive)
> > > > +                   settyinfo(&shttyinfo);
> > > >                 stopmsg = 1;
> > > >                 zexit(SIGALRM, ZEXIT_SIGNAL);
> > >
> > > Shouldn't this happen inside zexit() for any ZEXIT_SIGNAL ?
>
> That question was more aimed at zsh-workers in general.
>
> In fact I wonder whether zexit() ought to reset the tty when zleactive
> no matter what caused the exit.
>
> > If you wish to send any alternate patches, I am happy to try and post
> > back if they work or not.
>
> The patch is easy ... but a new question is why the shell is exiting
> at all.  I didn't think about this at first, but the ALRM signal isn't
> supposed to be fatal.

The default action is to exit,
              If  no  trap  is  set, and the idle time of the terminal
is not less than the
              value of the TMOUT parameter, zsh  terminates.

Perhaps it is a bit unexpected that it also exits when sent an ALRM
signal when TMOUT is unset or 0 though. I suppose any non-zero idle
time is 'not less than' 0 by definition, but still.

-- 
Mikael Magnusson




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