Results 1 to 3 of 3

Thread: bash-completion + mount = failure to complete directories

  1. #1
    Join Date
    Mar 2008
    Location
    UK
    Beans
    145
    Distro
    Ubuntu 10.04 Lucid Lynx

    bash-completion + mount = failure to complete directories

    I've spent some time searching for answers to this and I haven't found much at all. Please feel free to post pointers to other threads that discuss this particular problem, if you find any.

    The problem is that in bash I want to mount an iso file to inspect the contents with the command:
    Code:
    sudo mount myCD.iso CDMount -o loop
    The command works fine, but pressing tab to complete either the iso filename or the CDMount directory does not work. The completion suggestions I get are existing mountpoints which is completely unhelpful. The completion suggestions should include the files and directories in the current directory. This worked with Ubuntu 10.04 and not with 11.04.

    Has anyone else seen this? How did you solve or get round it?

    Thanks,
    John.

  2. #2
    Join Date
    Mar 2008
    Location
    UK
    Beans
    145
    Distro
    Ubuntu 10.04 Lucid Lynx

    Re: bash-completion + mount = failure to complete directories

    No response whatsoever? Quite a few times now my support questions have been met with a wall of silence. The support on these forums is quite poor I have to say. Disappointing.

  3. #3
    Join Date
    Sep 2009
    Location
    Netherlands
    Beans
    115
    Distro
    Kubuntu 14.04 Trusty Tahr

    Re: bash-completion + mount = failure to complete directories

    Ubuntu changed the completion scripts in order to be "more smart". That is, it completes entries from /etc/fstab only. Now, not everyone puts mount points in /etc/fstab and it's just annoying that I cannot complete from /dev/disk/by-label anymore nor loop mounts of .iso files.

    To revert to the old behavior, edit /etc/bash_completion.d/mount and change:
    Code:
    complete -F _mount -o default -o dirnames mount
    to:
    Code:
    complete -F _longopt -o filenames mount
    By doing so, you loose the completions of /etc/fstab, but at least it allows you to complete files and directories.
    Last edited by Lekensteyn; December 5th, 2011 at 06:03 PM.

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
  •