-
Notifications
You must be signed in to change notification settings - Fork 374
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
mutt: do not lose the + in mutt -f +foo<tab> #465
base: main
Are you sure you want to change the base?
Conversation
This one's submitted upstream as scop/bash-completion#465
I am baffled: I have a machine with Ubuntu 18.04 LTS (bash 4.4.20(1)-release, bash-completion 1:2.8-1ubuntu1) where |
I've found a solution that works on both Ubuntu 18.04 and 20.10, but I don't entirely understand the situation: mgedmin/dotfiles@4758e78 Update: I've incorporated that solution into this PR. The more I think about it, the more it seems right: it should adjust to changes in $COMP_WORDBREAKS automatically. (Although COMP_WORDBREAKS is not the reason completion behaves differently on Ubuntu 18.04 and 20.10. I wonder if there was a bash bug that got fixed) |
I haven't fully understood how exactly this happens, but sometimes (Ubuntu 18.04) '=foo' ends up as a single word in COMP_WORDS, despite COMP_WORDBREAKS containing '='. At other times '=foo' is split into two words, '=' and 'foo'. If COMP_WORDS[$COMP_CWORD] had the '+' or '=' prefix, we need to make sure COMPREPLY also includes it, or we'll lose it. Closes scop#464, in a better way.
Welp this doesn't actually work on Ubuntu 20.10. I thought I'd tested it! Back to the drawing board... |
It was broken by my previous fixes and would expand to mutt -f =\=. I've tested the new code on Ubuntu 18.04 as well as 20.10. I've tested these cases: mutt -f =<tab> mutt -f +<tab> mutt -f =mailb<tab> mutt -f +mailb<tab> They all work now.
I did test it, and What breaks is Fixed now. |
I now have tests for this in #467. Without this fix they fail as follows:
|
c0e9459
to
09307f8
Compare
Closes #464.