Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: reset tty modes on TMOUT
- X-seq: zsh-workers 55043
- From: Mikael Magnusson <mikachu@xxxxxxxxx>
- To: Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx>
- Cc: "J.R. Oldroyd" <fbsd@xxxxxxxx>, zsh-workers@xxxxxxx
- Subject: Re: reset tty modes on TMOUT
- Date: Mon, 27 Jul 2026 08:42:25 +0200
- Arc-authentication-results: i=1; mx.google.com; arc=none
- Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20260327; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=+jmwvrR8WACuAYF1kQ1LieiIuWqXw+PSehKhBacdaI4=; fh=S8v/5Bxy1ukPXtWtUTh5qR+VarxB8HzbwaU9JL4Cc/o=; b=Z7aAlxbQlpe6DGitKAVS5pxT5AjDBoINOPum4KLInCb31EUsxUSuwcElIrSR3o81un 5j1xyMaYueELiuwy/asawF93SVysFoVZqlLzxDF9CrOCmvtYSmkhpg5nImXmttLJiUkw tVJNTt56O1EMi0CHF+EPaK3nJhU2IdevkgaPPtgXH/llPa1bDNIoitrDH9kNe3KXfoye kVXUTv8+AphydXhd0VMtrGjJkpLfbNW9HzBftI2Z7dcpHg239RridjOoYtnSg3zip3Mm EAdKyROZWZ0a+doE4miJg8/a9pABk4eXNB5EEvH4p1pnPCkVvGjYVSOrRYyfHrRgCcGq JgEQ==; darn=zsh.org
- Arc-seal: i=1; a=rsa-sha256; t=1785134558; cv=none; d=google.com; s=arc-20260327; b=JRR31jfWZUa46Xn37kg47TibwxECJ0vMa6eSkm5pia8/FwIfrBNkZJ/c1ttAUgVaJn 53j00k726uwWPF7Pbm4NP0TjnjwTu7kYcovxbLlgxl5QspvA3G0twmPvVyNXbiTpU6Ht nRLK+jMRSVcUxFm0rHnPSGLnCxDaO7Jn7yH149qUHj0UFDxIfuMX3AXB5q/aj4cSegX2 idyFTr9Ema1OmL8mJBjO5Na1kVRIqoOxFJxhJAHbguKBOljqDKxTCRKFNqWwp2PYI5oO Js4u/SOI6Ogg5/+HsEVpZaR67me+VkcfCObvXjBx6vGDsREzNG7pxB1HSH+xAtCq5u7T Vi6A==
- Archived-at: <https://zsh.org/workers/55043>
- In-reply-to: <CAH+w=7bw175m+3zP-vh-152anB_ZagfLiTPFgZpxS3N3GwtNQQ@mail.gmail.com>
- List-id: <zsh-workers.zsh.org>
- References: <20260724132556.6c1f059d@opal.com> <CAH+w=7YNnsxGEbJp08c3ruiJsv=0deRNZRGgQnKRF-kSL_hOeQ@mail.gmail.com> <20260725142244.34f9f52d@opal.com> <CAH+w=7bw175m+3zP-vh-152anB_ZagfLiTPFgZpxS3N3GwtNQQ@mail.gmail.com>
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