38

I am using Ubuntu 12.04 and started using zsh. The way I changed my shell is

$ sudo chsh -s /usr/bin/zsh

I changed my prompt theme etc and the changes kicked in. When I do a echo $SHELL I can see that zsh is my shell. But when I open a new terminal bash seems to be my shell. However when su to a different user and su back zsh seems to be the shell.

Please advise.

Thomas Ward
  • 72,494
  • 30
  • 173
  • 237
mehant
  • 483
  • 1
  • 4
  • 4
  • By "terminal" you mean the gnome-terminal that comes with the system? If so you have to modify gnome-terminal's profile/session data so that it will ALWAYS use `zsh` or a login shell, otherwise it'll always default to Bash. – Thomas Ward Sep 06 '13 at 19:19
  • Yes, sorry for not specifying, I mean the gnome-terminal. How do I change the profile/session data to use zsh? I am really new to switching shells etc. – mehant Sep 06 '13 at 21:16
  • I provided an answer below, after getting a liveusb environment working. Take a look. – Thomas Ward Sep 06 '13 at 21:30

3 Answers3

80

Note: I use 12.04 so these instructions might not apply to later versions of Ubuntu / gnome-terminal

In gnome-terminal, the system will usually default to using Bash, because that's what gnome-terminal runs.

I overrode that "default" by changing the profile preferences. Open up gnome-terminal (the "Terminal" application), then go to 'Edit' and 'Profile Preferences'.

Make sure you're editing the 'default' profile, and go to the "Title and Command" tab.

Under "Command" there are three checkboxes: "Run command as a login shell", "Update login records when command is launched", and "Run a custom command instead of my shell".

I checked all three boxes, and under "Custom command:" I put zsh.

I also set "When command exits:" to "Exit the terminal" so it closes the terminal window.

Hit the "Close" button, then exit gnome-terminal and then reopen it. It should now start zsh instead of Bash.

Thomas Ward
  • 72,494
  • 30
  • 173
  • 237
  • 2
    I just needed to set the "Run a custom" box and added zsh to the text box. – Eric Fossum Jun 22 '16 at 03:09
  • 1
    The "system" does not use bash "because that's what gnome-terminal uses". Also running as a login shell is not correct in interactive desktop use. Setting your shell, logging out and back in again should do. – RichieHH Feb 05 '20 at 02:43
  • 1
    It was also enough for me to log out and log back in after changing the default shell using the chsh command. A little confusing at first when I didn't see zsh after setting my new default shell, but I expect gnome-terminal reads this information at login time and thus requires logging in again for the changes to take effect. – topsail May 31 '21 at 15:19
0

After installing zsh; I had to logout and login back again. After that, all new terminals are using zsh.

lordvcs
  • 168
  • 1
  • 8
-1

There is a workaround if you cannot get zsh running by default.

try editing the .bashrc file at the home directory.

add the command zsh in the end. This will start zsh as soon as you enter the shell.

But you have to exit the terminal twice to fully exit.