Hi Joshua,

On Mon, Jan 13, 2003 at 09:32:58PM -0800, Joshua M. Kwan wrote:
> When using multiple screens it is a chore to copy down the PIDs/socket 
> names of each of the screens to resume them. For example:
> 
> $ screen -r
> There are several suitable screens on:
>         5735.pts-3.kanoe        (Detached)
>         5805.pts-3.kanoe        (Detached)
> Type "screen [-d] -r [pid.]tty.host" to resume one of them.
> 
> It's quite a pain in the butt to even copy this if in X, and then psate 
> it later. Is there any way where I can just use my arrow keys to choose 
> the screen i want to access instead of having to type in meaningless 
> numbers? (i can use -sockname but i still have to type the PID)

There are two ways:

zsh, at least with grml's zshrc, allows proper tab completion for
screen sessions:

  abe@c-crosser:~ % screen -r <Tab>
  completing detached screen process
  25983..c-crosser  26065..c-crosser

Pressing Tab several times switches between the offered completions.

The other option is the following small script which needs iselect
from the package of the same name:

  screen -rd $(screen -ls | sed -e 's/[ \t][ \t]*/ /g;' | egrep '^ [0-9]' | sed 
-e 's/^ //' | iselect -a | awk -F. '{print $1}')

HTH, even if it's about 8 years later. :-)

                Regards, Axel
-- 
 ,''`.  |  Axel Beckert <[email protected]>, http://people.debian.org/~abe/
: :' :  |  Debian Developer, ftp.ch.debian.org Admin
`. `'   |  1024D: F067 EA27 26B9 C3FC 1486  202E C09E 1D89 9593 0EDE
  `-    |  4096R: 2517 B724 C5F6 CA99 5329  6E61 2FF9 CD59 6126 16B5



-- 
To UNSUBSCRIBE, email to [email protected]
with a subject of "unsubscribe". Trouble? Contact [email protected]

Reply via email to