113

I've been digging through iTerm2's settings but I can't seem to find a way to make it launch Zsh instead of Bash, does anybody know the proper way to do this inside iTerm2?

I ask this because I come from Mac Terminal, and it easily lets you choose what to run at startup, but I can't seem to find something straight forward with iTerm2.

I searched Google for it, but for some reason I can only find oh-my-zsh references, nothing related to un-modded iTerm2.

I appreciate any help you can provide, thanks. :)

4 Answers 4

196

Change your default shell to /bin/zsh by running the chsh -s /bin/zsh command.

9
  • 33
    Excellent! That worked, I used chsh -s /bin/zsh for those wondering.
    – greduan
    Commented Nov 20, 2012 at 15:26
  • 36
    chsh -s `which zsh` is perhaps a little better
    – nikola
    Commented Jan 26, 2014 at 19:10
  • Where is the setting?
    – tusharmath
    Commented Apr 1, 2014 at 19:32
  • @Tushar What setting? Commented Apr 1, 2014 at 19:48
  • Forgive me for my ignorance. Running the command the way you explained works perfectly.
    – tusharmath
    Commented Apr 1, 2014 at 20:13
74

Although the change with chsh -s $(which zsh) worked perfectly for me, my iTerm2 wouldn't automatically open new terminals with zsh.

Instead I went to iTerm2 -> Preferences -> Profiles -> Default and in the General Tab set the Command to /usr/local/bin/zsh instead of Login shell.

Update: With the current version of iTerm (as of 2.1.1) it perfectly worked for me by changing the default shell (shown above) only.

5
  • 2
    I voted this up because the hint is nearly complete. Anyway the command has to be login -fp [username]. Substitute [username] with your local user. Otherwise iTerm will quit immediately after start.
    – Marschal
    Commented Feb 28, 2015 at 22:15
  • 1
    @Marschal You are correct. I also did the same mistake and upvoted the above answer and my iTerm started quitting the moment I made the change.
    – Hussain K
    Commented Jul 9, 2018 at 11:30
  • Saved the day. I had accidentally rm -rf /usr and so bash was gone, I was able to get a shell to try to fix the ordeal.
    – Ismail
    Commented Jan 20, 2020 at 8:28
  • 1
    DO NOT USE THIS ANOTHER IMMEDIATELY! CRASH! I restore my default profile at[~/Library/Preferences/com.googlecode.iterm2.plist] by my TimeMachine. And thanks to @Marschal give the right answer.
    – fish
    Commented Oct 5, 2021 at 2:23
  • 1
    I had to use /bin/zsh instead of /usr/local/bin/bash to avoid iterm from crashing Commented Oct 14, 2022 at 19:21
8

The following also worked for me:

Preferences -> Profiles -> General Tab -> Command -> Choose "Custom Shell" -> write "zsh"

Restart iTerm2.

I still keep bash for Terminal as the default shell.

0
5

Similar to above answer: Editing my zsh profile that I created, on General tab, in the "Send text at start:" field, I have "clear; pwd; ls; zsh;" this leaves me with a window showing me what I want to see and lastly starting zsh.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.