Results 1 to 9 of 9

Thread: bash commands' auto-complete not working for some apps

  1. #1
    Join Date
    Sep 2008
    Beans
    12

    Angry bash commands' auto-complete not working for some apps

    Hiya,
    I've got an annoying problem that 'man' and some other commands do not auto-complete (via TAB).

    e.g. typing: man rsyn (TAB, TAB, TAB, etc)

    will not auto-complete to 'man rsync'

    however, if i 'sudo -s' & then try the above, 'man' auto-completes everytime.

    Any suggestions?

    (Directories always auto-complete successfully)

    My ~/.bashrc contains:
    Code:
    # enable bash completion in interactive shells
    if [ -f /etc/bash_completion ] && ! shopt -oq posix; then
        . /etc/bash_completion
    fi
    Thanx

    ^_^

  2. #2
    Join Date
    Sep 2008
    Beans
    12

    Re: bash commands' auto-complete not working for some apps

    Anyone???

    I would really appreciate it.

  3. #3
    Join Date
    Jan 2008
    Location
    Manchester UK
    Beans
    13,658
    Distro
    Ubuntu

    Re: bash commands' auto-complete not working for some apps

    Are you sure you are using bash? Not sh.

    Have you created your user in an unconventional way?

    If you type
    Code:
    cat /etc/passwd
    is your user`s path /bin/bash?

  4. #4
    Join Date
    Sep 2008
    Beans
    12

    Re: bash commands' auto-complete not working for some apps

    Hiya,

    I'm running /bin/bash (not sh) - I've checked.

    I have been using this user for many months - this problem just randomly occurred a few weeks ago.

    It's really annoying for me, as I read man pages a LOT

    Thanx

  5. #5
    Join Date
    Jan 2008
    Location
    Manchester UK
    Beans
    13,658
    Distro
    Ubuntu

    Re: bash commands' auto-complete not working for some apps

    Well I`m stumped, if anything occurs to me though........

  6. #6
    Join Date
    Jan 2008
    Location
    Manchester UK
    Beans
    13,658
    Distro
    Ubuntu

    Re: bash commands' auto-complete not working for some apps

    The default .bashrc in /etc/skel is the same as yours
    Code:
    if [ -f /etc/bash_completion ] && ! shopt -oq posix; then
        . /etc/bash_completion
    fi
    However mine just says

    Code:
    if [ -f /etc/bash_completion ]; then
        . /etc/bash_completion
    fi
    However, I`ve had my /home directory since 7.10 so something has obviously changed.

    Do you have a seperate home and have you downgraded, say from 9.10 to 8.04 LTS

    If I add the extra bit, and restart bash, tab completion still works, I`m just wondering weather this is true the other way.

    Clutching at straws here.

  7. #7
    Join Date
    Feb 2008
    Location
    Atlanta
    Beans
    78
    Distro
    Ubuntu 9.10 Karmic Koala

    Re: bash commands' auto-complete not working for some apps

    Well I commented

    Code:
    if [ -f /etc/bash_completion ] && ! shopt -oq posix; then
        . /etc/bash_completion
    fi
    out in my .bashrc with hashes and now tab completion is working like it used to.
    Windows has and has always had zero TCO, because Microsoft owns it and you never do. You may be charged for the joy of possibly being allowed to use Windows, if you're a good boy or girl. But it's really totally free of ownership costs.

  8. #8
    Join Date
    Sep 2008
    Beans
    12

    Red face Re: bash commands' auto-complete not working for some apps

    Okay, I usually only restart about once every 1-2 months!, however have had to restart a lot in the past few days due to other things I've been doing, and this issue did not fix itself (I mean why would it?). However, I just restarted my system again today and it's all working as it should for some stupid reason.

    I'm really sorry about this, and still have no idea why it went funny. I really appreciate all the replies.
    I've always hated stumbling across a support thread only to follow it and read 'fixed after restarting' at the end - I guess I've just done that myself...

    WOW

  9. #9
    Join Date
    Jun 2011
    Beans
    1

    Re: bash commands' auto-complete not working for some apps

    If others are experiencing problems with auto-completion,
    In the bash prompt, you can run "set -x" then attempt the auto-completion via <command> <TAB>.

    This will show you the auto-completion commands that the shell is executing in your terminal.

    Execute "set +x" to get the shell out of debug mode.

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •