> On Wed, May 07, 2025 at 11:26:24AM +0200, Vegard Svanberg wrote:
>B) A heartbeat script
>
>Create a new (hidden) screen window and run something like:
>
>while true ; sleep 5 ; echo "$STY" > "$HOME/.screen.lastsession"
>
>Obviously this would still run when the screen is detached, so you'd
>have to add some logic to detect that and pause the update. 
>
>You could possible add something in .screenrc to spawn this
>automatically.
>
>Personally, I think I'd patch screen and contribute the code.

Prior to Linux or developers juggling around process number IDs in an
effort for randomizing PIDs for fear of lack of security, the last or
highest numbered PID was likely the last or most recently used screen
session.

Probably can check sysfs or proc PIDs for timestamps, for the last used screen
session?

Roger

Attachment: signature.asc
Description: PGP signature

Reply via email to