Mac – How to setup the Mac OS X Terminal so it’s *just peachy*

macmac-osxterminal

My Terminal is awesome, has every detail just right (for me anyway), and now I'm setting up a few new macs around here and I have no idea whatsoever how to get their terminals to a pretty state. My user account is rather old, has been migrated over many OS X releases and machines, so my Terminal setup has grown rather organically over the years.

What I need is a recipe to start from scratch, so 1) I know what I've done, and 2) I can reproduce it anywhere.

Things I'm looking for:

  • Full UTF8 support. Setting LC_*, displaying characters correctly, accepting input… I hear this got much easier in 10.5, maybe it all works out of the box now?
  • Setup of OS X-style keyboard text navigation (option-arrows, etc)
  • How you particularly handle meta-key support? (other than ESC'ing your way around)
  • Other things to help our n00bs get around in the shell, such as:
    • List of useful default key bindings (^A, ^D, etc…)
    • Mac-specific .profile, .inputrc goodness
    • Mac-specific tools such as pbpaste & pbcopy, Open Terminal Here, etc
  • If at all possible, a list of files to copy over to another machine that encompasses all the changes made to tune the Terminal. (dotrc files, plists, etc)
  • And, well, anything else really. Just keep the scope on the Mac OS X Terminal application, rather than general unix setup and tools.

I think a collection of incomplete answers would be a good start. Post one or two things you remember having done, we'll vote them up, and after a few days I'll try to compile it all into a summary answer.

Best Answer

Do nothing. Stick with the default unless there is a valid reason not to.

I see you mention setting up a new unix developer on a Mac. If this developer has any Mac experience, he'll be used to the default and will probably get confused if you've customized things. If you're writing software that ships out to customers, the customer will (usually) have the default configuration and so trying to debug on a system that is "unfamiliar" (i.e. not your comfy customized environment) can be very frustrating.

If (like me) you work with many different machines and operating systems you quickly learn the defaults for that system, what keyboard shortcuts are portable between systems, standard commands for each OS, etc.

What you really need to do here is get a new machine, see what doesn't work (looks like UTF-8 support is fine, I just checked on my Mac) and see if there are any valid reasons for making changes. Developers have their own preferences when it comes to the command line and really don't appreciate being forced into using what someone else thinks is an "ideal setup". It might be ideal for you, but Apple are pretty damn good at figuring out sensible defaults.

The only thing I'd really change by default when setting up a new Mac, is making the Tab key cycle through all controls (including buttons) rather than just text boxes and lists. I know it's not terminal-related, but it does make a huge difference for us keyboard junkies who rarely lift their hand to use a mouse :)

Keyboard & Mouse > Keyboard Shortcuts > Full keyboard access > All Controls