Re: last recently *used* screen?

Roger <[email protected]> Wed, 7 May 2025 13:35:33 -0400
Newsgroups gmane.comp.gnu.screen.user
Message-ID <[email protected]>
--OC1crEbbo6u+4DmL
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

> 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.=20
>
>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 scr=
een
session?

Roger


--OC1crEbbo6u+4DmL
Content-Type: application/pgp-signature; name=signature.asc

-----BEGIN PGP SIGNATURE-----

iQEzBAABCAAdFiEE9RWsHyMf/E7wvN52Bs6g7OKIfHUFAmgbmeIACgkQBs6g7OKI
fHUt5wgAkLY0lrxjDOLhjnU082ECsHqlNN3SS6O9e2GVxvWWDT21xPKOJjV/VBAK
ewULojUkIFiSiNBjEeMJirzDHap4HYNk5SgroJVvzrNY3gvyy93SKcshJpQ2NV34
9SYaExWGFtaHOjqAEoIUs+6BIFktwqsOfnJvb5hX5mQ3zbCOGURgnLIgMnZhhBCl
rpGlGJ3l5U7PVHMgL0OsZvBUZwJVOyH3Ad6kz6ud17NVYC40+HiaLwJAwUqIIB3+
76AkDN1y+MY78rz8BT2a4d5H0gmov/PsbMnYVTHr7xUutvsD1FYD0RF3RfBi7hAx
Y1d4ZTYvswAjTtOj6NF/1LfjYzyOHA==
=QQPn
-----END PGP SIGNATURE-----

--OC1crEbbo6u+4DmL--