[Bash-completion-devel] Bug#630521: files starting with '!' break editors file-based completion

Bernhard Reutner-Fischer rep.dot.nop at gmail.com
Fri Oct 14 14:34:04 UTC 2011


Package: bash-completion
Version: 1:1.3-1
Followup-For: Bug #630521

Hi,

Any update?
I'm still seeing this:

$ mkdir -p /tmp/630521
$ touch /tmp/630521/{\!,file{1,2,3}}
$ cd /tmp/630521
$ ls -1
!
file1
file2
file3
$ set -x
$ vi fil+ local IFS cur xspec
+ IFS='
'
+ COMPREPLY=()
+ _get_comp_words_by_ref cur
+ local exclude flag i OPTIND=1
+ words=()
+ local cur cword words
+ upargs=()
+ upvars=()
+ local upargs upvars vcur vcword vprev vwords
+ getopts c:i:n:p:w: flag cur
+ [[ 1 -ge 1 ]]
+ case ${!OPTIND} in
+ vcur=cur
+ let 'OPTIND += 1'
+ [[ 1 -ge 2 ]]
+ __get_cword_at_cursor_by_ref '' words cword cur
+ words=()
+ local cword words
+ __reassemble_comp_words_by_ref '' words cword
+ local exclude i j ref
+ [[ -n '' ]]
+ eval cword=1
++ cword=1
+ [[ -n '' ]]
+ eval 'words=(' '"${COMP_WORDS[@]}"' ')'
++ words=("${COMP_WORDS[@]}")
+ local i cur2
+ local 'cur=vi fil'
+ local index=6
+ (( i = 0 ))
+ (( i <= cword ))
+ [[ 6 -ge 2 ]]
+ [[ vi != \v\i ]]
+ [[ 0 -lt 1 ]]
+ local old_size=6
+ cur=' fil'
+ local new_size=4
+ index=4
+ (( ++i  ))
+ (( i <= cword ))
+ [[ 4 -ge 3 ]]
+ [[  fi != \f\i\l ]]
+ cur=fil
+ (( index-- ))
+ [[ 3 -ge 3 ]]
+ [[ fil != \f\i\l ]]
+ [[ 1 -lt 1 ]]
+ (( ++i  ))
+ (( i <= cword ))
+ [[ fil != \f\i\l ]]
+ cur2=fil
+ local words cword cur
+ _upvars -a2 words vi fil -v cword 1 -v cur fil
+ ((  10  ))
+ ((  10  ))
+ case $1 in
+ [[ -n 2 ]]
+ printf %d 2
+ [[ -n words ]]
+ unset -v words
+ eval 'words=("${@:3:2}")'
++ words=("${@:3:2}")
+ shift 4
+ ((  6  ))
+ case $1 in
+ [[ -n cword ]]
+ unset -v cword
+ eval 'cword="$3"'
++ cword=1
+ shift 3
+ ((  3  ))
+ case $1 in
+ [[ -n cur ]]
+ unset -v cur
+ eval 'cur="$3"'
++ cur=fil
+ shift 3
+ ((  0  ))
+ [[ -n cur ]]
+ upvars+=("$vcur")
+ upargs+=(-v $vcur "$cur")
+ [[ -n '' ]]
+ [[ -n '' ]]
+ [[ -n '' ]]
+ ((  1  ))
+ local cur
+ _upvars -v cur fil
+ ((  3  ))
+ ((  3  ))
+ case $1 in
+ [[ -n cur ]]
+ unset -v cur
+ eval 'cur="$3"'
++ cur=fil
+ shift 3
+ ((  0  ))
+ _expand
+ [[ fil == \~*/* ]]
+ [[ fil == \~* ]]
++ awk '/^complete[ \t]+.*[ \t]vi([ \t]|$)/ { print $0; exit }' /etc/bash_completion
+ xspec='complete -f -X '\''*.@(o|so|so.!(conf)|a|[rs]pm|gif|jp?(e)g|mp3|mp?(e)g|avi|asf|ogg|class)'\'' vi vim gvim rvim view rview rgvim rgview gview emacs xemacs sxemacs kate kwrite'
+ xspec=''\''*.@(o|so|so.!(conf)|a|[rs]pm|gif|jp?(e)g|mp3|mp?(e)g|avi|asf|ogg|class)'\'' vi vim gvim rvim view rview rgvim rgview gview emacs xemacs sxemacs kate kwrite'
+ xspec=''\''*.@(o|so|so.!(conf)|a|[rs]pm|gif|jp?(e)g|mp3|mp?(e)g|avi|asf|ogg|class)'\'''
+ local -a toks
+ local tmp
+ toks=(${toks[@]-} $(
        compgen -d -- "$(quote_readline "$cur")" | {
        while read -r tmp; do
            # see long TODO comment in _filedir() --David
            printf '%s\n' $tmp
        done
        }
        ))
++ read -r tmp
+++ quote_readline fil
+++ local quoted
+++ _quote_readline_by_ref fil ret
+++ [[ f == \' ]]
+++ [[ 4 -le 3 ]]
+++ printf -v ret %q fil
+++ [[ f == \$ ]]
+++ printf %s fil
++ compgen -d -- fil
+ eval 'xspec='\''*.@(o|so|so.!(conf)|a|[rs]pm|gif|jp?(e)g|mp3|mp?(e)g|avi|asf|ogg|class)'\'''
++ xspec='*.@(o|so|so.!(conf)|a|[rs]pm|gif|jp?(e)g|mp3|mp?(e)g|avi|asf|ogg|class)'
+ local 'matchop=!'
+ [[ *.@(o|so|so.!(conf)|a|[rs]pm|gif|jp?(e)g|mp3|mp?(e)g|avi|asf|ogg|class) == !* ]]
+ [[ 4 -ge 4 ]]
+ xspec='!(*.@(o|so|so.!(conf)|a|[rs]pm|gif|jp?(e)g|mp3|mp?(e)g|avi|asf|ogg|class)|*.@(O|SO|SO.!(CONF)|A|[RS]PM|GIF|JP?(E)G|MP3|MP?(E)G|AVI|ASF|OGG|CLASS))'
+ toks=(${toks[@]-} $(
        eval compgen -f -X "!$xspec" -- "\$(quote_readline "\$cur")" | {
        while read -r tmp; do
            [ -n $tmp ] && printf '%s\n' $tmp
        done
        }
        ))
++ eval compgen -f -X '!!(*.@(o|so|so.!(conf)|a|[rs]pm|gif|jp?(e)g|mp3|mp?(e)g|avi|asf|ogg|class)|*.@(O|SO|SO.!(CONF)|A|[RS]PM|GIF|JP?(E)G|MP3|MP?(E)G|AVI|ASF|OGG|CLASS))' -- '$(quote_readline $cur)'
++ read -r tmp
++++ quote_readline fil
++++ local quoted
++++ _quote_readline_by_ref fil ret
++++ [[ f == \' ]]
++++ [[ 4 -le 3 ]]
++++ printf -v ret %q fil
++++ [[ f == \$ ]]
++++ printf %s fil
+++ compgen -f -X '!' -- fil
+ '[' 0 -ne 0 ']'
+ COMPREPLY=("${toks[@]}")

thanks,

-- System Information:
Debian Release: wheezy/sid
  APT prefers testing
  APT policy: (500, 'testing')
Architecture: amd64 (x86_64)

Kernel: Linux 3.0.0-1-amd64 (SMP w/4 CPU cores)
Locale: LANG=en_GB.UTF-8, LC_CTYPE=en_GB.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/bash

Versions of packages bash-completion depends on:
ii  bash  4.1-3

bash-completion recommends no packages.

bash-completion suggests no packages.

-- no debconf information





More information about the Bash-completion-devel mailing list