Search code examples
git-bash

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


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

Solution

  • 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.