Simplify _screen_sessions(), use compgen -W, fixes partial completion.
This commit is contained in:
parent
d68b471905
commit
b7937bf2f0
@ -3,16 +3,9 @@
|
||||
have screen &&
|
||||
_screen_sessions()
|
||||
{
|
||||
local pattern
|
||||
|
||||
if [ -n "$1" ]; then
|
||||
pattern=".*$1.*"
|
||||
else
|
||||
pattern=".*"
|
||||
fi
|
||||
|
||||
COMPREPLY=( $( command screen -ls | sed -ne \
|
||||
's|^['$'\t'']\{1,\}\('"$cur"'[0-9]\{1,\}\.[^'$'\t'']\{1,\}\)'"$pattern"'$|\1|p' ) )
|
||||
COMPREPLY=( $( compgen -W "$( command screen -ls | sed -ne \
|
||||
's|^\t\{1,\}\([0-9]\{1,\}\.[^\t]\{1,\}\).*'"$1"'.*$|\1|p' )" \
|
||||
-- "$cur" ) )
|
||||
} &&
|
||||
_screen()
|
||||
{
|
||||
|
Loading…
x
Reference in New Issue
Block a user