bash-completion doesn't work well with the mount command. If I type "mount <tab>", it sits there in a seeming infinite loop looking for a completion. If I type "mount /mnt/flo<tab>", it completes it with: mount ^[\[01\;31m/mnt/flo^[\[00mppy It is probably the completion code in /etc/bash_completion that is incorrect. There's a chance the 2nd problem is caused by my keyboard, since I used to have a keyboard with windows keys and now I have one without windows keys, and stuff like that was happening before I fixed my xorg.conf. But now it's only mount completion that causes the weird characters. I realize that for the first problem it might really take a long time to calculate the completion. But I don't see why it should take so long since it's apparently just reading /etc/fstab and looking for matches there. Reproducible: Always Steps to Reproduce: 1.emerge bash-completion 2.Type "mount " followed by optionally some characters followed by TAB Actual Results: A seemingly infinite delay or a completion with weird characters inserted, depending on the extra characters typed. Expected Results: Completed what I typed based on the possible things that can be mounted. adam>emerge info Portage 2.0.51.19 (default-linux/x86/2005.0, gcc-3.3.5-20050130, glibc-2.3.4.20041102-r1, 2.6.10-gentoo-r6 i686) ================================================================= System uname: 2.6.10-gentoo-r6 i686 AMD Athlon(tm) XP 2500+ Gentoo Base System version 1.4.16 Python: dev-lang/python-2.3.4-r1 [2.3.4 (#1, Feb 20 2005, 18:50:05)] ccache version 2.3 [enabled] dev-lang/python: 2.3.4-r1 sys-devel/autoconf: 2.59-r6, 2.13 sys-devel/automake: 1.7.9-r1, 1.8.5-r3, 1.5, 1.4_p6, 1.6.3, 1.9.4 sys-devel/binutils: 2.15.92.0.2-r7 sys-devel/libtool: 1.5.10-r4 virtual/os-headers: 2.6.8.1-r2 ACCEPT_KEYWORDS="x86" AUTOCLEAN="yes" CFLAGS="-O2 -march=athlon-xp -pipe" CHOST="i686-pc-linux-gnu" CONFIG_PROTECT="/etc /usr/kde/2/share/config /usr/kde/3.3/env /usr/kde/3.3/share/config /usr/kde/3.3/shutdown /usr/kde/3/share/config /usr/lib/X11/xkb /usr/share/config /usr/share/texmf/dvipdfm/config/ /usr/share/texmf/dvips/config/ /usr/share/texmf/tex/generic/config/ /usr/share/texmf/tex/platex/config/ /usr/share/texmf/xdvi/ /var/qmail/control" CONFIG_PROTECT_MASK="/etc/gconf /etc/terminfo /etc/env.d" CXXFLAGS="-O2 -march=athlon-xp -pipe" DISTDIR="/usr/portage/distfiles" FEATURES="autoaddcvs autoconfig ccache distlocks nostrip sandbox sfperms strict userpriv usersandbox" GENTOO_MIRRORS="http://adelie.polymtl.ca/ http://gentoo.mirrors.pair.com/ ftp://gentoo.mirrors.pair.com/" MAKEOPTS="-j2" PKGDIR="/usr/portage/packages" PORTAGE_TMPDIR="/var/tmp" PORTDIR="/usr/portage" PORTDIR_OVERLAY="/usr/local/portage" SYNC="rsync://rsync.gentoo.org/gentoo-portage" USE="x86 3dnow X alsa arts avi bitmap-fonts cdr crypt cscope cups curl dvd emboss encode fam flac foomaticdb gdbm gif gpm gtk2 imagemagick imlib jpeg kde kdeenablefinal libg++ libwww mmx mp3 mpeg ncurses ogg oggvorbis opengl pdflib perl png ppds qt quicktime readline scanner sdl sqlite ssl tcpd tetex tiff truetype truetype-fonts trusted type1-fonts usb v4l vorbis xml2 xmms xprint xv zlib" Unset: ASFLAGS, CBUILD, CTARGET, LANG, LC_ALL, LDFLAGS, LINGUAS
I can work around it temporarily by adding: complete -r mount to my .bashrc to prevent the special completions for the mount command. But it would still be better if I could use the special completion.
Could you post your fstab please?
adam>cat /etc/fstab # This file is edited by fstab-sync - see 'man fstab-sync' for details # /etc/fstab: static file system information. # $Header: /home/cvsroot/gentoo-src/rc-scripts/etc/fstab,v 1.14 2003/10/13 20:03:38 azarah Exp $ # # noatime turns off atimes for increased performance (atimes normally aren't # needed; notail increases performance of ReiserFS (at the expense of storage # efficiency). It's safe to drop the noatime options if you want and to # switch between notail and tail freely. # <fs> <mountpoint> <type> <opts> <dump/pass> # NOTE: If your BOOT partition is ReiserFS, add the notail option to opts. # NOTE: The next line is critical for boot! none /proc proc defaults 0 0 # glibc 2.2 and above expects tmpfs to be mounted at /dev/shm for # POSIX shared memory (shm_open, shm_unlink). # (tmpfs is a dynamically expandable/shrinkable ramdisk, and will # use almost no memory if not populated with files) # Adding the following line to /etc/fstab should take care of this: none /dev/shm tmpfs defaults 0 0 #It seems like if you put noauto for drives that hold removable media, it prevents them from being #mounted automatically at startup. /dev/hda5 / reiserfs noatime 0 0 /dev/hda6 /home ext3 noatime 0 0 /dev/hda7 swap swap defaults 0 0 /dev/hdc /mnt/cdrom iso9660 noauto,users,ro 0 0 /dev/cdrw /mnt/cdrom2 iso9660 noauto,users,ro 0 0 /dev/fd0 /mnt/floppy vfat,auto noauto,users,sync 0 0 /dev/zipdrive4 /mnt/zip vfat,auto noauto,users,sync 0 0 /dev/camera /mnt/camera vfat noauto,users,sync 0 0 #none /proc/bus/usb usbdevfs defaults 0 0 none /tmp tmpfs defaults 0 0 #just testing this /dev/loop0 /mnt/loop iso9660 noauto,users,ro,loop=/dev/loop0 0 0
hmm.. it really should be working. I saved your fstab as ~/fstab and ran $ awk '! /^[ \t]*#/ {if ($2 ~ /\//) print $2}' /home/ka0ttic/fstab | grep "^/" /proc /dev/shm / /home /mnt/cdrom /mnt/cdrom2 /mnt/floppy /mnt/zip /mnt/camera /tmp /mnt/loop That's what would be executed if you typed "mount /<TAB>". What output do you get? mount completion works fine here...
I got that same output. I'm using bash-completion-20050121-r1, since I don't have the ~x86 keyword set. Maybe you're using a newer version?
Sorry Adam, never saw your response. There are more recent revisions but I get the same results (working) with 20050121-r1. It works for us.