Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

OSX bash minimize window

In the Mac and using the bash shell, I want to execute a file that contains a single command (to start Jupyter Lab) and immediately minimize the terminal window.

Is there a way to do this WITHOUT installing third party software?

like image 337
CarlosE Avatar asked Jul 13 '26 23:07

CarlosE


2 Answers

Building on Paul R's answer, which in my testing appears to make the window fully hidden and unrecoverable, you can use the following to minimise the window to the dock if access is required again later:

 osascript -e 'tell application "Terminal" to set miniaturized of every window to true'
like image 59
cognophile Avatar answered Jul 18 '26 05:07

cognophile


Yes, just use osascript and Applescript:

osascript -e 'tell application "Terminal" to set visible of front window to false'
like image 26
Paul R Avatar answered Jul 18 '26 05:07

Paul R