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

Case insensitive completion in 10.3 UNIX
In Jaguar under tcsh you could set the tab-completion in the terminal to be case insensitive, so, for example, you could type /vol, press tab and have it complete to /Volumes. The old hint doesn't work with Panther and bash, so here's how. As a single command, execute this in Terminal.app:
echo "set completion-ignore-case On" >> ~/.inputrc
Open a new terminal window, and it's working. I don't know of any way to activate it for a single session.
    •    
  • Currently 3.00 / 5
  You rated: 4 / 5 (3 votes cast)
 
[12,370 views]  

Case insensitive completion in 10.3 | 15 comments | Create New Account
Click here to return to the 'Case insensitive completion in 10.3' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
Case insensitive completion in 10.3
Authored by: PancakeMan on Mar 15, '04 11:56:42AM
Since I looked it up, I thought I'd share the address of the "old hint" mentioned (for pre-Panther users).

[ Reply to This | # ]
Case insensitive completion in 10.3
Authored by: atoms on Mar 15, '04 12:06:55PM

Thank you so much for posting this hint. Case sensitive tab completion has been the number one OS X pet peeve of mine since day one. (I did not know about the tcsh tweak.) If you ever make it to Chicago, let me know. I'd be happy to buy you a beer or a latte or something.



[ Reply to This | # ]
Case insensitive completion in 10.3
Authored by: ngb on Mar 15, '04 12:14:56PM
For single session application of this option, leave out everything outside the quotes, and the quotes themselves:

set completion-ignore-case On


[ Reply to This | # ]
Case insensitive completion in 10.3
Authored by: spullara on Mar 15, '04 12:53:46PM

This doesn't work for a single session. You can't put it in your .bashrc either, you must put it in the .inputrc.

---
"The messiness cannot go into the program; it piles up around the programmer." -- Ellen Ullman, Close to the Machine



[ Reply to This | # ]
Case insensitive completion in 10.3
Authored by: sjk on Mar 15, '04 06:37:17PM

Use the "bind" bash builtin to futz with readline settings without modifying ~/.inputrc (or $INPUTRC).



[ Reply to This | # ]
Case insensitive completion in 10.3
Authored by: Djehuti on Mar 15, '04 01:30:11PM

To set it for the current session, echo it into the .inputrc as above, and then (in bash) hit C-x C-r (control-x control-r). C-x C-r causes bash to reread its .inputrc file, activating the variable for the current session.



[ Reply to This | # ]
Case insensitive completion in 10.3
Authored by: Greedo on Mar 15, '04 01:39:39PM
It took a few times to get this to work for me (don't know why). Another nice entry in the .inputrc file is
set show-all-if-ambiguous On
This alters the default behavior of the completion functions so that words which have more than one possible completion cause the matches to be listed immediately instead of ringing the bell. Do a
man bash
and scroll down to the "Readline Variables" section for more settings.

[ Reply to This | # ]
Case insensitive completion in 10.3
Authored by: nmthor1 on Mar 15, '04 08:25:54PM

As mentioned in one of the replies to the "old" post, the old hint works with Panther and tcsh. Never quite got over tcsh...



[ Reply to This | # ]
Case insensitive completion in 10.3
Authored by: wgscott on Mar 16, '04 08:53:01AM

It is still there. It is no longer the default for new accounts in 10.3, but you can switch it back either in netinfo or in terminal itself.

You can also switch it to zsh, which is even more user-friendly than tcsh.



[ Reply to This | # ]
changing login shell
Authored by: sjk on Mar 16, '04 02:27:53PM

Run:

chsh /bin/tcsh

... in a Terminal shell window to change your login shell to tcsh. Run:

cat /etc/shells

... to view a list of other shells that can be chosen with the chsh command.



[ Reply to This | # ]
Other fun .inputrc lines
Authored by: sellout on Mar 16, '04 05:39:34AM

My big complaint is that Terminal doesn't pass things like PgUp and PgDn to the shell. Hell, I'd be happy if it passed Cmd-PgUp as PgUp. In lieu of being able to use those actual keys, I've changed my standard mappings a bit for OS X:

Control-j: history-search-backward
Control-k: end-of-history
Control-h: beginning-of-line
Control-l: end-of-line

These basically give me the functionality that I want PgUp, PgDn, Home, and End to have (respectively). Most of them are pretty standard. The interesting one is the first line. For some reason the default value for PgUp (on systems that pass it through to the shell) is start-of-history, which I find absolutely useless.

history-search-backward is awesome. Have some commands that you use frequently? Type in the first couple letters than trigger this (Ctrl-j in my mapping here). It'll read through your history backward and complete the command with the last entry that begins with the same prefix. Sooooooooo useful.

You may also want to try hitting Ctrl-r then typing the first few characters from something in the history. Another a nice feature.



[ Reply to This | # ]
Bug with Case insensitive completion
Authored by: alanb1979 on Mar 16, '04 10:49:09PM
For me, applying this hint works but creates a bug where folders with spaces in their names get garbled by the auto-completion attempt. Example:

user:~ user$ cd Downloads/to\ install\ \&\ try/
(then hit TAB, and I see ...)
user:~ user$ cd Downloads/to\\\ install\\\ \\\&\\\ 
Any ideas? Anyone seen this? Thanks! (10.3.2)

---
hiedy hoo

[ Reply to This | # ]

Bug with Case insensitive completion
Authored by: nuditarian on Mar 18, '04 01:46:32AM

I believe what you're seeing is bash's handling of spaces in files. For instance a folder called test test will show up as test\ test/

the \ preceding a space is just a way to keep the variable from being broken up. The alternate way is to enclose the folder/file name in quotes. So I can type cd test\ test, or cd "test test"

if you do ls, the folder/file will just show up as test test. If you try to cd test test, bash will see test test as 2 arguments instead of one. Win2k/XP commandline is the only one I've seen that allows spaces in file names when using basic directory commands, e.g. dir, cd.



[ Reply to This | # ]
Case insensitive completion in 10.3
Authored by: slyinthedam@nets on Mar 17, '04 07:51:46AM

Very useful! You can also add this line to your .bash_profile in your home directory so that it is automagically aplied at login every time.

---
It is impossible to travel faster than light, and certainly not desirable, as one's hat keeps blowing off.
               -- Woody Allen



[ Reply to This | # ]
Case insensitive completion in 10.3
Authored by: Safar on May 13, '05 02:05:21PM

does not work in Tiger...



[ Reply to This | # ]