Repository navigation
Conversation
1385804 to
dabbe03
Compare
dabbe03 to
3b9e900
Compare
|
oh my god, i accidentally force pushed again ugh |
6d64077 to
28046e5
Compare
28046e5 to
bbe56d5
Compare
|
I also removed But on August 20th 2c1740e (PR #973), |
|
Thanks for the great fix again! Do you think we should be observing |
|
Yes, I think we could create a new PR for that later Do you think we should implement exactly what bash + readline does? Like iirc, if match hidden files on, dotglob off, hitting tab will show dotfiles but rm -rf * won't delete dotfiles, dotfiles are only deleted IF dotglob is turned on. If we are doing it this way, we just need to expose dotglob to flyline on top of this current pr. Correct me if I'm wrong, but if we are going your route, eg only expand what is shown on tab completion, we just need to expose dotglob to flyline, match hidden files isn't needed anymore, but doing it this way means we have to filter the dotfiles expanded by CommandComp (completions generated by programmable completions) internally via flyline. Right now in this pr, the dotfiles generated by CommandComp are filtered via readline, using the bind command that turns match hidden files off. |
|
I spent some more time thinking about how things should work. I suppose there are three cases:
Do you think this is sensible? |
|
Sure we could do that, since we are not gonna filter it inside flyline, that means we have to keep |
|
I think we'll need |
This pr fixes two distinct bugs that were causing dotfiles to be completely excluded from tab completion
( Closes #992 and #864 )
Bug 1:
Flyline's native filename expansion was hardcoded to always skip hidden files.
This pr allows flyline to read
_rl_match_hidden_filesdirectly from bash, it will now dynamically respect your standard bash config, users can simply addbind 'set match-hidden-files off'to their~/.bashrcto stop dotfiles from showing.Bug 2:
Even with the first fix, if a user had an alias like
alias ls='ls --group-directories-first', flyline would expand the alias before asking Bash for completions. This is fine but if the user havebash-completioninstalled, which most users do, this will trigger a crude regex bug inbash-completionIn v2.18.0 of
bash-completion, inside the generic_comp_complete_longoptfunction,bash-completionuses this exact code to guess what flags do:Because
--group-directories-firstcontains the worddir, the regex blindly assumes the user is trying to supply a directory argument to the flag, which forcescompgen -dhiding all filesIn this pr, flyline now detects self aliases, if the command is self aliased flyline will simply not expand it, which is exactly how native bash handles aliases, this prevents bug 2.