Auto tab completion

Auto tab completion

Post by Be » Fri, 03 May 2002 20:22:48



HI all,

For some reason auto tab completion has stopped working in my xterm
(in KDE and Gnome on mandrake 8.2).  Instead of auto completing the
file name in the current directory when i hit the tab key, it gives me
a list of all files on my system starting with those characters.
Funny thing is it works fine when i'm not in X and it completes
directories just fine.  Here's an example of what i get:


bencv.txt  index.html

i586-mandrake-linux-gnu-c++  ikon2icon
i586-mandrake-linux-gnu-g++  ilbmtoppm
i586-mandrake-linux-gnu-gcc  imagetops
ical2vcal                    imake
iceauth                      imgtoppm
icehelp-light                import

b2m                            bonobo-moniker-archiver
background-properties-capplet  bonobo-moniker-gunzip
background-properties-control  bonobo-moniker-http
basename                       bonobo-moniker-xmldb
bash                           bonobo-sample-canvas-item
bash2                          bonobo-sample-controls
bashbug                        bonobo-sample-hello
batch                          bonobo-sample-paint
battery_applet                 bonobo-selector
bdfindex                       bonobo-text-plain
bdftopcf                       break
bdftops                        brushtopbm
bdftruncate.pl                 bug-buddy
beforelight                    buildhash
bg                             builtin
bind                           bunzip2
bioradtopgm                    byteutil.pl
bitmap                         bzcat
bmptoppm                       bzgrep
bmtoa                          bzip2
bonobo-application-x-mines     bzip2recover
bonobo-audio-ulaw              bzless
bonobo-echo                    bzme

Thanks for your help.

Ben

 
 
 

Auto tab completion

Post by Steve Kirkendal » Sat, 04 May 2002 08:57:40



> HI all,

> For some reason auto tab completion has stopped working in my xterm
> (in KDE and Gnome on mandrake 8.2).  Instead of auto completing the
> file name in the current directory when i hit the tab key, it gives me
> a list of all files on my system starting with those characters.
> Funny thing is it works fine when i'm not in X and it completes
> directories just fine.  Here's an example of what i get:


> bencv.txt  index.html

> i586-mandrake-linux-gnu-c++  ikon2icon
> i586-mandrake-linux-gnu-g++  ilbmtoppm
> i586-mandrake-linux-gnu-gcc  imagetops
> ical2vcal                    imake
> iceauth                      imgtoppm
> icehelp-light                import

It's actually the bash shell that peforms name completion, and bash is
smart enough to complete more than just *FILE* names.  In particular,
bash expects the first word of a command line to be the command name
so if you hit <Tab> while typing in the first word, bash will try to
complete a *COMMAND* name or *DIRECTORY* name.  (Directories are included because you could be trying to run a command in that directory.)

Try typing "ls i<Tab>".  In that context, bash will expect a file name,
so it should expand "i" to "index.html" as you expect.

 
 
 

Auto tab completion

Post by Lee Sau Da » Sat, 04 May 2002 16:04:37


    Ben> HI all, For some reason auto tab completion has stopped
    Ben> working in my xterm (in KDE and Gnome on mandrake 8.2).
    Ben> Instead of auto completing the file name in the current
    Ben> directory when i hit the tab key, it gives me a list of all
    Ben> files on my system starting with those characters.  Funny
    Ben> thing is it works fine when i'm not in X and it completes
    Ben> directories just fine.  Here's an example of what i get:


    Ben> bencv.txt index.html

    Ben> i586-mandrake-linux-gnu-c++ ikon2icon
    Ben> i586-mandrake-linux-gnu-g++ ilbmtoppm
...

Are you sure the behaviour changed?  Or just what you tried to do changed?

Bash is assuming that you're typing a command (because it is the first
word on  the command  line) and hence  lists all matching  commands on
your PATH.  (And definitely not all files on your SYSTEM.)

Try:

And see what happens.

--


Home page: http://www.informatik.uni-freiburg.de/~danlee

 
 
 

Auto tab completion

Post by Dave Bro » Tue, 07 May 2002 15:43:56



> For some reason auto tab completion has stopped working in my xterm
> (in KDE and Gnome on mandrake 8.2).  Instead of auto completing the
> file name in the current directory when i hit the tab key, it gives me
> a list of all files on my system starting with those characters.
> Funny thing is it works fine when i'm not in X and it completes
> directories just fine.  Here's an example of what i get:
> ...

The reason for this is a setting you're getting from somewhere for
"readline" action.  (man bash and readline).  

If you have  ~/.inputrc, then you should avoid a system inputrc
(typically /etc/inputrc).  If there's a setting in the inputrc file:

  set show-all-if-ambiguous on

the bash tab-completion will behave as you describe.  By default, it
should be off, so something's turning it on.  (You can also have
a ~/.inputrc be empty, and it will avoid the "crap" that some distros
put in /etc/inputrc.  (Coming from ksh, I'm a "set editing-mode vi" kinda
guy.)

--
Dave Brown  Austin, TX

 
 
 

1. Auto tab completion

HI all,

For some reason auto tab completion has stopped working in my xterm
(in KDE and Gnome on mandrake 8.2).  Instead of auto completing the
file name in the current directory when i hit the tab key, it gives me
a list of all files on my system starting with those characters.
Funny thing is it works fine when i'm not in X and it completes
directories just fine.  Here's an example of what i get:


bencv.txt  index.html

i586-mandrake-linux-gnu-c++  ikon2icon
i586-mandrake-linux-gnu-g++  ilbmtoppm
i586-mandrake-linux-gnu-gcc  imagetops
ical2vcal                    imake
iceauth                      imgtoppm
icehelp-light                import

b2m                            bonobo-moniker-archiver
background-properties-capplet  bonobo-moniker-gunzip
background-properties-control  bonobo-moniker-http
basename                       bonobo-moniker-xmldb
bash                           bonobo-sample-canvas-item
bash2                          bonobo-sample-controls
bashbug                        bonobo-sample-hello
batch                          bonobo-sample-paint
battery_applet                 bonobo-selector
bdfindex                       bonobo-text-plain
bdftopcf                       break
bdftops                        brushtopbm
bdftruncate.pl                 bug-buddy
beforelight                    buildhash
bg                             builtin
bind                           bunzip2
bioradtopgm                    byteutil.pl
bitmap                         bzcat
bmptoppm                       bzgrep
bmtoa                          bzip2
bonobo-application-x-mines     bzip2recover
bonobo-audio-ulaw              bzless
bonobo-echo                    bzme

Thanks for your help.

Ben

2. I am off to bed

3. Script GURUs - a tab is a tab is a tab

4. Konqueror probs w/Flash, Javascripts and others

5. Tab Completion showing files that Dont Exist

6. DEC PCMCIA ethernet card support?

7. Tab file completion in ksh?

8. SB PCI 128 MIDI and other issues...

9. Filname Completion with TAB in ksh

10. Q: ksh: how can I use TAB key to do "file name completion"

11. Tab Completion showing files that Dont Exist

12. Help with bash tab completion?

13. Bash, CDPATH & Tab completion