OSX Terminal Fun VI: Enhanced Completion

term_icon.jpgThe basic config for tcsh includes auto-completion using the tab key (like using escape for bash), i.e. if from the terminal you type:

	% cd ~/Lib <tab>

Don't actually type <tab>, hit the tab key on your keyboard. If you hit the tab key with "Lib" spelled, the shell looks under "~/" for anything starting with "Lib" and sees the "Library" directory and fills it in for you. If there is "Library" and "Librato", hitting the tab key twice will show you all the choices.

But if you typed:

	% cd ~/lib <tab>

You wouldn't see anything- as while HFS+ is case-insensitive (yet preserves case) the unix tools that ship with OSX are well, from the unix world and assume if you type "lib" that you want "lib" and not "Lib". This can get annoying straight quick for a whole host of reasons, but luckily you can add a directive to the rc.mine file we setup earlier though to enhance the autocompletion.

Type:

	% pico -w ~/Library/init/tcsh/rc.mine

And on the second line (under the set prompt line code) cut and paste the below command:

set complete = enhance

Create a new shell, and type:

	% cd ~/lib

And you'll instead of getting nothing now you will automatically get:

	% cd ~/Library/

Pretty nifty, eh?

yummy alcohol posted button Posted by drunkenbatman
    April 25, 2003, at 05:05 AM


Comments (4)




Post a comment



Anonymous comments are allowed, but please enter something for a name.

And do endeavor to appear sane.









Remember personal info?