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

Re: TRAPNAL with TMOUT problem



On Aug 20, 10:58pm, Paul Lew wrote:
> Subject: TRAPNAL with TMOUT problem
> 
> The 'idle' time for command 'w' is now affected by the invocation of
> TRAPALRM function, i.e., if I defined TMOUT to be 3600, zsh will never
> show idle more than 60 minutes.

The "idle" time is nothing more than the difference between the access
time and the modification time of the tty device file for the associated
terminal.  I have a TMOUT/TRAPALRM that updates the title bar of my xterm
every 60 seconds, yet my w output still shows me as having been idle all
weekend on terminals I haven't touched yet this morning.

Probably what's happening is that the terminal is getting "accessed" when
the background job runs.  (My traps use only builtins, so no new job group
needs to become associated with the terminal.)

Try starting the background jobs with stdin/out/err all redirected and a
trailing &! token to "disown" them.  I'm not certain that wll prevent zsh
from associating the job with the terminal, but it's easy to test.



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