[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: last recently *used* screen?
From: |
Vegard Svanberg |
Subject: |
Re: last recently *used* screen? |
Date: |
Wed, 7 May 2025 11:26:24 +0200 |
* Thorsten Glaser <tg@debian.org> [2025-05-05 23:08]:
> how can I find out the last recently used screen, to help a friend…
I don't think screen has the tmux equivalent of hooks...
I haven't thought this through, but two alternatives spring to mind:
A) Add this feature to screen
Shouldn't be too hard I think... just something which writes the session
name to a (configurable) file somewhere upon creating, attaching and
detaching.
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.
Warmly,
Vegard
--
Vegard Svanberg <vegard@svanberg.no> [*Takapa@IRC (EFnet)]