Bugs item #311384, was changed at 2009-01-30 08:21 by Mike Hanby
You can respond by visiting: 
https://alioth.debian.org/tracker/?func=detail&atid=413095&aid=311384&group_id=100114

Status: Open
Priority: 3
Submitted By: David Paleino (hanska-guest)
Assigned to: Nobody (None)
Summary: DBTS 336987: shell variables should always be a valid completion when 
syntactically valid 
Distribution: None
Originally reported in: Debian BTS
Milestone: None
Status: None
Original bug number: 336987


Initial Comment:
Normally, bash can complete shell variables when appropriate; for
example, "foo=1" followed by "echo $f<TAB>" will complete to "echo
$foo".  However, programmable completion interferes with this; for
example, "svn ls $f<TAB>", "cvs $f<TAB>", and "ssh $f<TAB>" all fail to
complete $foo.  Shell variables should always be a valid completion when
they are syntactically valid, since they could always contain a string
appropriate for the current command.

(By "when they are syntactically valid", I mean that the shell already
knows not to complete "echo \$f<TAB>" into "echo \$foo", and that
shouldn't change.)

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

Comment By: Mike Hanby (flakrat-guest)
Date: 2010-03-01 18:48

Message:
Anyone have a workaround for this issue?

Another couple examples where this is not working:

"ls -l $HOM<TAB>" fails to complete to "ls -l $HOME"
"du $HOM<TAB>" fails to complete to "du $HOME"

however this does work
"ls -l $HOME/<TAB>"
"du $HOME/<TAB>"



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

Comment By: Raphaƫl Droz (gibboris-guest)
Date: 2009-07-22 10:41

Message:
I was looking for a way to wrap $(complete) and make it call
a "variable_complete" before each specific completion
But I don't see any way to do it.
So my point of view is that we have to use the
dirty way and wish bash will make the completion
more smooth one of these days.

# copied from _cd()
comp_variables() {
        # try to allow variable completion
        if [[ "$cur" == ?(\\)\$* ]]; then
                COMPREPLY=( $( compgen -v -P '$' -- "${cur#?(\\)$}" ) )
                return 0
        fi
}

and call it in each completion... :S

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

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

_______________________________________________
Bash-completion-devel mailing list
Bash-completion-devel@lists.alioth.debian.org
http://lists.alioth.debian.org/mailman/listinfo/bash-completion-devel

Reply via email to