[Bash-completion-devel] [bash-completion-Bugs][311540] add completion for 'screen'

bash-completion-bugs at alioth.debian.org bash-completion-bugs at alioth.debian.org
Tue Feb 15 10:51:39 UTC 2011


Bugs item #311540, was changed at 2009-03-13 12:08 by Johannes Zarl
You can respond by visiting: 
https://alioth.debian.org/tracker/?func=detail&atid=413095&aid=311540&group_id=100114

Status: Open
Priority: 3
Submitted By: Simone Fittabile (greeno-guest)
Assigned to: Nobody (None)
Summary: add completion for 'screen' 
Distribution: Debian
Originally reported in: None
Milestone: None
Status: None
Original bug number: 


Initial Comment:
I would like to know if existsted any trick for the GNU screen program.

I do not know any: it would be nice to complete screen command line with both a list of names of the started screens and their full identifier (eg. 23442.abcde)

The list afaik is gotten through '/bin/screen -l'

The completion would result in 'screen 23442.abcde' in case user writes 'screen abc[TAB]' or 'screen 234[TAB]'

It be useful to integrate it, would not it?


----------------------------------------------------------------------

Comment By: Johannes Zarl (isilmendil-guest)
Date: 2011-02-15 11:51

Message:
AFAIK a more simple approach to whis would be to tweak the sed-expression in _screen_sessions() a bit:

have screen &&
_screen_sessions()
{
    COMPREPLY=( $( compgen -W "$( command screen -ls | sed -ne \
        's|^\t\{1,\}\([0-9]\{1,\}\.\)\([^\t]\{1,\}\).*'"$1"'.*$|\1\2\n\2|p' )" \
        -- "$cur" ) )
} 

Instead of:
12345.pts-1.somehost
This writes:
12345.pts-1.somehost
pts-1.somehost

(And is a much smaller change)

Cheers,
  Johannes

----------------------------------------------------------------------

Comment By: Simone Fittabile (greeno-guest)
Date: 2009-03-16 17:47

Message:
I was wrong, it existed the function to reattach / detach existing screens. The available list is from screen -ls.

It currently does not complete the second part of the screen name, eg: for 23442.abcde , only matches for completion the first part of the screen name, i.e. 23442. If even typing abc[TAB] would complete with 23442.abcde

I made a patch for this. With it it is possible to only remember begin of the screen name, the completion will take care of the rest.
Also fixed with the patch, not completing the possible screen name when -r or -R s not the latest option passed.

----------------------------------------------------------------------

You can respond by visiting: 
https://alioth.debian.org/tracker/?func=detail&atid=413095&aid=311540&group_id=100114



More information about the Bash-completion-devel mailing list