Debian Bug report logs -
#618734
bash completion: 'tar jcf <TAB>' should complete arbitrary filenames
Reported by: Adam Nielsen <adam.nielsen@uq.edu.au>
Date: Fri, 18 Mar 2011 00:30:01 UTC
Severity: minor
Tags: confirmed, fixed-upstream, upstream
Found in version bash-completion/1:1.2-3
Fixed in version bash-completion/1:1.90-1
Done: David Paleino <dapal@debian.org>
Bug is archived. No further changes may be made.
Toggle useless messages
Report forwarded
to debian-bugs-dist@lists.debian.org, Matthias Klose <doko@debian.org>:
Bug#618734; Package bash.
(Fri, 18 Mar 2011 00:30:04 GMT) (full text, mbox, link).
Acknowledgement sent
to Adam Nielsen <adam.nielsen@uq.edu.au>:
New Bug report received and forwarded. Copy sent to Matthias Klose <doko@debian.org>.
(Fri, 18 Mar 2011 00:30:04 GMT) (full text, mbox, link).
Message #5 received at submit@bugs.debian.org (full text, mbox, reply):
Package: bash
Version: 4.1-3
Severity: minor
When typing 'tar jcvf' and using tab to autocomplete, the autocomplete ignores
files without .bz2 extensions. For example, if you rename an archive to
really-long-filename.tar.bz2.old (adding .old onto the end), when you try to
recreate the archive by typing "tar jcvf really<tab>" (intending to delete the
'.old' part) it won't autocomplete so you have to type the whole long filename
from scratch.
-- System Information:
Debian Release: 6.0
APT prefers squeeze-updates
APT policy: (500, 'squeeze-updates'), (500, 'stable')
Architecture: amd64 (x86_64)
Kernel: Linux 2.6.32-5-amd64 (SMP w/8 CPU cores)
Locale: LANG=en_AU.UTF-8, LC_CTYPE=en_AU.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Versions of packages bash depends on:
ii base-files 6.0 Debian base system miscellaneous f
ii dash 0.5.5.1-7.4 POSIX-compliant shell
ii debianutils 3.4 Miscellaneous utilities specific t
ii libc6 2.11.2-10 Embedded GNU C Library: Shared lib
ii libncurses5 5.7+20100313-5 shared libraries for terminal hand
Versions of packages bash recommends:
ii bash-completion 1:1.2-3 programmable completion for the ba
Versions of packages bash suggests:
pn bash-doc <none> (no description available)
-- no debconf information
Information forwarded
to debian-bugs-dist@lists.debian.org, Matthias Klose <doko@debian.org>:
Bug#618734; Package bash.
(Fri, 18 Mar 2011 00:45:07 GMT) (full text, mbox, link).
Acknowledgement sent
to Jonathan Nieder <jrnieder@gmail.com>:
Extra info received and forwarded to list. Copy sent to Matthias Klose <doko@debian.org>.
(Fri, 18 Mar 2011 00:45:07 GMT) (full text, mbox, link).
Message #10 received at 618734@bugs.debian.org (full text, mbox, reply):
reassign 618734 bash-completion 1:1.2-3
severity 618734 wishlist
retitle 618734 bash completion: add keybinding to just complete pathnames
tags 618734 + upstream
quit
Hi Adam,
Adam Nielsen wrote:
> For example, if you rename an archive to
> really-long-filename.tar.bz2.old (adding .old onto the end), when you try to
> recreate the archive by typing "tar jcvf really<tab>" (intending to delete the
> '.old' part) it won't autocomplete so you have to type the whole long filename
> from scratch.
I think this behavior is intended. Uninstalling bash-completion might
be an okay workaround.
Thanks for reporting,
Jonathan
Bug reassigned from package 'bash' to 'bash-completion'.
Request was from Jonathan Nieder <jrnieder@gmail.com>
to control@bugs.debian.org.
(Fri, 18 Mar 2011 00:45:08 GMT) (full text, mbox, link).
Bug No longer marked as found in versions bash/4.1-3.
Request was from Jonathan Nieder <jrnieder@gmail.com>
to control@bugs.debian.org.
(Fri, 18 Mar 2011 00:45:09 GMT) (full text, mbox, link).
Bug Marked as found in versions bash-completion/1:1.2-3.
Request was from Jonathan Nieder <jrnieder@gmail.com>
to control@bugs.debian.org.
(Fri, 18 Mar 2011 00:45:10 GMT) (full text, mbox, link).
Severity set to 'wishlist' from 'minor'
Request was from Jonathan Nieder <jrnieder@gmail.com>
to control@bugs.debian.org.
(Fri, 18 Mar 2011 00:45:10 GMT) (full text, mbox, link).
Changed Bug title to 'bash completion: add keybinding to just complete pathnames' from 'bash: autocomplete fails with 'tar jcvf' and non .bz2 file'
Request was from Jonathan Nieder <jrnieder@gmail.com>
to control@bugs.debian.org.
(Fri, 18 Mar 2011 00:45:11 GMT) (full text, mbox, link).
Added tag(s) upstream.
Request was from Jonathan Nieder <jrnieder@gmail.com>
to control@bugs.debian.org.
(Fri, 18 Mar 2011 00:45:12 GMT) (full text, mbox, link).
Information forwarded
to debian-bugs-dist@lists.debian.org, Bash Completion Maintainers <bash-completion-devel@lists.alioth.debian.org>:
Bug#618734; Package bash-completion.
(Fri, 18 Mar 2011 01:57:02 GMT) (full text, mbox, link).
Acknowledgement sent
to Adam Nielsen <adam.nielsen@uq.edu.au>:
Extra info received and forwarded to list. Copy sent to Bash Completion Maintainers <bash-completion-devel@lists.alioth.debian.org>.
(Fri, 18 Mar 2011 01:57:02 GMT) (full text, mbox, link).
Message #27 received at 618734@bugs.debian.org (full text, mbox, reply):
>> For example, if you rename an archive to
>> really-long-filename.tar.bz2.old (adding .old onto the end), when you try to
>> recreate the archive by typing "tar jcvf really<tab>" (intending to delete the
>> '.old' part) it won't autocomplete so you have to type the whole long filename
>> from scratch.
>
> I think this behavior is intended. Uninstalling bash-completion might
> be an okay workaround.
Thanks for the quick reply! Just for the record I can see the reasoning
behind this behaviour, but I think it might be wrong when using the "c"
option to create an archive. I can certainly see the usefulness of only
matching .bz2 files when extracting an archive, but when creating an
archive I don't think you would often want to create it over the top of
an existing file - so if you use tab completion in this case, you are
probably wanting it to match any old file to save typing.
Also thanks for the retitle - I did try Alt+Tab, Ctrl+Tab, etc. in case
there was a key to unconditionally complete the pathname so this would
be a good solution too.
Thanks again,
Adam.
Information forwarded
to debian-bugs-dist@lists.debian.org, Bash Completion Maintainers <bash-completion-devel@lists.alioth.debian.org>:
Bug#618734; Package bash-completion.
(Fri, 18 Mar 2011 01:57:04 GMT) (full text, mbox, link).
Acknowledgement sent
to Jonathan Nieder <jrnieder@gmail.com>:
Extra info received and forwarded to list. Copy sent to Bash Completion Maintainers <bash-completion-devel@lists.alioth.debian.org>.
(Fri, 18 Mar 2011 01:57:04 GMT) (full text, mbox, link).
Message #32 received at 618734@bugs.debian.org (full text, mbox, reply):
clone 618734 -1
retitle 618734 bash completion: 'tar jcf <TAB>' should complete arbitrary filenames
severity 618734 minor
quit
Adam Nielsen wrote:
> Just for the record I can see the
> reasoning behind this behaviour, but I think it might be wrong when
> using the "c" option to create an archive.
There is definitely more going on than I thought --- 'tar cjf <TAB>'
does the Right Thing™ while 'tar jcf <TAB>' does not. See
/etc/bash_completion.d/tar for details. So this does look like a
genuine bug. :)
Let's file my side-suggestion separately.
Thanks for clarifying.
Jonathan
Bug 618734 cloned as bug 618740.
Request was from Jonathan Nieder <jrnieder@gmail.com>
to control@bugs.debian.org.
(Fri, 18 Mar 2011 01:57:05 GMT) (full text, mbox, link).
Changed Bug title to 'bash completion: 'tar jcf <TAB>' should complete arbitrary filenames' from 'bash completion: add keybinding to just complete pathnames'
Request was from Jonathan Nieder <jrnieder@gmail.com>
to control@bugs.debian.org.
(Fri, 18 Mar 2011 01:57:07 GMT) (full text, mbox, link).
Severity set to 'minor' from 'wishlist'
Request was from Jonathan Nieder <jrnieder@gmail.com>
to control@bugs.debian.org.
(Fri, 18 Mar 2011 01:57:08 GMT) (full text, mbox, link).
Information forwarded
to debian-bugs-dist@lists.debian.org, Bash Completion Maintainers <bash-completion-devel@lists.alioth.debian.org>:
Bug#618734; Package bash-completion.
(Fri, 18 Mar 2011 02:24:03 GMT) (full text, mbox, link).
Acknowledgement sent
to Jonathan Nieder <jrnieder@gmail.com>:
Extra info received and forwarded to list. Copy sent to Bash Completion Maintainers <bash-completion-devel@lists.alioth.debian.org>.
(Fri, 18 Mar 2011 02:24:03 GMT) (full text, mbox, link).
Message #43 received at 618734@bugs.debian.org (full text, mbox, reply):
Currently "tar cjf <TAB>" completes arbitrary filenames, while
"tar jcf <TAB>" completes files with a .bz2 suffix.
It is useful to only match .bz2 files when extracting an archive, but
when using "c" to create an archive I don't think you would often want
to create it over the top of an existing file. So if you use tab
completion in this case, you are probably wanting it to match any old
file to save typing. Make it so.
Reported-by: Adam Nielsen <adam.nielsen@uq.edu.au>
---
How about something like this patch? It occurs to me that
* "tar -rjf <TAB>" completes arbitrary files instead of just
bzip2 files;
* the pattern "tar --compare <TAB>" triggers this case by
accident; similarly, "tar --diff <TAB>" triggers the -f
case by accident.
With a fixup for those, would this be a sane thing to do?
Thoughts, bug reports, improvements welcome.
CHANGES | 4 ++++
completions/tar | 2 +-
2 files changed, 5 insertions(+), 1 deletions(-)
diff --git a/CHANGES b/CHANGES
index eedac4e..b3ba70e 100644
--- a/CHANGES
+++ b/CHANGES
@@ -10,6 +10,10 @@ bash-completion (2.x)
[ Guillaume Rousse ]
* added puppet completion, using work from Mathieu Parent (sathieudebian.org)
+ [ Jonathan Nieder ]
+ * Complete arbitrary filenames in the argument to "tar zcf", like we already
+ do for "tar czf" (Debian: #618734)
+
-- David Paleino <d.paleino@gmail.com> Sun, 06 Feb 2011 21:46:37 +0100
bash-completion (1.3)
diff --git a/completions/tar b/completions/tar
index a5c0249..5dfaca5 100644
--- a/completions/tar
+++ b/completions/tar
@@ -14,7 +14,7 @@ _tar()
fi
case ${COMP_WORDS[1]} in
- ?(-)[cr]*f)
+ ?(-)r*f | *c*f)
_filedir
return 0
;;
--
1.7.4.1
Information forwarded
to debian-bugs-dist@lists.debian.org, Bash Completion Maintainers <bash-completion-devel@lists.alioth.debian.org>:
Bug#618734; Package bash-completion.
(Fri, 18 Mar 2011 02:57:03 GMT) (full text, mbox, link).
Acknowledgement sent
to Jonathan Nieder <jrnieder@gmail.com>:
Extra info received and forwarded to list. Copy sent to Bash Completion Maintainers <bash-completion-devel@lists.alioth.debian.org>.
(Fri, 18 Mar 2011 02:57:03 GMT) (full text, mbox, link).
Message #48 received at 618734@bugs.debian.org (full text, mbox, reply):
Jonathan Nieder wrote:
> * "tar -rjf <TAB>" completes arbitrary files instead of just
> bzip2 files;
>
> * the pattern "tar --compare <TAB>" triggers this case by
> accident; similarly, "tar --diff <TAB>" triggers the -f
> case by accident.
For "--compare" read "--comparef". ;-) The above two notes hint at
something probably worth addressing, but not so relevant for this
bug/patch. So please feel free to pretend I presented the patch
above as ready for application --- it very well might be.
Sorry for the noise and thanks again for the help.
Good night,
Jonathan
Information forwarded
to debian-bugs-dist@lists.debian.org, Bash Completion Maintainers <bash-completion-devel@lists.alioth.debian.org>:
Bug#618734; Package bash-completion.
(Sun, 20 Mar 2011 16:48:02 GMT) (full text, mbox, link).
Acknowledgement sent
to Ville Skyttä <ville.skytta@iki.fi>:
Extra info received and forwarded to list. Copy sent to Bash Completion Maintainers <bash-completion-devel@lists.alioth.debian.org>.
(Sun, 20 Mar 2011 16:48:02 GMT) (full text, mbox, link).
Message #53 received at 618734@bugs.debian.org (full text, mbox, reply):
Upstream git now has some consistency and other improvements in this area:
http://git.debian.org/?p=bash-completion/bash-completion.git;a=commitdiff;h=0ae464e5802855c9049d128a37e0de91b564c8b6
http://git.debian.org/?p=bash-completion/bash-completion.git;a=commitdiff;h=f973eb043ced563230eb3e3f8634aa2d42ba0258
Added tag(s) fixed-upstream.
Request was from David Paleino <dapal@debian.org>
to control@bugs.debian.org.
(Sun, 20 Mar 2011 17:03:08 GMT) (full text, mbox, link).
Information forwarded
to debian-bugs-dist@lists.debian.org, Bash Completion Maintainers <bash-completion-devel@lists.alioth.debian.org>:
Bug#618734; Package bash-completion.
(Sun, 27 Mar 2011 06:09:03 GMT) (full text, mbox, link).
Acknowledgement sent
to Jonathan Nieder <jrnieder@gmail.com>:
Extra info received and forwarded to list. Copy sent to Bash Completion Maintainers <bash-completion-devel@lists.alioth.debian.org>.
(Sun, 27 Mar 2011 06:09:03 GMT) (full text, mbox, link).
Message #60 received at 618734@bugs.debian.org (full text, mbox, reply):
Ville Skyttä wrote:
> Upstream git now has some consistency and other improvements in this area:
What do you think of Adam's suggestion that "tar cf", unlike "tar rf",
shouldn't look for existing .tar files at all?
In practice, commit 14fc9f29 (If _filedir 'ext' returns nothing, just
fallback to generic file completion, 2011-03-20) would mostly take
care of the use case I suspect, so this is mostly a question about
principles. Your patches definitely improve things regardless;
thanks. :)
Message sent on
to Adam Nielsen <adam.nielsen@uq.edu.au>:
Bug#618734.
(Sun, 27 Mar 2011 06:09:05 GMT) (full text, mbox, link).
Information forwarded
to debian-bugs-dist@lists.debian.org, Bash Completion Maintainers <bash-completion-devel@lists.alioth.debian.org>:
Bug#618734; Package bash-completion.
(Sun, 27 Mar 2011 21:15:10 GMT) (full text, mbox, link).
Acknowledgement sent
to Ville Skyttä <ville.skytta@iki.fi>:
Extra info received and forwarded to list. Copy sent to Bash Completion Maintainers <bash-completion-devel@lists.alioth.debian.org>.
(Sun, 27 Mar 2011 21:15:10 GMT) (full text, mbox, link).
Message #68 received at 618734@bugs.debian.org (full text, mbox, reply):
On 03/27/2011 09:04 AM, Jonathan Nieder wrote:
>
> What do you think of Adam's suggestion that "tar cf", unlike "tar rf",
> shouldn't look for existing .tar files at all?
My personal opinion is that looking for existing tar files with "c" is a
good thing. I use that behavior regularly to overwrite existing tars.
> In practice, commit 14fc9f29 (If _filedir 'ext' returns nothing, just
> fallback to generic file completion, 2011-03-20) [...]
I have some reservations about that patch, and will post to the bash
completion mailing list about it soon.
Message sent on
to Adam Nielsen <adam.nielsen@uq.edu.au>:
Bug#618734.
(Sun, 27 Mar 2011 21:15:15 GMT) (full text, mbox, link).
Added tag(s) confirmed and pending.
Request was from David Paleino <dapal@debian.org>
to control@bugs.debian.org.
(Thu, 03 Nov 2011 12:06:03 GMT) (full text, mbox, link).
Reply sent
to David Paleino <dapal@debian.org>:
You have taken responsibility.
(Thu, 03 Nov 2011 12:24:30 GMT) (full text, mbox, link).
Notification sent
to Adam Nielsen <adam.nielsen@uq.edu.au>:
Bug acknowledged by developer.
(Thu, 03 Nov 2011 12:24:38 GMT) (full text, mbox, link).
Message #78 received at 618734-close@bugs.debian.org (full text, mbox, reply):
Source: bash-completion
Source-Version: 1:1.90-1
We believe that the bug you reported is fixed in the latest version of
bash-completion, which is due to be installed in the Debian FTP archive:
bash-completion_1.90-1.debian.tar.gz
to main/b/bash-completion/bash-completion_1.90-1.debian.tar.gz
bash-completion_1.90-1.dsc
to main/b/bash-completion/bash-completion_1.90-1.dsc
bash-completion_1.90-1_all.deb
to main/b/bash-completion/bash-completion_1.90-1_all.deb
bash-completion_1.90.orig.tar.bz2
to main/b/bash-completion/bash-completion_1.90.orig.tar.bz2
A summary of the changes between this version and the previous one is
attached.
Thank you for reporting the bug, which will now be closed. If you
have further comments please address them to 618734@bugs.debian.org,
and the maintainer will reopen the bug report if appropriate.
Debian distribution maintenance software
pp.
David Paleino <dapal@debian.org> (supplier of updated bash-completion package)
(This message was generated automatically at their request; if you
believe that there is a problem with it please contact the archive
administrators by mailing ftpmaster@debian.org)
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Format: 1.8
Date: Thu, 03 Nov 2011 13:03:51 +0100
Source: bash-completion
Binary: bash-completion
Architecture: source all
Version: 1:1.90-1
Distribution: experimental
Urgency: low
Maintainer: Bash Completion Maintainers <bash-completion-devel@lists.alioth.debian.org>
Changed-By: David Paleino <dapal@debian.org>
Description:
bash-completion - programmable completion for the bash shell
Closes: 577933 593835 604393 615134 618734 619014 622383 623680 625234 642526
Changes:
bash-completion (1:1.90-1) experimental; urgency=low
.
* bash-completion 2 preview: dynamic loading of completions
- optionally fallback to generic file completion if _filedir
returns nothing (Closes: #619014, LP: #533985)
- various fixes (Closes: #622383)
- apt: add 'download' to subcommands (Closes: #625234, LP: #720541)
- aptitude: add 'versions' command (Closes: #604393)
- dpkg-query: use the 'dpkg' completion (Closes: #642526)
- lintian: remove --unpack-level (Closes: #623680)
- rrdtool: complete filenames after commands (Closes: #577933)
- provide profile.d hook for per user disabling of bash_completion
(Closes: #593835)
- mutt: support tildes when recursively sourcing muttrc files
(Closes: #615134)
- tar: improve tar *[cr]*f completions (Closes: #618734)
* More checks in update-bash-completion: avoid unnecessary
sourcing of completion if symlink already exists
* Add message for users before they report a bug (debian/bug-presubj),
I'm kind of fed-up with bugs caused by acroread.sh :/
* Removed patches merged upstream
* Drop trigger-based completion loading
* Standards-Version bump to 3.9.2, no changes needed
Checksums-Sha1:
748b796aa5f70f17b2c3ec449dd7a8d66933bb8a 1394 bash-completion_1.90-1.dsc
aa1a1f4e34bff93f8227c1a200de310a04a21e86 228640 bash-completion_1.90.orig.tar.bz2
e5deb79d3aa91dff60baee0d4f1675fc5fd6ea2b 13057 bash-completion_1.90-1.debian.tar.gz
64a6a900971b2bc4d6d8706345f3037c81b85762 179058 bash-completion_1.90-1_all.deb
Checksums-Sha256:
78c827e512975c885b3cb09a2a50676d2f8bcd3c81b712a18035b288bfa0d92a 1394 bash-completion_1.90-1.dsc
293084b7584e89734002a49688ca9aea2bab16ca4750b30f66b62a373750c41c 228640 bash-completion_1.90.orig.tar.bz2
06975fe1a3291aadad7489d381183bcc64731f6b256647b8a5e277bb16ae97a8 13057 bash-completion_1.90-1.debian.tar.gz
4f78b12ab95b5ed24c8fe63e26d9f1635f189ccb9c7f7b503af101c0dfe92fe0 179058 bash-completion_1.90-1_all.deb
Files:
adf23b480b86c55d9e337258164785a0 1394 shells standard bash-completion_1.90-1.dsc
82635839d83074eba923822fd584490c 228640 shells standard bash-completion_1.90.orig.tar.bz2
ab9637c3c2aea423af97932b19bdc832 13057 shells standard bash-completion_1.90-1.debian.tar.gz
e43e91227a8d739a095577d51a1e0b78 179058 shells standard bash-completion_1.90-1_all.deb
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (GNU/Linux)
iEYEARECAAYFAk6yhD8ACgkQ5qqQFxOSsXQUSACfdui594rcT9CfiI3CyWfl60xa
UpMAoKbynog3IF+e2EOHcrFL6VBNbHPO
=Wi2f
-----END PGP SIGNATURE-----
Bug archived.
Request was from Debbugs Internal Request <owner@bugs.debian.org>
to internal_control@bugs.debian.org.
(Sun, 05 Feb 2012 07:37:00 GMT) (full text, mbox, link).
Send a report that this bug log contains spam.
Debian bug tracking system administrator <owner@bugs.debian.org>.
Last modified:
Sun Jul 2 09:49:39 2023;
Machine Name:
bembo
Debian Bug tracking system
Debbugs is free software and licensed under the terms of the GNU
Public License version 2. The current version can be obtained
from https://bugs.debian.org/debbugs-source/.
Copyright © 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson,
2005-2017 Don Armstrong, and many other contributors.