Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!

Remove case sensitivity from auto-completion UNIX
For everyone out there that is bothered by the case-sensitivity of auto-completion in the Terminal, you have an option. Just open a terminal window and type:
  set complete = enhance
Alternatively, you can put this command in your .tcshrc file (if you've created one in your home directory). This setting seems to be saved somewhere, although I'm not sure where. Therefore, once you entered it (or put it in you .tcshrc file), it should stick even if you delete that line from .tcshrc at a later time.

If you're not sure what I'm referring to, try the following (before setting autocomplete to enhanced mode). Go into the terminal and type:
  cd /app [and then hit tab]
The autocomplete won't work, as the Applications folder is capitalized (or at least it is on the default install). Now try the following:
  cd /App [and then hit tab]
This should pop out to:
  cd /Applications
After you've tweaked the 'complete' setting, it will ignore the case of your entry and autocomplete based on the character(s) alone, regardless of case.

From playing around with it, it seems that typing:
  set complete
with no modifiers will bring back the case-sensitivity, although I haven't tested this thoroughly.

Panther broken!
  • Currently 1.67 / 5
  You rated: 2 / 5 (3 votes cast)

Remove case sensitivity from auto-completion | 13 comments | Create New Account
Click here to return to the 'Remove case sensitivity from auto-completion' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
I always thought this was broken...
Authored by: Alex281 on Feb 07, '02 11:23:53PM

I seriously always thought I had hacked something that broke auto complete! Thank You! Works beautifully now, and I found it worked fine before I just had no idea it was case sensitive.

[ Reply to This | # ]
This is a feature of tcsh
Authored by: datawrangler on Feb 08, '02 10:12:01AM

For the sake of accuracy, it should be pointed out that 'complete' is an environmental variable employed by the tcsh shell. It is not a feature of the Terminal app. Users of other shells will not see the same results. The 'set' command is a builtin command provided by the tcsh shell for manipulating environmental variables. HTH

[ Reply to This | # ]
This is a feature of tcsh
Authored by: jmb on Feb 08, '02 10:24:52AM

datawrangler is correct. I neglected to make this clear. The flip side is that this should work on any unix machine on which you are using tcsh.


[ Reply to This | # ]
bash completion ignore case
Authored by: mervTormel on Feb 08, '02 04:58:40PM

and for bash, there is a 'readline' variable you can set in your ~/.inputrc :

% cat .inputrc
set completion-ignore-case On

[ Reply to This | # ]
bash completion ignore case
Authored by: Anonymous on Feb 09, '02 02:20:45AM

Thanks for the bash solution.. this is very cool.

[ Reply to This | # ]
Authored by: Titanium Man on Feb 08, '02 11:01:36PM

I put

set complete=enhance

in this file ~/Library/init/tcsh/environment.mine. Is that the right thing to do? It works, but I just want to make sure I'm not setting my system up for imminent meltdown.

[ Reply to This | # ]
Authored by: _merlin on Feb 09, '02 10:03:30AM

Yes, that's fine. There are about twenty different places you can put the command and have it work correctly. The ones to avoid messing with are all in /etc and /usr, anything inside your home directory should be safe.

[ Reply to This | # ]
Authored by: Titanium Man on Feb 10, '02 01:20:39AM


[ Reply to This | # ]
Authored by: ebow on Feb 09, '02 11:19:00AM
I tried putting it in environment.mine and it's not working. I have commands successfully working from ~/Library/init/tcsh/aliases.mine and path, and *maybe* from rc but this isn't. Even with a source .tcshrc which should cascade nicely thru /usr/share/init/tcsh/rc to my own settings. Ohh, I'll head over to the forums to see if there's anything there.

[ Reply to This | # ]
Authored by: ebow on Feb 09, '02 11:22:23AM
I should add that just typing set complete=enhance does work...

[ Reply to This | # ]
Authored by: Titanium Man on Feb 10, '02 01:22:59AM

I'm not sure if this is necessary or will work, but did you rehash after adding it to your file? (You probably know more about this than I do so sorry if I'm suggesting something ridiculous)

[ Reply to This | # ]
Not only that...
Authored by: MacDude on Feb 13, '02 08:50:29PM

After reading the manpage for `set' I found:

If the complete shell variable is set to `enhance', com-
pletion 1) ignores case and 2) considers periods, hyphens
and underscores (`.', `-' and `_') to be word separators
and hyphens and underscores to be equivalent.

So, it's actually rather useful. They go on to talk various examples of using these `variables'.


[ Reply to This | # ]
Remove case sensitivity from auto-completion
Authored by: helicine on Nov 16, '03 10:56:00AM
this does work in pather, you just need to be using tcsh (the default shell prior to 10.3) and not bash (the default shell for 10.3)

[ Reply to This | # ]