Fixes to completions for filenames containing tabs (RedHat: #629518).
This commit is contained in:
parent
35ac650e30
commit
3d8efed618
1
CHANGES
1
CHANGES
@ -25,6 +25,7 @@ bash-completion (2.x)
|
|||||||
* Fix known hosts completion for IPv6 addresses whose last 16 bits are digits
|
* Fix known hosts completion for IPv6 addresses whose last 16 bits are digits
|
||||||
(Alioth: #312695, RedHat: #630658).
|
(Alioth: #312695, RedHat: #630658).
|
||||||
* Improve mplayer and mencoder completions.
|
* Improve mplayer and mencoder completions.
|
||||||
|
* Fixes to completions for filenames containing tabs (RedHat: #629518).
|
||||||
|
|
||||||
[ Freddy Vulto ]
|
[ Freddy Vulto ]
|
||||||
* Added _tilde(), fix ~username completion (Alioth: #312613, Debian: #587095)
|
* Added _tilde(), fix ~username completion (Alioth: #312613, Debian: #587095)
|
||||||
|
@ -615,7 +615,7 @@ _quote_readline_by_ref()
|
|||||||
#
|
#
|
||||||
_filedir()
|
_filedir()
|
||||||
{
|
{
|
||||||
local i IFS=$'\t\n' xspec
|
local i IFS=$'\n' xspec
|
||||||
|
|
||||||
_tilde "$cur" || return 0
|
_tilde "$cur" || return 0
|
||||||
|
|
||||||
@ -1361,7 +1361,7 @@ complete -F _known_hosts traceroute traceroute6 tracepath tracepath6 ping \
|
|||||||
#
|
#
|
||||||
_cd()
|
_cd()
|
||||||
{
|
{
|
||||||
local cur IFS=$'\t\n' i j k
|
local cur IFS=$'\n' i j k
|
||||||
_get_comp_words_by_ref cur
|
_get_comp_words_by_ref cur
|
||||||
|
|
||||||
# try to allow variable completion
|
# try to allow variable completion
|
||||||
@ -1384,7 +1384,7 @@ _cd()
|
|||||||
local -r mark_symdirs=$(_rl_enabled mark-symlinked-directories && echo y)
|
local -r mark_symdirs=$(_rl_enabled mark-symlinked-directories && echo y)
|
||||||
|
|
||||||
# we have a CDPATH, so loop on its contents
|
# we have a CDPATH, so loop on its contents
|
||||||
for i in ${CDPATH//:/$'\t'}; do
|
for i in ${CDPATH//:/$'\n'}; do
|
||||||
# create an array of matched subdirs
|
# create an array of matched subdirs
|
||||||
k="${#COMPREPLY[@]}"
|
k="${#COMPREPLY[@]}"
|
||||||
for j in $( compgen -d $i/$cur ); do
|
for j in $( compgen -d $i/$cur ); do
|
||||||
@ -1564,7 +1564,7 @@ _filedir_xspec()
|
|||||||
{
|
{
|
||||||
local IFS cur xspec
|
local IFS cur xspec
|
||||||
|
|
||||||
IFS=$'\t\n'
|
IFS=$'\n'
|
||||||
COMPREPLY=()
|
COMPREPLY=()
|
||||||
_get_comp_words_by_ref cur
|
_get_comp_words_by_ref cur
|
||||||
|
|
||||||
|
@ -21,7 +21,7 @@ _bzip2()
|
|||||||
return 0
|
return 0
|
||||||
fi
|
fi
|
||||||
|
|
||||||
local IFS=$'\t\n'
|
local IFS=$'\n'
|
||||||
|
|
||||||
xspec="*.bz2"
|
xspec="*.bz2"
|
||||||
if [[ "$prev" == --* ]]; then
|
if [[ "$prev" == --* ]]; then
|
||||||
|
@ -21,7 +21,7 @@ _gzip()
|
|||||||
return 0
|
return 0
|
||||||
fi
|
fi
|
||||||
|
|
||||||
local IFS=$'\t\n'
|
local IFS=$'\n'
|
||||||
|
|
||||||
xspec="*.@(gz|t[ag]z)"
|
xspec="*.@(gz|t[ag]z)"
|
||||||
if [[ "$prev" == --* ]]; then
|
if [[ "$prev" == --* ]]; then
|
||||||
|
@ -48,7 +48,7 @@ _lrzip()
|
|||||||
|
|
||||||
_expand || return 0
|
_expand || return 0
|
||||||
|
|
||||||
local IFS=$'\t\n'
|
local IFS=$'\n'
|
||||||
COMPREPLY=( $( compgen -f -X "$xspec" -- "$cur" ) \
|
COMPREPLY=( $( compgen -f -X "$xspec" -- "$cur" ) \
|
||||||
$( compgen -d -- "$cur" ) )
|
$( compgen -d -- "$cur" ) )
|
||||||
} &&
|
} &&
|
||||||
|
@ -16,7 +16,7 @@ _lzma()
|
|||||||
return 0
|
return 0
|
||||||
fi
|
fi
|
||||||
|
|
||||||
local IFS=$'\t\n'
|
local IFS=$'\n'
|
||||||
|
|
||||||
xspec="*.@(lzma|tlz)"
|
xspec="*.@(lzma|tlz)"
|
||||||
if [[ "$prev" == --* ]]; then
|
if [[ "$prev" == --* ]]; then
|
||||||
|
@ -53,7 +53,7 @@ _lzop()
|
|||||||
|
|
||||||
_expand || return 0
|
_expand || return 0
|
||||||
|
|
||||||
local IFS=$'\t\n'
|
local IFS=$'\n'
|
||||||
COMPREPLY=( $( compgen -f -X "$xspec" -- "$cur" ) \
|
COMPREPLY=( $( compgen -f -X "$xspec" -- "$cur" ) \
|
||||||
$( compgen -d -- "$cur" ) )
|
$( compgen -d -- "$cur" ) )
|
||||||
} &&
|
} &&
|
||||||
|
@ -48,7 +48,7 @@ _mplayer()
|
|||||||
;;
|
;;
|
||||||
-vobsub)
|
-vobsub)
|
||||||
_filedir '@(idx|ifo|sub)'
|
_filedir '@(idx|ifo|sub)'
|
||||||
local IFS=$'\t\n'
|
local IFS=$'\n'
|
||||||
COMPREPLY=( $( for i in "${COMPREPLY[@]}"; do
|
COMPREPLY=( $( for i in "${COMPREPLY[@]}"; do
|
||||||
if [[ -f $i && -r $i ]]; then
|
if [[ -f $i && -r $i ]]; then
|
||||||
printf '%s\n' ${i%.*}
|
printf '%s\n' ${i%.*}
|
||||||
@ -76,7 +76,7 @@ _mplayer()
|
|||||||
dirs=(/usr/share/mplayer/skins /usr/local/share/mplayer/skins)
|
dirs=(/usr/share/mplayer/skins /usr/local/share/mplayer/skins)
|
||||||
fi
|
fi
|
||||||
|
|
||||||
local IFS=$'\t\n'
|
local IFS=$'\n'
|
||||||
for i in ~/.mplayer/skins ${dirs[@]}; do
|
for i in ~/.mplayer/skins ${dirs[@]}; do
|
||||||
if [[ -d $i && -r $i ]]; then
|
if [[ -d $i && -r $i ]]; then
|
||||||
for j in $( compgen -d $i/$cur ); do
|
for j in $( compgen -d $i/$cur ); do
|
||||||
|
@ -30,7 +30,7 @@ _perl()
|
|||||||
# only handle module completion for now
|
# only handle module completion for now
|
||||||
case $prev in
|
case $prev in
|
||||||
-I|-x)
|
-I|-x)
|
||||||
local IFS=$'\t\n'
|
local IFS=$'\n'
|
||||||
COMPREPLY=( $( compgen -d $optPrefix $optSuffix -- "$cur" ) )
|
COMPREPLY=( $( compgen -d $optPrefix $optSuffix -- "$cur" ) )
|
||||||
return 0
|
return 0
|
||||||
;;
|
;;
|
||||||
|
@ -246,13 +246,13 @@ _sftp()
|
|||||||
shopt -u hostcomplete && complete -F _sftp sftp
|
shopt -u hostcomplete && complete -F _sftp sftp
|
||||||
|
|
||||||
# things we want to escape in remote scp paths
|
# things we want to escape in remote scp paths
|
||||||
_scp_path_esc="[][(){}<>\",:;^&\!$=?\`|\\ ']"
|
_scp_path_esc="[][(){}<>\",:;^&\!$=?\`|\\ \t']"
|
||||||
|
|
||||||
# Complete remote files with ssh. If the first arg is -d, complete on dirs
|
# Complete remote files with ssh. If the first arg is -d, complete on dirs
|
||||||
# only. Returns paths escaped with three backslashes.
|
# only. Returns paths escaped with three backslashes.
|
||||||
_scp_remote_files()
|
_scp_remote_files()
|
||||||
{
|
{
|
||||||
local IFS=$'\t\n'
|
local IFS=$'\n'
|
||||||
|
|
||||||
# remove backslash escape from the first colon
|
# remove backslash escape from the first colon
|
||||||
cur=${cur/\\:/:}
|
cur=${cur/\\:/:}
|
||||||
@ -291,7 +291,7 @@ _scp_remote_files()
|
|||||||
# an optional prefix to add to returned completions.
|
# an optional prefix to add to returned completions.
|
||||||
_scp_local_files()
|
_scp_local_files()
|
||||||
{
|
{
|
||||||
local IFS=$'\t\n'
|
local IFS=$'\n'
|
||||||
|
|
||||||
local dirsonly=false
|
local dirsonly=false
|
||||||
if [ "$1" = -d ]; then
|
if [ "$1" = -d ]; then
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
have wvdial &&
|
have wvdial &&
|
||||||
_wvdial()
|
_wvdial()
|
||||||
{
|
{
|
||||||
local cur prev config i IFS=$'\t\n'
|
local cur prev config i IFS=$'\n'
|
||||||
|
|
||||||
COMPREPLY=()
|
COMPREPLY=()
|
||||||
_get_comp_words_by_ref cur prev
|
_get_comp_words_by_ref cur prev
|
||||||
@ -23,7 +23,7 @@ _wvdial()
|
|||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
# start with global and personal config files
|
# start with global and personal config files
|
||||||
config="/etc/wvdial.conf"$'\t'"$HOME/.wvdialrc"
|
config="/etc/wvdial.conf"$'\n'"$HOME/.wvdialrc"
|
||||||
# replace with command line config file if present
|
# replace with command line config file if present
|
||||||
for (( i=1; i < COMP_CWORD; i++ )); do
|
for (( i=1; i < COMP_CWORD; i++ )); do
|
||||||
if [[ "${COMP_WORDS[i]}" == "--config" ]]; then
|
if [[ "${COMP_WORDS[i]}" == "--config" ]]; then
|
||||||
|
@ -52,7 +52,7 @@ _xz()
|
|||||||
|
|
||||||
_expand || return 0
|
_expand || return 0
|
||||||
|
|
||||||
local IFS=$'\t\n'
|
local IFS=$'\n'
|
||||||
COMPREPLY=( $( compgen -f -X "$xspec" -- "$cur" ) \
|
COMPREPLY=( $( compgen -f -X "$xspec" -- "$cur" ) \
|
||||||
$( compgen -d -- "$cur" ) )
|
$( compgen -d -- "$cur" ) )
|
||||||
} &&
|
} &&
|
||||||
|
Loading…
x
Reference in New Issue
Block a user