Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 280331 - app-shells/bash: tab completion adds too many '\' when command path begins with '~'
Summary: app-shells/bash: tab completion adds too many '\' when command path begins wi...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: x86 Linux
: High normal (vote)
Assignee: Gentoo's Team for Core System packages
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-08-04 16:05 UTC by no_return_address
Modified: 2011-01-22 00:32 UTC (History)
0 users

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


Attachments
emerge --info (emerge_info.txt,3.75 KB, text/plain)
2009-08-04 16:06 UTC, no_return_address
Details

Note You need to log in before you can comment on or make changes to this bug.
Description no_return_address 2009-08-04 16:05:14 UTC
Under certain conditions I don't understand, when a folder name requires a '\' to escape part of it's name, and it is accessed with a pathname beginning with '~' to reference the home folder, tab completion will first correctly use the '\' to escape the special character, but pressing tab a second time will cause it to escape the '\' it created, then re-escape the special character, so that there are three '\' in a row.


Reproducible: Always

Steps to Reproduce:
1. Make a directory in your home folder called 'Awesome Z80' (something about that particular folder name seems to cause the most trouble)
2. Type '~/Awe' and then press tab.  Autocompletion will work as it should.
3. Press 'tab' one more time.

Actual Results:  
Assuming the folder name meets requirements I cannot determine, the '\' will be tripled, resulting in a non-functional file name.

Expected Results:  
Nothing about the file name should change for the second press of 'tab', instead I should see a listing of possible further completions.

I've tried many different directory names, but nothing seems to trigger the problem like "Awesome Z80" does.  I even tried creating another "Awesome Z80" in a subfolder to rule out the possibility that the problem is just that particular directory, and the problem occured with it as well.

Other directory names with spaces will sort of work, but only if you tab complete after typing '\ ' (with the space after the '\') but before finishing the directory name, whereas with "Awesome Z80" the problem occurs even when you tab complete before typing any '\' characters.

I am currently using app-shells/bash-3.2_p39 and sys-libs/readline-5.2_p13.
Comment 1 no_return_address 2009-08-04 16:06:22 UTC
Created attachment 200163 [details]
emerge --info
Comment 2 no_return_address 2009-08-07 22:03:53 UTC
It seems tab completion has another likely related problem:

I have an executable in my path named "FT245R Discovery"

If I type just "FT" and press tab, it correctly expands to "FT245R\ Discovery ", but if I type "FT245R\ Disc" and press tab, nothing happens.

It also works just fine if I go to the directory it is in and type "./FT245R\ Disc".
Comment 3 SpanKY gentoo-dev 2009-08-14 04:36:47 UTC
we really arent looking at bash-3 bugs anymore since we're looking at stabilizing bash-4

the issue doesnt seem to exist for me

make sure you arent using bash-completion, custom inputrc stuff, set your PS1 to something like "/ ", and try setting your locale to something simple like LC_ALL=C
Comment 4 SpanKY gentoo-dev 2011-01-22 00:32:49 UTC
bash-4.1 is stable