Comments (14)
Works for me. Although I suppose it's kind of debatable if "t" should complete filenames in archives in the first place.
Need more info about your environment (which OS, which tar, which bash), and see also https://github.com/scop/bash-completion#troubleshooting
from bash-completion.
This is Slackware -current (development leading to 14.2).
[rworkman@liberty ~]$ ls -1 /var/log/packages/{bash-,tar-}
/var/log/packages/bash-4.3.042-x86_64-1
/var/log/packages/bash-completion-2.2-noarch-1
/var/log/packages/tar-1.28-x86_64-1
For the sake of clarity, I don't care about completing filenames inside the archive - that's not what this is about. This is about completing the actual file name.
I just downgraded to bash-completion-2.1 and both "tar tvf" and "tar xvf" will tab-complete the name of the tarfile now.
from bash-completion.
Thanks for the clarification. Something strange is going on; in my basic setup I cannot reproduce, and in another I can, but so far I don't know what makes the behavior different between them. We also have a test suite item for this, and it passes in Travis (the test suite is otherwise unstable, but the tar tests pass).
@praiskup, any ideas? The setup where I can reproduce this is current rawhide mock chroot, everywhere else it appears to work just fine for me.
from bash-completion.
Not reproducible in fedora-rawhide-x86_64 mock chroot working in /tmp. Both
file name completion and tarball contents are completed fine. My native F23 is
fine too.
What are the contents of your working directory? My is:
<mock-chroot>sh-4.3# ls -alh
total 4.0K
drwxrwxrwt. 9 root root 200 Mar 16 07:08 .
dr-xr-xr-x. 18 root root 460 Mar 16 07:04 ..
drwxrwxr-x. 2 root root 40 Mar 16 07:03 ccache
drwxrwxrwt. 2 root root 40 Mar 16 07:04 .font-unix
drwxrwxrwt. 2 root root 40 Mar 16 07:04 .ICE-unix
drwxr-xr-x. 2 root root 100 Mar 16 07:06 testdir
-rw-r--r--. 1 root root 168 Mar 16 07:06 test.tar.gz
drwxrwxrwt. 2 root root 40 Mar 16 07:04 .Test-unix
drwxrwxrwt. 2 root root 40 Mar 16 07:04 .X11-unix
drwxrwxrwt. 2 root root 40 Mar 16 07:04 .XIM-unix
from bash-completion.
Don't you use $TAR_OPTIONS
?
from bash-completion.
My working dir contents:
<mock-chroot>sh-4.3# ls -la
total 20
drwxrwxrwt 5 root root 4096 Mar 16 10:42 .
dr-xr-xr-x 18 root root 4096 Mar 15 19:35 ..
drwxrwsr-x 19 mockbuild 1000 4096 Mar 9 07:42 ccache
-rw-r--r-- 1 root root 0 Mar 15 19:45 foo.tar.bz2
-rw-r--r-- 1 root root 0 Mar 15 19:40 foo.tar.gz
drwxrwxr-x 3 root root 4096 Mar 16 10:39 tmpjwNSev
drwxrwsr-x 3 root mockbuild 4096 Mar 1 22:56 tmppc7lsyyt
$TAR_OPTIONS
is not set. set -x
debug output for attempted tar xvf <TAB>
(which produces no completions) is in https://gist.github.com/scop/745c19fe9d1909a295e2 . Somehow it seems to end up trying to complete contents of a tarball that has not even been given as args. (This is with vanilla 2.2, the /tmp/jetel stuff has been cleaned up in master afterwards.)
from bash-completion.
Your set -x
output starts to differ from my on:
[[ -A, --catenate, --concatenate append tar files to an archive =~ ^[[:blank:]]{1,10}(((,[[:blank:]])?(--?([][a-zA-Z0-9?-=]+))(,[[:space:]])?)+).*$ ]]
My [[
command returns true and goes to than
branch, your returns false.
from bash-completion.
jetel stuff has been cleaned up in master afterwards
Sorry for this :(.
from bash-completion.
This seems like the code is not able to parse tar --help
on your box, because of wrong?
regexp. Can you better debug that? I am unable to reproduce.
+ rpm -q bash
bash-4.3.42-4.fc24.x86_64
from bash-completion.
I've reduced the issue to this:
[[ -A =~ ^-[A?-=] ]] && echo hello
In my rawhide chroot, the regex does not match and this outputs nothing. On the F-23, CentOS, and Ubuntu boxes I tried, it matches and outputs hello
. My rawhide chroot should be pretty much exactly the same as yours, so I have no idea why the behavior differs.
Anyway, I can think of a possible issue in that regex: maybe the ?-=
gets treated as a character range from ?
to =
. At least changing it to ?=-
produces consistent (matching) results in all setups I've tried.
I've pushed that change as 0b7189d; @rworkman, could you try out if making that change fixes it for you and report back?
from bash-completion.
(BTW no matter whether ?-=
gets treated as a character range or not, I think my reduced test case should have matched, because the explicit A
is there anyway. Maybe it breaks the matching somehow else.)
from bash-completion.
@scop, I would file a bug against Fedora's bash, but I'm not able to reproduce this.
Will you do this? FWIW, I run mock on native fedora-23-x86_64
box.
from bash-completion.
Confirmed that 0b7189d fixes this; thanks much, guys! :-)
from bash-completion.
Fedora bash bug report filed, https://bugzilla.redhat.com/show_bug.cgi?id=1318277
Thanks to both for help with debugging this!
from bash-completion.
Related Issues (20)
- Hard to find where to report bugs HOT 2
- Latest CHANGELOG.md starts at `## 2.11...` and earlier HOT 2
- Redirection moved to the front wrongly affects completions HOT 2
- Gentoo update to 2.14 fails due to QA notice HOT 3
- tar file completion not working as expected under various option combinations HOT 2
- Enable .java Filename Completion for java Command HOT 2
- GCC tests fail on non-x86 platforms HOT 1
- CDPATH autocomplete is not working HOT 5
- 000_bash_completion_compat.bash sourced last in some locales HOT 1
- bash: _comp_initialize: command not found HOT 2
- [Regression] make autocompletion skips install HOT 3
- Native bash-completion 2 loader using complete -D HOT 5
- Completing a relative path with a space and softlinks inside, turns it absolute (which breaks creating relative softlinks) HOT 1
- Completions for 'alternatives' command are broken HOT 1
- xspec is ignored when Bash option `force_fignore` is unset HOT 5
- [2.14.0] rsync path completion fails if a folder name have a space
- Completions are not loaded in Linux+Homebrew HOT 3
- Feature request: generalized implementation of `_comp_command_offset` HOT 12
- File ~/.bash_completion no longer working after update to 2.14. HOT 2
- Hi, i need help regarding bash-completion. HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from bash-completion.