danday74
danday74

Reputation: 57221

iterm2 use bash as well as zsh

I'm trying to set up iterm2 to use bash (as well as zsh).

When I open iterm2 it defaults to zsh.

I am happy with zsh but I would like to add a "bash" iterm2 profile to allow me to open a new tab in bash if so desired.

Is this possible?

Upvotes: 10

Views: 30634

Answers (5)

albert doh
albert doh

Reputation: 11

Open Preferences by clicking iTerm2 in the menubar

  • then click on Settings
  • Click Profiles
  • Click + to add a profile at bottom
  • Name it bash if you would like
  • Then click on Advanced
  • Click on the + for Automatic Profile Switching
  • Add !&bash

Now it will automatically switch profiles to bash when ever you run bash in terminal

Upvotes: 1

seas and mountains
seas and mountains

Reputation: 355

To change the default shell to bash (not exactly what the OP is asking for, but what brought me to this question), using chsh -s /bin/bash worked for me.

Upvotes: 2

Lisa Cotton
Lisa Cotton

Reputation: 351

As of 2023, the preferences menu has changed. The solution is now:

  • Open Preferences
  • Go to the Profiles tab
  • Go to the General sub-tab
  • Under Command, select "Command" in the drop-down and enter "/bin/bash" (without quotes of course) into the text field.

Restart your iTerm and it will be in a bash shell.

Upvotes: 16

JD O'Grady
JD O'Grady

Reputation: 31

This info appears to be stale. As of iTerm2 build 3.4.19 (2023-0515) there isn't a "command" area on the "general" tab. I believe that you can switch shells by creating a new profile, but I'm not sure how.

Upvotes: 3

Sheradil
Sheradil

Reputation: 111

If your default system is zsh, your Terminal should start with it. To configure iTerm2 with bash you have to open Preferences and change the COMMAND on General tab on your default profile. You have to enter /bin/bash or whatever shell you want.

Upvotes: 11

Related Questions