I've created several bash aliases in Git Bash on Windows, to launch executables from the bash shell.
The problem I am having is that is seems the bash is waiting for an exit code before it starts responding to input again, as once I close the app it launched, it starts taking commands again.
Is there a switch or something I can include in the alias so that bash doesn't wait for the exit code?
I'm looking for something like this...
alias np=notepad.exe --exit
A global alias is stored in the global . gitconfig file which is available under the user home directory in Linux, for a local alias it is inside the . git folder within the repository, or you can say “/. git/config” is the relative path for the file.
I confirm what George mentions in the comments:
Launching your alias with '&
' allows you to go on without waiting for the return code.
With:
alias npp='notepad.exe&'
you won't even have to type in the '&
'.
But for including parameters, I would recommend a script (instead of an alias) placed anywhere within your path, in a file called "npp
":
/c/WINDOWS/system32/notepad.exe $1 &
would allow you to open any file with "npp anyFile" (no '&
' needed), without waiting for the return code.
A script like:
for file in $*
do
/c/WINDOWS/system32/notepad.exe $file &
done
would launch several editors, one per file in parameters:
npp anyFile1 anyFile2 anyFile3
would allow you
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With