Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 378669 - app-shells/bash-4.2_p10: bash completion handles variables inconsistently
Summary: app-shells/bash-4.2_p10: bash completion handles variables inconsistently
Status: RESOLVED UPSTREAM
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal minor (vote)
Assignee: Gentoo's Team for Core System packages
URL: http://thread.gmane.org/gmane.comp.sh...
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-08-10 14:40 UTC by Martin von Gagern
Modified: 2011-08-14 20:20 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Martin von Gagern 2011-08-10 14:40:49 UTC
If the current word on the command line contains a shell variable, then the expansion works as if the variable had been expanded, but then quotes the variable. An example is probably a lot better than theory:

Steps to reproduce
1. Type "echo $HOME/.bas"
2. Press tab
3. Press tab again

Actual results:
2. expands to "echo \$HOME/.bash", assuming that all files ~/.bas* share the h as the fifth letter of their filename, and that at least two files differ in their sixth letter.
3. no list of possible completions, as \$HOME no longer is a variable reference, and there is no directory of that name suitable for expansion.

Expected results:
2. "echo $HOME/.bash"
3. List of file names printed to choose from

Past versions of bash up to 4.1 used to expand the variable when completing. In those cases, the completed version would look like "echo /home/user/.bash". A plain 4.2 build does exhibit the new behaviour as well. So it's an issue introduced in that code base. Unfortunately I know no source repository for bash where I could bisect this down to a small commit.
Comment 1 Martin von Gagern 2011-08-11 10:32:44 UTC
Forwarded this report upstream:
http://thread.gmane.org/gmane.comp.shells.bash.bugs/17020
Comment 2 SpanKY gentoo-dev 2011-08-14 20:20:02 UTC
this has been reported many times upstream already.  please search the archive.  the behavior you describe is at odds with another, so it's kind of a crap shoot.