Pergunta

I have the fish shell installed on my Mac OS X via Homebrew. To configure the Terminal application to use the fish shell instead of the bash shell, I ran chsh -s /usr/local/bin/fish once to change my default shell (as recommended by the caveats of the brew installation) and then I added the fish command to the end of my ~/.bash_profile file to have fish open every time a new terminal window opens.

The problem I face is when I exit. Based on what I see on other people's Mac computers that have fish installed the same way I do, typing exit will immediately close the window, even though fish is running on top of bash. When I try the same thing, some really funky behaviour happens. First off, the fish shell does not outright exit the terminal window, I now have to exit bash. But, in addition to that, the bash shell is in a really weird state. None of the characters that I type in commands will appear in the command prompt. Also, if I were to press enter, the prompt will not create a new line like in normal circumstances.

There must be some sort of configuration that I have that is off. Any ideas?


Update

I found this link that seems to solve my issue: http://support.apple.com/kb/ta27005

Foi útil?

Solução

Two things you can do:

  1. Use exec fish at the end of your .bash_profile. Instead of running fish as a process in bash, this instead replaces the current instance of bash with fish, so that when fish exits, there are no more programs running in the terminal window and the window closes.

  2. You can configure your terminal emulator to run fish instead of bash, so that chsh is unnecessary. Terminal windows only run an instance of your login shell by default.

Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top