diff --git a/CHANGES b/CHANGES index dcbe1678..d720a456 100644 --- a/CHANGES +++ b/CHANGES @@ -2,8 +2,8 @@ bash-completion (2.x) [ Ville Skyttä ] * Add pxz and reptyr completions. - * Improve aspell, gendiff, rsync, smartctl, tar, xz, xzdec, and generic long - option completions. + * Improve aspell, gendiff, rsync, screen, smartctl, tar, xz, xzdec, and + generic long option completions. * Try harder to find the correct perl executable to run the perl helper with. * Drop rpm query support for rpm < 4.1. * Split rpm and rpmbuild completions and improve them both. diff --git a/bash_completion b/bash_completion index 44e8ed60..fe01ac2a 100644 --- a/bash_completion +++ b/bash_completion @@ -1227,6 +1227,16 @@ _dvd_devices() COMPREPLY+=( $( compgen -f -d -X "!*/?(r)dvd*" -- "${cur:-/dev/}" ) ) } +# TERM environment variable values +_terms() +{ + COMPREPLY+=( $( compgen -W \ + "$( sed -ne 's/^\([^[:space:]#|]\{2,\}\)|.*/\1/p' /etc/termcap \ + 2>/dev/null )" -- "$cur" ) ) + COMPREPLY+=( $( compgen -W "$( { toe -a 2>/dev/null || toe 2>/dev/null; } \ + | awk '{ print $1 }' | sort -u )" -- "$cur" ) ) +} + # a little help for FreeBSD ports users [ $UNAME = FreeBSD ] && complete -W 'index search fetch fetch-list extract \ patch configure build install reinstall deinstall clean clean-depends \ diff --git a/completions/screen b/completions/screen index e2d99bd4..7c405c33 100644 --- a/completions/screen +++ b/completions/screen @@ -46,11 +46,15 @@ _screen() _filedir return 0 ;; + -T) + _terms + return 0 + ;; esac if [[ "$cur" == -* ]]; then COMPREPLY=( $( compgen -W '-a -A -c -d -D -e -f -fn -fa -h -i -ln \ - -list -L -m -O -p -q -r -R -s -S -t -U -v -wipe -x -X --help \ + -list -L -m -O -p -q -r -R -s -S -t -T -U -v -wipe -x -X --help \ --version' -- "$cur" ) ) fi } &&