Jolley71717
Jolley71717

Reputation: 718

How do I get bash.exe on Windows 10 to automatically open the zsh shell in IntelliJ instead of the regular bash shell

You can turn on Ubuntu and gain access to bash.exe in windows. You can install zsh and oh-my-zsh too

Then, you can modify IntelliJ to use that bash script by going to Settings -> Tools -> Terminal.

Then you can set it to bash.exe.

The problem is that plain bash.exe through IntelliJ just starts up as the plain bash.exe and not the zsh shell.

Does anyone know how to get bash.exe to automatically open zsh when opening in IntelliJ? I've run all the commands to change the shell in the Ubuntu app, but those effects do not appear in bash.exe.

Upvotes: 2

Views: 2274

Answers (1)

Jolley71717
Jolley71717

Reputation: 718

Just like with normal linux, you can modify the .bashrc profile.

nano ~/.bashrc

Then add the following to the end of the file and save

# Switch to ZSH shell
if test -t 1; then
  exec zsh
fi

Then to confirm that it's working, type

source ~/.bashrc

You should see immediate changes.

To test it further, you can open the terminal in IntelliJ and open the Terminal toolbar and click on the plus sign. If your terminal is pointed towards bash.exe then you should immediately be greeted with your zsh colors and themes

Upvotes: 2

Related Questions