1
I am a Windows user and I am using Cygwin as my terminal. In order to run notepad++ from terminal I have added this lines to ~/.bash_profile:
npp () {
/cygdrive/d/Notepad++/notepad++.exe $(cygpath -w -- "$@")
}
it worked, so next I needed a way to launch it on the background so I could open a npp++ instance without stopping my terminal flow. This worked:
npp foo &
But I did not want to introduce that ampersand manually, so I tried adding this alias to ~/.bash_profile:
alias npp="npp &"
And now:
npp foo
Works in the background.
The problem is that with gnu/linux commands you need to write ampersand after the arguments, if not it will not work.
this works:
ls directory &
This doesnt:
ls & directory
So I would like to know what am I missing here, because:
npp foo
Actually works in the background when I set
alias npp="npp &"
And it does not when I comment it.
You are right, I have tested that 'ls & directory' just list current directory and then throws an error for missing 'directory' command. So, why 'npp foo' works as 'npp foo &' when 'npp' is an alias to 'npp &'? – adriloma – 2016-03-13T10:51:37.250
It doesn't work with
bash
under Linux, I didn't test undercygwin
but I would be very surprised if it behaves differently. – jlliagre – 2016-03-13T10:55:23.417thank you, I was missing something: I run notepad++ without -nosession and -multiinst options, so whenever it is opened it remembers last session files. As I have always been testing it with the same file, it was always loaded, so 'npp foo' was already 'npp & foo', which ignores 'foo', but foo appears on notepad++ because it was loaded on last session. what a misunderstood, thanks! – adriloma – 2016-03-13T11:15:28.797