Iterm For Mac Os X
- ITerm is a full featured terminal emulation program written for OS X using Cocoa. We are aiming at providing users with best command line experience under OS X. The letter i represents a native apple look and feel of the program interface, and an emphasis on complete international support.
- Since we're going to be spending a lot of time in the command-line, let's install a better terminal than the default one. Download and install iTerm2. In Finder, drag and drop the iTerm Application file into the Applications folder. You can now launch iTerm, through the Launchpad for instance. Let's just quickly change some preferences.
Replacing the stock Terminal with iTerm2. To try this app for yourself, head over to the iTerm2 website and download the latest version. ITerm2 is free to download and use, but if you enjoy using this app then you should consider donating to the developer to help support their work on this project. Once you’ve downloaded iTerm2, install and launch it. To mimic OS X's behavior of sending Cmd-left/right to the beginning/end of a line, I add the following mappings in iTerm2: Cmd-left to escape-sequence 1 Cmd-right to escape-sequence 4 To mimic OS X's behavior of sending Option-left/right to the previous/next word, I add the following mappings in iTerm2: Option-left to escape-sequence 1;5D.
Have you ever tried to use 'Command + back arrow', 'Option + front arrow' and such text navigation commands on iTerm? If you did, you've noticed that it simply won't work out of the box and searching for that on Google turns up to be a big mess with confounding results.
There are lots of information in many blog posts, stackoverflow posts and old blog comments (2007), but no centralized solution.
So, here's a centralized solution :D
How to fix
- Open up your iTerm;
- Click on 'iTerm > Preferences';
- Go to 'Profiles';
- Choose your default profile (it may be called 'Default' if you didn't changed anything);
- Go to 'Keys' (inside the Profile tab);
- On 'Left option key act as:' click the '+Esc' box.
- Below the 'Profile Shortcut Keys' grid, click on '+' button and add:
COMMAND + <-
COMMAND + ->
OPTION + <-
OPTION + ->
OPTION + Delete
ESC+ '0x1b 0x7f'
BONUS! Word delete backslash
After getting proud of myself for making my iTerm work as expected, I've tried to delete the last word of a line like this:
And BAM! It deleted the whole path. So... Here's a way to fix that too.
Add this line to your .bashrc file:
Some background information...
I wrote that tutorial after doing a clean-install of Mavericks on my MacOSX and forgotten to backup my iTerm2 configs. Shame on me!
Kids, never forgets to backup your iTerm configs :)
I am spending a lot of time on the command line for the daily development work. I decided to install iTerm2 terminal as an alternative terminal for Mac OS because the default terminal app does not offer rich and powerful features to make my development life easier. So I decided to install advanced alternative terminal to replace Mac OS default terminal.
Before you install iTerm2, please refer its features on their website.
If you happy it’s features and power, you can download the iTerm2 from the following link. Alternatively, you can use Homebrew package manager to install this package.
Install iTerm2 terminal
After download iTerm2 installation file, simply drag and drop into the Applications folder to install iterm2 terminal app. Now you can launch iTerm, through the Launchpad for verifying the installation.
Alternatively, you can install iTerms2 via Homebrew package manager. Once you install the package using Homebrew, you will be able to launch iTerm2 via Mac Launchpad.
When you open iTerm2, it’s looks and feel not that pretty impressed by the first look. You need to follow few more steps to get the look you preferred. You can completely change its looks and feel by customizing default features.
Let’s just quickly change some preferences.
Remove computer name and username from the terminal’s bash prompt
Open iTerms2 “Preferences” configurations box. Then click on “Profiles” tab and select “General” tab.
iTerm2 -> Preferences ->Profiles -> General
Add following text under “Send text at start:” text input.
Close the “Preferences” box and reopen iTerm2 terminal and you will be able to see bash prompt without the computer name and username.
Change default colour theme and fonts
You can download more colour themes to install iterm2 terminal from this web site. http://iterm2colorschemes.com/
Download the zip file and unzip it for the preparation of the next step. Now open the “Preferences” settings window.
You can create a different profile other than Default if you wish to do so. I created a new profile for adding custom settings to the iTerm2.
Open iTerms2 “Preferences” configurations box. Then click on “Profiles” tab and select “Colours” tab.
iTerm2 -> Preferences ->Profiles -> Colours
Now click on “Colour Preset” drop-down and click on “Import” option. Navigate to the “schemes” folder previously unzipped colour profile folder. Then select your preferred colour themes and selected colour themes will be added to the “Colour Preset” drop-down after installing.
Now reopen iTerms terminal and see the effect of the new colour theme.
Once I customize iTerm2 colour theme still I did not see expected nicer interface. I decided to install Oh-My-Zsh to add more features.
Before install Oh-My-Zsh, you need to remove the previously modified text input in the iTerm2 preferences.
Because of Oh-My-Zsh, follow the different approach to remove the [email protected]_machine name from your bash prompt.
Oh-My-Zsh is an open source, the community-driven framework for managing your ZSH configuration. It comes bundled with a ton of helpful functions, helpers, plugins, themes,
It’s a good idea to backup your existing ~/.zshrc file before installing Oh-My-Zsh.
Now you can use the following command on your terminal to install Oh-My-Zsh. You will be able to find more details on their website.
Now you almost have better terminal compared to default one. I decided to use “Agnoster” theme with the Oh-My-Zsh.
You can find many available themes for Oh-My-Zsh here. Before you enable “Agnoster” theme, you need to install Powerline fonts.
After installation completed edit ~/.zshrc and set ZSH_THEME=”agnoster”
After enabling “Agnoster” theme, you may be able to see broken fonts on the iTerm2, follow this GIT issue for fixing this fonts issue.
Users need to set both the Regular font and the Non-ASCII Font in “iTerm > Preferences > Profiles > Text” to use a patched font.
Now you may need to remove [email protected]_machine name from your bash prompt. Add following lines to your “.zshrc” configuration file and restart your iTerm2 terminal.
After you done all the above customizations, you can find your iTerm2terminall as following.
How to enable packages on Oh-My-Zsh
Oh-My-Zsh by default comes with lots of plugins to take advantage of. You can take a look in the plugins directory to see what’s currently available.
Once you spot a plugin (or several) that you’d like to use with Oh-My-Zsh, you’ll need to enable them in the .zshrc file.
Iterm Mac Os X Colors
I have enabled following plugins in my configuration file.
How to upgrade Oh-My-Zsh
If you need to upgrade you just run following command on your terminal.
How to uninstall iTerm2 terminal
Uninstalling Oh My Zsh
If you decided to uninstall iTerm2, first remove the Oh-My-Zsh theme. This will revert back your original zsh configurations.
If you want to uninstall oh-my-zsh, just run uninstall_oh_my_zsh from the command-line. It will remove itself and revert your previous bash or zsh configuration.
Download Iterm For Mac Os X
Iterm For Mac Os X 10.13
If you install iTerm2 terminal vis Homebrew package manager, just type the following command on your terminal.
If you download installer file from directly from their website, you just need to trash it from “Application” folder.
Iterm For Mac Os X 10.7
I hope you will enjoy the features of iTerm2 terminal and Oh-My-Zsh. Please comment your thoughts below.