How to stop git-bash shell from waiting for process to finish?

8,651

In Bash, you can append & to run a command in the background.

In order to suppress its shell output (if any), you can also redirect its STDERR and STDOUT to /dev/null.

So, use this:

git-bash & > /dev/null 2>&1

When you close the window, the command should also exit in the background.

Share:
8,651
StuperUser
Author by

StuperUser

A full stack web app developer most recently using Angular, WebAPI, Dapper. 1.5 years experience in QA and an ISTQB/ISEB Foundation Certificate in Software Testing. BA in Philosophy and Computing from University of Kent. #SOreadytohelp

Updated on September 18, 2022

Comments

  • StuperUser
    StuperUser over 1 year

    Based on a solution to How do I open a new git bash terminal window at my current location in windows? I can use

    $ git-bash
    

    to launch a new terminal from inside a git-bash console window.

    However, this will block the original terminal which will be waiting for the result of the new git-bash.

    Can I start a new terminal window without having it wait for the result?

    • slhck
      slhck about 6 years
      Can you try git-bash & > /dev/null 2&>1?
    • StuperUser
      StuperUser about 6 years
      @slhck Nice, I've added that as a .sh in the Git folder that's in my path and using that, if you add that as answer I can accept it.
  • AJP
    AJP over 5 years
    Needs to read git-bash & > /dev/null 2>&1.
  • AJP
    AJP over 5 years
    I can't edit as it would be under 6 characters :| I think I don't have enough rep yet
  • AJP
    AJP over 5 years
    Yeah unfortunately it just said something like "Edits must be more than 6 characters. Can you change something else?". And I didn't want to make random changes so I left a comment instead :) Would be good to have a feature to trial your account as a low rep user so you could see what I was talking about :)
  • slhck
    slhck over 5 years
    @AJP I remember that character restriction now that you've mentioned it – it's probably not such a bad idea. It's hard to keep all the minor rules in mind when you're not participating as much anymore as I used to. Anyway, thanks for your input!