Menu

#3 bash smart path completion broken in WSL Ubuntu

1.0
closed
nobody
None
2022-09-11
2022-09-01
C Drake
No

Without this .bashrc in Ubuntu under WSL, I can type this:-

tar xvfz ~/Dow<tab></tab>

and pressing the <tab> button auto-completes the path I want (which in my case is a symlink), and turns into this all by itself:-</tab>

tar xvfz ~/Downloads/

FYI - this is my symlink:-

`$ dir ~/Downloads

lrwxrwxrwx 1 cnd cnd 27 Aug 30 13:50 /home/cnd/Downloads -> /mnt/c/Users/cnd/Downloads//`

Unfortunately, with this .bashrc active - the tab button no longer does anything for that "tar" command (although it does work OK if I use other commands, like this:-

dir ~/Dow<tab></tab>

...somewhere in whatever smartness understands what the "tar" command is looking for, something in this .bashrc greatness has tripped it up...

I'm away from my office for a few weeks... if this issue is still open when I get back, I'll see if I can find the problem and report back the fix.

Discussion

  • C Drake

    C Drake - 2022-09-01

    obviously I mean just a single tab in there - sorceforge has mangled what I typed and added < /tab > itself...

     
  • Jeffguy

    Jeffguy - 2022-09-02

    I will look into this.

     
  • Jeffguy

    Jeffguy - 2022-09-11

    After poking around, I think the issue might be one of the bash_completion files that get automatically included.

    The bash completion scripts are sourced from:

    • /usr/share/bash-completion/bash_completion
    • /etc/bash_completion
    • ~/bash_completion
    • ~/.local/share/bash_completion
    • ~/.config/bash_completion

    These can be installed from many different places including the main repositories. Some distros have one of these by default.

    I believe your issue might be coming from one of these files above. Perhaps, in the somewhat near future, I can provide an over-ride to skip including these.

    I hope that helps!

     
  • Jeffguy

    Jeffguy - 2022-09-11

    I added a new option to skip bash completion imports. This way you can skip it altogether or manually import your own.

    # If set to true, will not source bash completion scripts
    _SCRIPT_BASH_COMPLETION=false
    

    For more information, see "Environment Variables and Extreme Ultimate .bashrc File Settings" in the "Files" section of this project.

     
  • Jeffguy

    Jeffguy - 2022-09-11
    • status: open --> closed
     

Log in to post a comment.

Auth0 Logo