Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is it possible to start .sh files with git bash minimized?

Tags:

git-bash

I wonder if it is possible to start .sh files minimized? I currently run a setup that closes and reopens a .sh file at a timed interval, this can be somewhat annoying because whenever it starts it comes in front of everything else on the screen.

this is what I am starting:

java -Xms1G -Xmx1G -jar server.jar
like image 991
Ragatokk Avatar asked Nov 16 '25 16:11

Ragatokk


2 Answers

git-bash relies on a single config file ~/.minttyrc if you're inside there, or look in %USERPROFILE% if you're not. If you wanted you could add Window=min into that config file, but then it would start your git-bash windows minimized as well.

git does include a directly accessible copy of mintty, on my particular computer its at C:\Program Files\Git\usr\bin

Instead of running git-bash you could run mintty, mintty can be started with a flag to minimize the window. For example: mintty -w min

I would also consider having the restart of the server happen within the shell window.

like image 147
Kyle K Avatar answered Nov 18 '25 21:11

Kyle K


To extend the answer of @kyle-k: the complete hiding of mintty can also be done with:

mintty −w hide

or with the double dashed long option:

mintty −−window hide

From the mintty options documentation:

−w, −−window normal|min|max|full|hide

Set the initial window state: normal, minimized, maximized, full screen, or hidden.

Side note if you want to Ctrl+F the documentation: The website uses the minus sign (−) not the hyphen minus (-).


I use it for a Windows Task Scheduler task

like image 28
rzickler Avatar answered Nov 18 '25 20:11

rzickler



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!