:: whot@salty:~> screen -ls
There are screens on:
5238.pts-3.salty (Detached)
5229.pts-3.salty (Detached)
The -S argument allows to specify a session name but I couldn't find a configuration to set this automatically. So I've added this little script:
$> cat $HOME/scripts/screen
#!/bin/bash
/usr/bin/screen $([[ ($1 != -*) && ($# > 0) ]] && echo "-S $1") "$@"
Explanation: if called with 1 or more parameters and the first parameter does not start with a dash, replace a call in the form of screen command ... with screen -S command command ...
This results in screen sessions having useful names, allowing for more effective reattaching. And the obligatory, ahem, screenshots:
:: whot@yabbi:~> screen foo [detached from 17755.foo] :: whot@yabbi:~> screen bar [detached from 17766.bar] :: whot@yabbi:~> screen -ls There are screens on: 17766.bar (Detached) 17755.foo (Detached) 2 Sockets in /var/run/screen/S-whot.
Did you write somewhere why you haven't moved to tmux yet?
ReplyDelete$ tmux new -s howdy
ctrl-b + s gives a session list by name, indispensible.
OK I admit, I actually have "set -g prefix C-a" :> yes I'm afflicted by my screen history as well
or
$ tmux attach -t howdy
Leho: merely because I wasn't really aware of tmux. Thanks for the hint, I'll have a look.
ReplyDelete