Issue
In Netbeans 13, when opening a terminal, by going to 'Window -> IDE Tools -> Terminal', a new terminal is opened. But I can't see a way to change the shell that runs on the terminal.
In my case on a Mac, the default shell used by Netbeans is zsh
. I would like it to start with bash
. Is this possible to do?
Thank you all for the attention.
Solution
NetBeans
on MacOS uses the environment variable SHELL
to get information about which shell to start. MacOS puts there the path for the default shell for your account. So basically NetBeans just opens the terminal with the default shell.
Check what shell is configured as default:
MacBook-Pro-Admin:~ admin$ echo $SHELL
/bin/bash
Change default shell to bash for your account:
chsh -s /bin/bash
Enter your password when prompted. After that, you need to reboot the computer. NetBeans should now open the bash shell.
An alternative approach is to change SH
variable in hostinfo.sh
script. NetBeans uses hostinfo.sh
script to get the current path to the default shell. I wouldn't recommend it but as a temporary hack, it would do what you want.
Got to the location of hostinfo.sh
. For my installation of 12.2, it is here.
/Applications/NetBeans/Apache NetBeans 12.2.app/Contents/Resources/NetBeans/netbeans/ide/bin/nativeexecution
Then open file hostinfo.sh go to the end of the file and change the line:
echo SH=${SHELL}
to:
echo SH=/bin/bash
Then restart NetBeans.
Answered By - Dmitry.M
Answer Checked By - Gilberto Lyons (JavaFixing Admin)