roland
roland

Reputation: 617

after opening terminal process quits and cannot access terminal again

I'm on a mac OS X

I wanted to install an extension to the zsh shell --> Oh-my-zsh:

I ran the following commands using the Iterminal:

ruby -e "$(curl -fsSkL raw.github.com/mxcl/homebrew/go)"
sudo sh -c "echo '/usr/local/bin/zsh' >> /etc/shells"

After the above command the process chocked and I could not change the current shell to the zsh shell

chsh -s /usr/local/bin/zsh

After this I closed the iTerminal, restarted it but it would not really load. Clicking on the application opened the iTerminal window for a second and then closes again.

The same does also happen to the regular terminal window. I click on the application the terminal opens but get the following message:

login: /usr/local/bin/zsh: No such file or directory

It seems as the previous command crocked the load direction for the terminal to load the correct shell is screwed up.

Does any one know how I can reset this to the previous shell without having access to the terminal window.

Upvotes: 27

Views: 26299

Answers (4)

elrrrrrrr
elrrrrrrr

Reputation: 944

maybe need install zsh first;

brew install zsh

Upvotes: -1

Scen
Scen

Reputation: 921

After trying I solved this problem. To permanently change your default Terminal shell:

  1. Choose Preferences from the Terminal menu.

  2. Select the option "Execute this command (specify complete path):"

  3. Change the selected text entry from /bin/tcsh to reflect a different Terminal shell, such as:

     /bin/bash 
     /bin/csh 
     /bin/zsh 
     /bin/zsh-4.0.4 (Mac OS X 10.2.8 or earlier) 
     /bin/zsh-4.1.1 (Mac OS X 10.3 or later) 
     /bin/ksh (Mac OS X 10.4 or later)
    
  4. Close the Terminal Preferences window.

  5. Quit and open Terminal again. The first and subsequent new Terminal windows open with the shell that you designated in Preferences.

Upvotes: 38

Mahmoud Zalt
Mahmoud Zalt

Reputation: 31130

On MAC:

  1. Go to "System Preferences" > "Users & Groups"
  2. Click the "Lock" icon and authenticate
  3. Right-click the your user icon and select "Advanced Options"
  4. Change the value for "Login shell" to /bin/bash

Upvotes: 29

user3341005
user3341005

Reputation: 71

just choose preferences from the terminal menu and select the option shells open with "command (complete path)" and type this path:

/bin/bash

Upvotes: 7

Related Questions