For any sort of system administrator working with Linux systems, a good terminal emulator is an essential part of the toolbox.
Using Terminal.app – the terminal that comes with OS X for default – has started to wear on me, due to the lack of shared pasteboard (leading to more mispastes this year than I have probably had in the last decade), and the lack of basic reconfiguration of certain keys like the tab macros (although these can be changed using system preferences).
Recently I have been using iTerm2. It’s extremely powerful, but some of its options needed a bit of tweaking to get the privacy to a level that I’m more comfortable with. I have also made a couple of other look and feel tweaks that are worth noting as well.
Privacy Tweaks
These tweaks can help secure iTerm2 a bit, especially if these options are not used often.
Disable pasteboard history
Controlling the number of items in the pasteboard history is a hidden option documented here.
This can be used to turn off the history altogether. Run this, and restart iTerm, and now pressing Command-Shift-H
will return an empty table no matter what:
defaults write com.googlecode.iterm2 MaxPasteHistoryEntries -int 0
Disable VT100 printer code handling
I don’t know why this is not a default, but it can be can turned off easy enough.
Head to Preferences -> Profiles, select the profile to update (ie: the default one), then select Terminal and ensure Disable session-initiated printing is enabled.
Disable semantic history
Semantic history is a feature that facilitates a kind of Finder-like behaviour in iTerm. By Command-Click
-ing something, that file can be loaded like it was run through Finder. It could possibly be useful, but I can see myself fat-fingering something I shouldn’t have and then having to deal with the consequences.
I haven’t found a way to disable the functionality completely, but the aforementioned macro can be disabled by going to Preferences -> Pointer and ensuring Command-Click Opens Filename/URL is not checked.
Disable application clipboard control (default)
This is thankfully a default, but it might be worth double-checking: go to Preferences -> General and ensure that Allow clipboard access to terminal apps is disabled. This ensures that the proprietary iTerm clipboard control code is not handled. See here for a full list of other iTerm-specific codes.
Fun Tweaks
These tweaks will generally improve the experience.
Keybinds (Global)
Head to Preferences -> Keys. These are the global keybinds.
Here, keys can be bound for general application-use macros. I like Control-PgUp/PgDn
for Previous Tab/Next Tab respective as it’s a pretty well-accepted standard. Also, Control-Shift-T
for new tab. This one needs to be selected as Select Menu Item… in the Action combo box, after which New Tab will be selectable.
Note that terminal-use keybinds can be edited on a per-profile basis in Preferences -> Profiles -> Keys.
Unlimited scrollback
Head over to Preferences -> Profiles, select the profile to update (ie: the default one), then select Terminal and ensure Unlimited scrollback is enabled. This limits the scrollback buffer to available memory.
Transparency
No terminal is complete without a transparency feature. 😉 Head over to Preferences -> Profiles, select the profile to update (ie: the default one), and select Window. The transparency slider is there. The results show immediately, so it’s easy to see how much is needed.
Fonts
I’m going to get tired of copying/pasting this text, honest. 😉
Head over to Preferences -> Profiles, select the profile to update (ie: the default one), and select Text. Fonts can be selected there.
For even more awesome fonts, check out Beautiful fixed-width fonts for OS X. This page has a tarball of the various misc-fixed
fonts that are default for X11, including terminals like xterm
. This is really great for that classic look-and-feel.
Colors
Last one. For now. 😉
Head over to Preferences -> Profiles, select the profile to update (ie: the default one), and select Colors.
Colours can be changed here, but even better, they can be saved as schemes. There is even a gallery with a pretty impressive collection of schemes to choose from.
Honorable Mention – X11
For terminal alternatives, this is worth mentioning. There are a few options to install X11 on a Mac, it can be downloaded here or through MacPorts. MacPorts can be used to install other terminals as well, such as rxvt-unicode
or mrxvt
, two extremely fast terminals that can be pretty well customized in their own right. The latter does not have unicode support, but is a personal favourite of mine, and if it wasn’t a bit of a pain to have to adjust locales on all the systems I may touch, I would probably be using it.
There are a few things to note if when using X11 terminals on Mac:
Launch proper terminal on X11 start
The X11.app that MacPorts installs is actually simply a wrapper to xterm
(and by proxy, startx
). The following command below will change the startup app to mrxvt
defaults write org.macports.X11 app_to_run /opt/local/bin/mrxvt
Enabling pasteboard text selection update
The gremlin of a split clipboard rears its head again. 😉
Luckily, this time it’s fixable. Simply open X11’s preferences, and select Pasteboard -> Update Pasteboard immediately when new text is selected.