Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

after opening terminal process quits and cannot access terminal again

Tags:

terminal

macos

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.

like image 970
roland Avatar asked Sep 07 '25 17:09

roland


2 Answers

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.

like image 123
Scen Avatar answered Sep 10 '25 13:09

Scen


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
like image 24
Mahmoud Zalt Avatar answered Sep 10 '25 13:09

Mahmoud Zalt