Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

autocomplete doesn't work properly on file :0.log when bash-completion is installed #208

Open
scop opened this issue May 3, 2018 · 5 comments

Comments

@scop
Copy link
Owner

scop commented May 3, 2018

https://bugzilla.redhat.com/show_bug.cgi?id=962492

Andre Robatino 2013-05-13 12:27:45 EDT
Description of problem:
I have a file named :0.log (one of the gdm logs). If I try to use ls -l on it by typing : and then tabbing to autocomplete, I get

[andre@compaq-pc tmp]$ ls -l :\:0.log 
ls: cannot access ::0.log: No such file or directory
[andre@compaq-pc tmp]$

If instead I first type \: and then autocomplete, it works. If I uninstall bash-completion and open a new terminal, then typing : and tabbing gives me a list of possibilities including the correct one.

Version-Release number of selected component (if applicable):
bash-completion-2.1-2.fc18.noarch

How reproducible:
always

[reply] [−] Comment 1 Ville Skyttä 2013-05-14 10:36:42 EDT
That would be entry E13 in the bash FAQ: http://tiswww.case.edu/php/chet/bash/FAQ, and see also __ltrim_colon_completions comments in /usr/share/bash-completion/bash_completion

I suppose we should consider doing the COMP_WORDBREAKS modification in the bash-completion package automatically, for example in /etc/profile.d/bash_completion.sh

@jarnos
Copy link

jarnos commented Oct 25, 2019

Apparently backslashes have disappeared in the post.

@scop
Copy link
Owner Author

scop commented Oct 26, 2019

Not sure if they've ever been there. Nevertheless I think it's readable enough.

@jarnos
Copy link

jarnos commented Oct 28, 2019

Well, they should have, but GitHub removes them even if you did type them unless you type double backslashes. I suppose you meant

If instead I first type \: and then autocomplete, it works.

@scop
Copy link
Owner Author

scop commented Nov 1, 2019

Ah, back_slashes_! I somehow read that as backticks. Anyway, fixed now using backticks :)

@kevinoid
Copy link
Contributor

I just encountered this issue (I think) for directories which contain a colon. An example:

mkdir -p /tmp/test:dir/testdir
ls /tmp/test:dir/<tab>   # Does not complete
ls /tmp/test\:dir/<tab>  # Completes to /tmp/test\:dir/testdir/

This can be problematic in /sys where LED, PCI, and several other common device paths contain colons.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants