Sample Header Ad - 728x90

Idle time (tty st_atime) not updating when emacs is running

1 vote
0 answers
17 views
When running GNU emacs in a terminal (in the old-fashioned way, that is, i.e. *not* in its X windows mode) I've noticed that the w command shows the session as idle, even though emacs is active and accepting input. I know that w displays idle time based on st_atime on the login tty, which generally updates when the user types something and a program reads it. But for some reason st_atime isn't updating when emacs reads input. I wonder if that's due to emacs putting the tty in raw mode, or something? Does anyone know? And is there any way around this? (I doubt it, but I have to ask.). I'm trying to do some idle-time-based auto shutdown, but I spend most of my time in emacs, and while I do plenty of things at the command line also, I could easily get false idle detections if my emacs time doesn't count. Debian 10 and emacs 26.1, if it matters. I'm sure there are "better" (more sophisticated, more complicated) ways of detecting idle time, and I suppose I'll have to pursue those. ---- Update: I tried the same thing on a different system, running Ubuntu 22.04, and did *not* see this behavior: activity in emacs does update st_atime on the tty, and so does reset idle time. (Also as it happens, the Ubuntu system is the one where I'm more interested in accurately detecting idle time, so my question is now practically moot, although I'd still be curious to know what's going on.)
Asked by Steve Summit (918 rep)
Apr 25, 2025, 03:18 PM
Last activity: Apr 25, 2025, 03:59 PM