Last week I have posted an article on how to write ssh host name on the iTerm’s background. I have been looking for something like this for a while, and this is that killer feature, which forced me to switch to iTerm from classic Terminal app. Here I will show what settings I have tuned to get iTerm more comfortable to use as for me.
First thing necessary to do is enabling UTF-8 support. If you create folders in Finder with extended characters (e.g. Russian, Japanese, etc.) iTerm will only show question marks instead of the real characters. To fix this you just have to set the LANG environment variable of the shell (put this into the ~/.bash_profile):
1 | export LANG=ru_RU.UTF-8 |
The next time you will start an iTerm session the variable will be set and unicode characters will be shown correctly.
A list of all supported UTF-8 locales could be retrieved with the command:
1 | locale -a | grep UTF-8 |
Next thing is to fix an input problem (from iTerm FAQ). If you can’t input Chinese/Japanese/Umlauts/Accents, put this into your ~/.bash_profile:
1 2 3 4 | set meta-flag on set input-meta on set output-meta on set convert-meta off |
Ok, everything works now and all I want is to migrate my color scheme options from Terminal. I love dark color scheme with pastel ANSI colors theme:
There is a great feature of iTerm called bookmarks. You can create display, keyboard, and terminal profiles, and then add bookmarks with these profiles associated to them. Each bookmark opens a terminal window with specified command in it. By default iTerm creates a default profile with something like login -fp kpumuk (for my machine).
I’ve created a new display profile called “Pastel” with nice pastel colors which replace default ANSI colors in terminal (click to enlarge):
I think I’m not alone in my pastel wishes, so here is the script, which will import Pastel display profile to your iTerm, and will assign it to the Default bookmark. Please note: you should run this script from Terminal.app, and do not forget to quit from iTerm before running, because settings will not be applied in this case!
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 | #!/bin/bash PASTEL='{ "Ansi 0 Color" = { "Blue Component" = 0.3097887; "Green Component" = 0.3097887; "Red Component" = 0.3097887; }; "Ansi 1 Color" = { "Blue Component" = 0.3764706; "Green Component" = 0.4235294; "Red Component" = 1; }; "Ansi 10 Color" = { "Blue Component" = 0.6727703; "Green Component" = 1; "Red Component" = 0.8094148; }; "Ansi 11 Color" = { "Blue Component" = 0.7996491; "Green Component" = 1; "Red Component" = 1; }; "Ansi 12 Color" = { "Blue Component" = 0.9982605; "Green Component" = 0.8627756; "Red Component" = 0.7116503; }; "Ansi 13 Color" = { "Blue Component" = 0.9965209; "Green Component" = 0.6133059; "Red Component" = 1; }; "Ansi 14 Color" = { "Blue Component" = 0.9970397; "Green Component" = 0.8763103; "Red Component" = 0.8759136; }; "Ansi 15 Color" = { "Blue Component" = 1; "Green Component" = 1; "Red Component" = 1; }; "Ansi 2 Color" = { "Blue Component" = 0.3764706; "Green Component" = 1; "Red Component" = 0.6588235; }; "Ansi 3 Color" = { "Blue Component" = 0.7137255; "Green Component" = 1; "Red Component" = 1; }; "Ansi 4 Color" = { "Blue Component" = 0.9960784; "Green Component" = 0.7960784; "Red Component" = 0.5882353; }; "Ansi 5 Color" = { "Blue Component" = 0.9921569; "Green Component" = 0.4509804; "Red Component" = 1; }; "Ansi 6 Color" = { "Blue Component" = 0.9960784; "Green Component" = 0.772549; "Red Component" = 0.7764706; }; "Ansi 7 Color" = { "Blue Component" = 0.9335317; "Green Component" = 0.9335317; "Red Component" = 0.9335317; }; "Ansi 8 Color" = { "Blue Component" = 0.4862745; "Green Component" = 0.4862745; "Red Component" = 0.4862745; }; "Ansi 9 Color" = { "Blue Component" = 0.6901961; "Green Component" = 0.7137255; "Red Component" = 1; }; "Anti Alias" = 1; "Background Color" = { "Blue Component" = 0; "Green Component" = 0; "Red Component" = 0; }; Blur = 1; "Bold Color" = { "Blue Component" = 0.5067359; "Green Component" = 0.5067359; "Red Component" = 0.9909502; }; Columns = 120; "Cursor Color" = { "Blue Component" = 0.3764706; "Green Component" = 0.6470588; "Red Component" = 1; }; "Cursor Text Color" = { "Blue Component" = 1; "Green Component" = 1; "Red Component" = 1; }; "Disable Bold" = 0; Font = "Monaco 14"; "Foreground Color" = { "Blue Component" = 1; "Green Component" = 1; "Red Component" = 1; }; "Horizontal Character Spacing" = 1; NAFont = "Monaco 14"; Rows = 24; "Selected Text Color" = { "Blue Component" = 0.9476005; "Green Component" = 0.9476005; "Red Component" = 0.9476005; }; "Selection Color" = { "Blue Component" = 0.5153061; "Green Component" = 0.2224857; "Red Component" = 0.2099074; }; Transparency = 0.1; "Vertical Character Spacing" = 1; }' # Add display profile defaults write net.sourceforge.iTerm Displays -dict-add Pastel "$PASTEL" echo "Pastel display profile added" # Set the default display profile BOOKMARKS=`defaults read net.sourceforge.iTerm Bookmarks | sed 's/\("Display Profile" = \)"[^"]*";/\1"Pastel";/'` defaults write net.sourceforge.iTerm Bookmarks "$BOOKMARKS" echo "Pastel display profile installed as default" |
You can download this script from GitHub here.
Hope, you will find this post useful. Fill free to post your comments and suggestions!
Changelog
2011-08-09 — updated gist URL and install command.
2010-07-13 — fixed bug which was making iTerm totally unusable in some cases.
Thank you for your sharing! Now I switch to iTerm again~
Hi,
I run your script to add a profile for iterm. But after i use the profile, the default text become ‘bold’. I try to unset it via ‘Manage Profiles->Display Profile’. But that still does not work.
Can you please tell me how can I make the default text NON-bold?
Thank you.
You should open Manage Profiles->Display Profiles->Pastel and uncheck “Anti-Aliasing” and then re-open iTerm.
Hello,
I set ANSI colours as regular, but it seems that the syntax of c or bash language differs from the look of terminal.app. However, I adopt your setting, it will be the same. Do you have any idea?
Thanks.
Not sure what do you mean. Could you explain (screenshots are welcome). Thanks!
very nice colors. thanks for posting them.
Hello,
The original colour setting seems that
http://picasaweb.google.com/jamolin/Question#5367626503871174770
“include” uses purple “header” and “string” use red
While using your setting, it works well.
http://picasaweb.google.com/jamolin/Question#5367626492820509442
But if I use the setting “Default” on localhost, the colour becomes very strange.
http://picasaweb.google.com/jamolin/Question#5367626508010770914
However, I use “Default” on remote machine by ssh, it returns to a normal looks as Fig.1
Do you have any ideal about fixing the problem.
Thanks
Thanks for the pastel colours.
iTerm is really a great piece of software,
iTerm + vim + screen == the best IDE for me :)
Very nice :)
Thanks man !
Hi,
i would like to use the pastel display profile but i end up with the following error msg:
2
3
./pastel.sh: line 133: DISPLAYS+=}: command not found
2009-09-11 10:47:29.532 defaults[840] Could not parse: {
could you give me a hint?
Thanks!
Could replace
2
3
DISPLAYS+=$PASTEL
DISPLAYS+="}"
with something like this:
2
DISPLAYS="$DISPLAYS$PASTEL}"
?
Wow! Nice colors!
However, after running the script my delete button output ~ (tilde) instead of deleting.
Looks like you need to change keyboard profile in “Profile” window
Thanks for your script.
But when I run it, it did not show the beautiful colors as your terminal. For example, in your terminal windows, characters with light blue color dedicate it is a directory and “master” shows as green color.
In my terminal windows, all the characters are white color.
How to change it? Thanks