Terminal problems

M

meskue

Guest
Does anyone know how to run the application "Terminal" without reading from any of the profile files (/etc/profile etc...) through applescript or how to specify the Terminal to use a certain shell through applescript...for example is there a way to open "Terminal" to use the bash shell with an applescript (assuming that bash is not the default shell)
 
Joined
Apr 29, 2006
Messages
4,576
Reaction score
378
Points
83
Location
St. Somewhere
Your Mac's Specs
Mac Studio, M1 Max, 32 GB RAM, 2 TB SSD
Terminal's preferences will allow you to start it with any shell. It is the second selection on the Preferences panel. No need for Applescript.

Another perhaps less efficient way I discovered by accident is this. As an example, lets assume that csh is the default shell, but you want terminal to start up in bash. With csh running, execute bash. You now have bash executing as a process under csh. Now, if you CMD-click or right mouse click anywhere in the terminal window, you will bring up a menu from which you select Windows Settings. This pops up a window called Terminal Inspector. At the bottom of this window is a button called "Use Settings As Defaults". Simply press this button and close the Terminal Inspector window. From now on, every time Terminal starts up, or opens a new session, it will execute bash for you (but csh first, then bash - hence my comment about it being not as efficient). This will work for any command that you start up before you use Terminal Inspector to make it the default.

Be careful with this, because there is no easy way to undo it. To get back to the "normal" state, you have to go to your account's Library/Preferences folder and delete the com.apple.Terminal.plist file, which means that you lose all of the customization you have done to Terminal to date.
 

Shop Amazon


Shop for your Apple, Mac, iPhone and other computer products on Amazon.
We are a participant in the Amazon Services LLC Associates Program, an affiliate program designed to provide a means for us to earn fees by linking to Amazon and affiliated sites.
Top