[Bug 655849] Re: /etc/bash_completion.d/mutt quotes tilde which cannot be expanded by bash (or: why is query_command invoked at this place at all?)
Peter Cordes
peter at cordes.ca
Sat Nov 29 12:31:04 UTC 2014
not reproducible on trusty. I have mutt installed, but my mailserver is
an old Debian box that I ssh to and run mutt on, so I don't have
anything but the default mutt setup to test with easily on current
Ubuntu.
reopen if this is still actually broken.
** Changed in: bash-completion (Ubuntu)
Status: New => Fix Released
--
You received this bug notification because you are a member of Ubuntu
Foundations Bugs, which is subscribed to bash-completion in Ubuntu.
https://bugs.launchpad.net/bugs/655849
Title:
/etc/bash_completion.d/mutt quotes tilde which cannot be expanded by
bash (or: why is query_command invoked at this place at all?)
Status in bash-completion package in Ubuntu:
Fix Released
Bug description:
Binary package hint: bash-completion
Expected vs observed behaviour
==============================
When typing
$ mutt -f =k<TAB>
bash-completion should offer mailboxes starting with "k"
Instead, bash gives the error message
$ mutt -f =kbash: ~/.mutt/muttquery: No such file or directory
Bug 1: Completion produces a bash error
Bug 2: Completion executes mutt's query_command, which is intended for retrieving email addresses, not mail boxes
Analysis
========
- Pressing <TAB> invokes bash completion, which calls "_muttquery" from /etc/bash_completion.d/mutt
- "_muttquery" calls "mutt -Q query_command", which in my case returns the string
query_command="~/.mutt/muttquery '%s'"
- "_muttquery" extracts the substring "~/.mutt/muttquery '%s'" (without surrounding quotes), replaces %s by "'\''k'\''" (without surrounding quotes), and then executes the bash command
'~/.mutt/muttquery' ''\''k'\'''
Since the tilde is quoted by single quotes, bash does not expand it to
the home dir, but interprets it literally. Hence the observed bash
error message.
Bug 1: Completion should not single-quote tildes which are expected to be expanded by bash.
Bug 2: Completion should not call _muttquery since there is no mail address expected after "-f ="
ProblemType: Bug
DistroRelease: Ubuntu 10.04
Package: bash-completion 1:1.1-3ubuntu2
ProcVersionSignature: Ubuntu 2.6.32-25.44-generic 2.6.32.21+drm33.7
Uname: Linux 2.6.32-25-generic i686
Architecture: i386
Date: Wed Oct 6 18:08:40 2010
InstallationMedia: Ubuntu 10.04.1 LTS "Lucid Lynx" - Release i386 (20100816.1)
PackageArchitecture: all
ProcEnviron:
PATH=(custom, user)
LANG=en_IE.utf8
SHELL=/bin/bash
SourcePackage: bash-completion
To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/bash-completion/+bug/655849/+subscriptions
More information about the foundations-bugs
mailing list