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

Make tab-completion with wildcards make more sense #954

Closed
ghost opened this issue Aug 14, 2013 · 2 comments
Closed

Make tab-completion with wildcards make more sense #954

ghost opened this issue Aug 14, 2013 · 2 comments

Comments

@ghost
Copy link

ghost commented Aug 14, 2013

Example:

$ touch file(seq 4)
$ ls
file1  file2  file3  file4
$ echo f*<tab>

This autocompletes to f*ile. It should autocomplete to file* or file, imo.

Tab completion with wildcards is pretty awkward at the moment.

@ridiculousfish
Copy link
Member

Yep, that's weird all right.

@nakaomote
Copy link

nakaomote commented Mar 17, 2016

Can definitely +1 on this. It's actually highly misleading:

$ touch (seq 1 9)abc(seq 1 9)
$ ls
1abc1  1abc4  1abc7  2abc1  2abc4  2abc7  3abc1  3abc4  3abc7  4abc1  4abc4  4abc7  5abc1  5abc4  5abc7  6abc1  6abc4  6abc7  7abc1  7abc4  7abc7  8abc1  8abc4  8abc7  9abc1  9abc4  9abc7
1abc2  1abc5  1abc8  2abc2  2abc5  2abc8  3abc2  3abc5  3abc8  4abc2  4abc5  4abc8  5abc2  5abc5  5abc8  6abc2  6abc5  6abc8  7abc2  7abc5  7abc8  8abc2  8abc5  8abc8  9abc2  9abc5  9abc8
1abc3  1abc6  1abc9  2abc3  2abc6  2abc9  3abc3  3abc6  3abc9  4abc3  4abc6  4abc9  5abc3  5abc6  5abc9  6abc3  6abc6  6abc9  7abc3  7abc6  7abc9  8abc3  8abc6  8abc9  9abc3  9abc6  9abc9
wfletcher@purple                                                                                                                                                                                                                                                              
$ ls \*abc\*7 #hit me that TAB key||
*abc*1  *abc*3  *abc*5  *abc*7  *abc*9
*abc*2  *abc*4  *abc*6  *abc*8

@zanchey zanchey added the bug Something that's not working as intended label May 21, 2016
@krader1961 krader1961 added enhancement and removed bug Something that's not working as intended labels Mar 29, 2017
@krader1961 krader1961 modified the milestones: fish-future, next-major Mar 29, 2017
ridiculousfish added a commit to ridiculousfish/fish-shell that referenced this issue Dec 29, 2021
Prior to this change, if you tab-completed a token with a wildcard (glob), we
would invoke ordinary completions. Instead, expand the wildcard, replacing
the wildcard with the result of expansions. If the wildcard fails to expand,
flash the command line to signal an error and do not modify it.

Example:

    > touch file(seq 4)
    > echo file*<tab>

becomes:

    > echo file1 file2 file3 file4

whereas before the tab would have just added a space.

Some things to note:

1. If the expansion would produce more than 256 items, we flash the command
line and do nothing, since it would make the commandline overfull.

2. The wildcard token can be brought back through Undo (ctrl-Z).

Fixes fish-shell#954.
ridiculousfish added a commit to ridiculousfish/fish-shell that referenced this issue Dec 29, 2021
Prior to this change, if you tab-completed a token with a wildcard (glob), we
would invoke ordinary completions. Instead, expand the wildcard, replacing
the wildcard with the result of expansions. If the wildcard fails to expand,
flash the command line to signal an error and do not modify it.

Example:

    > touch file(seq 4)
    > echo file*<tab>

becomes:

    > echo file1 file2 file3 file4

whereas before the tab would have just added a space.

Some things to note:

1. If the expansion would produce more than 256 items, we flash the command
line and do nothing, since it would make the commandline overfull.

2. The wildcard token can be brought back through Undo (ctrl-Z).

Fixes fish-shell#954.
@zanchey zanchey modified the milestones: fish-future, fish 3.5.0 May 5, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants