Use Notepad++ from Cygwin without having the shell wait for an exit codeHow to use cyg-wrapper to fork a new...

What is the most triangles you can make from a capital "H" and 3 straight lines?

What is better: yes / no radio, or simple checkbox?

Quenching swords in dragon blood; why?

Why does String.replaceAll() work differently in Java 8 from Java 9?

What to do when being responsible for data protection in your lab, yet advice is ignored?

Is there some relative to Dutch word "kijken" in German?

Can an insurance company drop you after receiving a bill and refusing to pay?

How to avoid being sexist when trying to employ someone to function in a very sexist environment?

Would these multi-classing house rules cause unintended problems?

Why would the Pakistan airspace closure cancel flights not headed to Pakistan itself?

Citing paywalled articles accessed via illegal web sharing

Am I a Rude Number?

How can animals be objects of ethics without being subjects as well?

insert EOF statement before the last line of file

Would a National Army of mercenaries be a feasible idea?

Book where aliens are selecting humans for food consumption

Does fast page mode apply to ROM?

Is there any differences between "Gucken" and "Schauen"?

Does Improved Divine Smite trigger when a paladin makes an unarmed strike?

How to tag distinct options/entities without giving any an implicit priority or suggested order?

Using only 1s, make 29 with the minimum number of digits

Eww, those bytes are gross

How would a Dictatorship make a country more successful?

Disable the ">" operator in Rstudio linux terminal



Use Notepad++ from Cygwin without having the shell wait for an exit code


How to use cyg-wrapper to fork a new tab in win32 gvimCygwin browser script errorHow can I have Emacs window(s) and cygwin shell running simultaneously on Windows?Weird behavior when launching app from CMD with/without startopen file from Cloud9's terminal (bash) in its IDEbashrc alias ls not workingChange default document 'edit' tool in Windows 10How do I make Notepad++ my default editor in PowerShell?From cygwin, how do you define an alias to get to windows “My Documents”Bash/Cygwin - aliases not behaving like command













19















I'm running Cygwin and would like to use Notepad++ as the main shell editor, kind of like what I have on my Mac, where I can type mate whatever to open up an instance of TextMate. In my ~/.bashrc file in Cygwin I have the following alias and environment variable set:



export EDITOR="/cygdrive/c/Program Files/Notepad++/notepad++.exe"
alias np="/cygdrive/c/Program Files/Notepad++/notepad++.exe"


It mostly works: when I type np whatever or when a Cygwin program calls for $EDITOR, Notepad++ opens.



However, the shell waits until Notepad++ is closed and won't allow any input until then. This may be specific to bash, but how can I open Notepad++ from Cygwin and tell the shell to not wait for an exit code to continue? Adding a & to the end of the alias command doesn't work correctly—it just opens an untitled file and warns filename: command not found instead of opening the file.



Thanks!










share|improve this question



























    19















    I'm running Cygwin and would like to use Notepad++ as the main shell editor, kind of like what I have on my Mac, where I can type mate whatever to open up an instance of TextMate. In my ~/.bashrc file in Cygwin I have the following alias and environment variable set:



    export EDITOR="/cygdrive/c/Program Files/Notepad++/notepad++.exe"
    alias np="/cygdrive/c/Program Files/Notepad++/notepad++.exe"


    It mostly works: when I type np whatever or when a Cygwin program calls for $EDITOR, Notepad++ opens.



    However, the shell waits until Notepad++ is closed and won't allow any input until then. This may be specific to bash, but how can I open Notepad++ from Cygwin and tell the shell to not wait for an exit code to continue? Adding a & to the end of the alias command doesn't work correctly—it just opens an untitled file and warns filename: command not found instead of opening the file.



    Thanks!










    share|improve this question

























      19












      19








      19


      4






      I'm running Cygwin and would like to use Notepad++ as the main shell editor, kind of like what I have on my Mac, where I can type mate whatever to open up an instance of TextMate. In my ~/.bashrc file in Cygwin I have the following alias and environment variable set:



      export EDITOR="/cygdrive/c/Program Files/Notepad++/notepad++.exe"
      alias np="/cygdrive/c/Program Files/Notepad++/notepad++.exe"


      It mostly works: when I type np whatever or when a Cygwin program calls for $EDITOR, Notepad++ opens.



      However, the shell waits until Notepad++ is closed and won't allow any input until then. This may be specific to bash, but how can I open Notepad++ from Cygwin and tell the shell to not wait for an exit code to continue? Adding a & to the end of the alias command doesn't work correctly—it just opens an untitled file and warns filename: command not found instead of opening the file.



      Thanks!










      share|improve this question














      I'm running Cygwin and would like to use Notepad++ as the main shell editor, kind of like what I have on my Mac, where I can type mate whatever to open up an instance of TextMate. In my ~/.bashrc file in Cygwin I have the following alias and environment variable set:



      export EDITOR="/cygdrive/c/Program Files/Notepad++/notepad++.exe"
      alias np="/cygdrive/c/Program Files/Notepad++/notepad++.exe"


      It mostly works: when I type np whatever or when a Cygwin program calls for $EDITOR, Notepad++ opens.



      However, the shell waits until Notepad++ is closed and won't allow any input until then. This may be specific to bash, but how can I open Notepad++ from Cygwin and tell the shell to not wait for an exit code to continue? Adding a & to the end of the alias command doesn't work correctly—it just opens an untitled file and warns filename: command not found instead of opening the file.



      Thanks!







      bash cygwin notepad++






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked Jul 28 '10 at 18:26









      AndrewAndrew

      94451628




      94451628






















          8 Answers
          8






          active

          oldest

          votes


















          16














          You could try a bash function to pass the arguments before the ampersand:



          np ()
          {
          /cygdrive/c/Program Files/Notepad++/notepad++.exe $* &
          }


          BUT the bigger issue may be the whole idea of not waiting until Notepad++ exits. Shell commands which use $EDITOR typically are designed to wait until the editor sends back an indication that the editing has completed. This usually means that the editor has exited (e.g. with vi or nano).



          Emacs has a way to set your EDITOR to emacsclient and then when you're done editing, you hit a magical keystroke (C-x #) to indicate that editing is complete. If Notepad++ had something similar for cygwin users, I can see how this would work.



          Another alternative is to use plain, boring, simple Notepad as your EDITOR and reserve Notepad++ for heavy use (I got the idea from this blog post)






          share|improve this answer
























          • Awesome—that worked. I'm going to go with the vanilla Notepad as EDITOR and Notepad++ as np()

            – Andrew
            Jul 28 '10 at 19:41











          • Notepad also requires waiting for editing to be finished

            – codezombie
            Oct 17 '15 at 17:58



















          8














          I solved it with a simple symlink.



          ln -s /cygdrive/c/Program Files (x86)/Notepad++/notepad++.exe ~/bin/npp


          Of course ~/bin is in my $PATH.



          Now to open a file I just type "npp filename.txt" from the cygwin prompt. I've haven't had to use the & at the end of the command.



          This will also throw a tab into the currently running Notepad++ window rather than opening another one -- AND if the file is already open, it doesn't open it again.






          share|improve this answer
























          • How do you add ~/bin to $PATH?

            – eric f
            May 9 '13 at 15:39



















          3















          export EDITOR="/cygdrive/c/Program Files '(x86)'/Notepad++/notepad++.exe"



          alias np="/cygdrive/c/Program Files '(x86)'/Notepad++/notepad++.exe"




          also works for x86






          share|improve this answer































            2














            Just add a space and an ampersand (&) to the end of your command and the shell will immediately return to input mode while leaving notepad++ open.



            on edit:



            I'm not talking about adding it to your alias. Add it to the end of your command like this:



            np whatever &






            share|improve this answer



















            • 1





              Ooh. This looks good so far. Is there a way to put that in the .bash_profile so I don't need to type it all the time?

              – Andrew
              Jul 28 '10 at 18:36











            • I'm not a bash expert but I assume you could make your alias take a variable which is the argument, and also include the ampersand at the end. Someone smarter with bash could probably give you the exact syntax. I only knew how to answer your question because I used to do the exact same thing while working in a windows dev environment :)

              – Robert S Ciaccio
              Jul 28 '10 at 18:46













            • You can't make an alias take a variable in Bash. You have to use a function or a script.

              – Dennis Williamson
              Jul 28 '10 at 22:49



















            1














            Aliases don't take interpolated arguments. Use a function instead.



            function np() { /cygdrive/c/Program Files/Notepad++/notepad++.exe $1 & }





            share|improve this answer































              1














              #!/bin/sh
              /cygdrive/c/Program Files/Notepad++/notepad++.exe $@ &


              This script starts Notepad++ in the background, passing the command line arguments before the '&'



              As Doug advised, having a default $EDITOR that does not block may cause problems.






              share|improve this answer

































                0














                There's a specific command in cygwin to accomplish this. Make sure you download run.exe, and make sure it's in your PATH (or your PATH contains the executable)



                alias np="run.exe /cygdrive/c/Program Files/Notepad++/notepad++.exe"





                share|improve this answer































                  0














                  im just learning how to use git, my tutor is using textmate. so he typed mate filename.txt and i did too...but i'm using notepad++.
                  Ethan Vaughn's answer made me realize that mate isnt aligned with notepad++.
                  i typed npp filename.txt
                  it worked





                  share








                  New contributor




                  mmatree is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                  Check out our Code of Conduct.




















                    Your Answer








                    StackExchange.ready(function() {
                    var channelOptions = {
                    tags: "".split(" "),
                    id: "3"
                    };
                    initTagRenderer("".split(" "), "".split(" "), channelOptions);

                    StackExchange.using("externalEditor", function() {
                    // Have to fire editor after snippets, if snippets enabled
                    if (StackExchange.settings.snippets.snippetsEnabled) {
                    StackExchange.using("snippets", function() {
                    createEditor();
                    });
                    }
                    else {
                    createEditor();
                    }
                    });

                    function createEditor() {
                    StackExchange.prepareEditor({
                    heartbeatType: 'answer',
                    autoActivateHeartbeat: false,
                    convertImagesToLinks: true,
                    noModals: true,
                    showLowRepImageUploadWarning: true,
                    reputationToPostImages: 10,
                    bindNavPrevention: true,
                    postfix: "",
                    imageUploader: {
                    brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
                    contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
                    allowUrls: true
                    },
                    onDemand: true,
                    discardSelector: ".discard-answer"
                    ,immediatelyShowMarkdownHelp:true
                    });


                    }
                    });














                    draft saved

                    draft discarded


















                    StackExchange.ready(
                    function () {
                    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fsuperuser.com%2fquestions%2f168971%2fuse-notepad-from-cygwin-without-having-the-shell-wait-for-an-exit-code%23new-answer', 'question_page');
                    }
                    );

                    Post as a guest















                    Required, but never shown

























                    8 Answers
                    8






                    active

                    oldest

                    votes








                    8 Answers
                    8






                    active

                    oldest

                    votes









                    active

                    oldest

                    votes






                    active

                    oldest

                    votes









                    16














                    You could try a bash function to pass the arguments before the ampersand:



                    np ()
                    {
                    /cygdrive/c/Program Files/Notepad++/notepad++.exe $* &
                    }


                    BUT the bigger issue may be the whole idea of not waiting until Notepad++ exits. Shell commands which use $EDITOR typically are designed to wait until the editor sends back an indication that the editing has completed. This usually means that the editor has exited (e.g. with vi or nano).



                    Emacs has a way to set your EDITOR to emacsclient and then when you're done editing, you hit a magical keystroke (C-x #) to indicate that editing is complete. If Notepad++ had something similar for cygwin users, I can see how this would work.



                    Another alternative is to use plain, boring, simple Notepad as your EDITOR and reserve Notepad++ for heavy use (I got the idea from this blog post)






                    share|improve this answer
























                    • Awesome—that worked. I'm going to go with the vanilla Notepad as EDITOR and Notepad++ as np()

                      – Andrew
                      Jul 28 '10 at 19:41











                    • Notepad also requires waiting for editing to be finished

                      – codezombie
                      Oct 17 '15 at 17:58
















                    16














                    You could try a bash function to pass the arguments before the ampersand:



                    np ()
                    {
                    /cygdrive/c/Program Files/Notepad++/notepad++.exe $* &
                    }


                    BUT the bigger issue may be the whole idea of not waiting until Notepad++ exits. Shell commands which use $EDITOR typically are designed to wait until the editor sends back an indication that the editing has completed. This usually means that the editor has exited (e.g. with vi or nano).



                    Emacs has a way to set your EDITOR to emacsclient and then when you're done editing, you hit a magical keystroke (C-x #) to indicate that editing is complete. If Notepad++ had something similar for cygwin users, I can see how this would work.



                    Another alternative is to use plain, boring, simple Notepad as your EDITOR and reserve Notepad++ for heavy use (I got the idea from this blog post)






                    share|improve this answer
























                    • Awesome—that worked. I'm going to go with the vanilla Notepad as EDITOR and Notepad++ as np()

                      – Andrew
                      Jul 28 '10 at 19:41











                    • Notepad also requires waiting for editing to be finished

                      – codezombie
                      Oct 17 '15 at 17:58














                    16












                    16








                    16







                    You could try a bash function to pass the arguments before the ampersand:



                    np ()
                    {
                    /cygdrive/c/Program Files/Notepad++/notepad++.exe $* &
                    }


                    BUT the bigger issue may be the whole idea of not waiting until Notepad++ exits. Shell commands which use $EDITOR typically are designed to wait until the editor sends back an indication that the editing has completed. This usually means that the editor has exited (e.g. with vi or nano).



                    Emacs has a way to set your EDITOR to emacsclient and then when you're done editing, you hit a magical keystroke (C-x #) to indicate that editing is complete. If Notepad++ had something similar for cygwin users, I can see how this would work.



                    Another alternative is to use plain, boring, simple Notepad as your EDITOR and reserve Notepad++ for heavy use (I got the idea from this blog post)






                    share|improve this answer













                    You could try a bash function to pass the arguments before the ampersand:



                    np ()
                    {
                    /cygdrive/c/Program Files/Notepad++/notepad++.exe $* &
                    }


                    BUT the bigger issue may be the whole idea of not waiting until Notepad++ exits. Shell commands which use $EDITOR typically are designed to wait until the editor sends back an indication that the editing has completed. This usually means that the editor has exited (e.g. with vi or nano).



                    Emacs has a way to set your EDITOR to emacsclient and then when you're done editing, you hit a magical keystroke (C-x #) to indicate that editing is complete. If Notepad++ had something similar for cygwin users, I can see how this would work.



                    Another alternative is to use plain, boring, simple Notepad as your EDITOR and reserve Notepad++ for heavy use (I got the idea from this blog post)







                    share|improve this answer












                    share|improve this answer



                    share|improve this answer










                    answered Jul 28 '10 at 19:10









                    Doug HarrisDoug Harris

                    20.6k1464103




                    20.6k1464103













                    • Awesome—that worked. I'm going to go with the vanilla Notepad as EDITOR and Notepad++ as np()

                      – Andrew
                      Jul 28 '10 at 19:41











                    • Notepad also requires waiting for editing to be finished

                      – codezombie
                      Oct 17 '15 at 17:58



















                    • Awesome—that worked. I'm going to go with the vanilla Notepad as EDITOR and Notepad++ as np()

                      – Andrew
                      Jul 28 '10 at 19:41











                    • Notepad also requires waiting for editing to be finished

                      – codezombie
                      Oct 17 '15 at 17:58

















                    Awesome—that worked. I'm going to go with the vanilla Notepad as EDITOR and Notepad++ as np()

                    – Andrew
                    Jul 28 '10 at 19:41





                    Awesome—that worked. I'm going to go with the vanilla Notepad as EDITOR and Notepad++ as np()

                    – Andrew
                    Jul 28 '10 at 19:41













                    Notepad also requires waiting for editing to be finished

                    – codezombie
                    Oct 17 '15 at 17:58





                    Notepad also requires waiting for editing to be finished

                    – codezombie
                    Oct 17 '15 at 17:58













                    8














                    I solved it with a simple symlink.



                    ln -s /cygdrive/c/Program Files (x86)/Notepad++/notepad++.exe ~/bin/npp


                    Of course ~/bin is in my $PATH.



                    Now to open a file I just type "npp filename.txt" from the cygwin prompt. I've haven't had to use the & at the end of the command.



                    This will also throw a tab into the currently running Notepad++ window rather than opening another one -- AND if the file is already open, it doesn't open it again.






                    share|improve this answer
























                    • How do you add ~/bin to $PATH?

                      – eric f
                      May 9 '13 at 15:39
















                    8














                    I solved it with a simple symlink.



                    ln -s /cygdrive/c/Program Files (x86)/Notepad++/notepad++.exe ~/bin/npp


                    Of course ~/bin is in my $PATH.



                    Now to open a file I just type "npp filename.txt" from the cygwin prompt. I've haven't had to use the & at the end of the command.



                    This will also throw a tab into the currently running Notepad++ window rather than opening another one -- AND if the file is already open, it doesn't open it again.






                    share|improve this answer
























                    • How do you add ~/bin to $PATH?

                      – eric f
                      May 9 '13 at 15:39














                    8












                    8








                    8







                    I solved it with a simple symlink.



                    ln -s /cygdrive/c/Program Files (x86)/Notepad++/notepad++.exe ~/bin/npp


                    Of course ~/bin is in my $PATH.



                    Now to open a file I just type "npp filename.txt" from the cygwin prompt. I've haven't had to use the & at the end of the command.



                    This will also throw a tab into the currently running Notepad++ window rather than opening another one -- AND if the file is already open, it doesn't open it again.






                    share|improve this answer













                    I solved it with a simple symlink.



                    ln -s /cygdrive/c/Program Files (x86)/Notepad++/notepad++.exe ~/bin/npp


                    Of course ~/bin is in my $PATH.



                    Now to open a file I just type "npp filename.txt" from the cygwin prompt. I've haven't had to use the & at the end of the command.



                    This will also throw a tab into the currently running Notepad++ window rather than opening another one -- AND if the file is already open, it doesn't open it again.







                    share|improve this answer












                    share|improve this answer



                    share|improve this answer










                    answered Feb 25 '11 at 17:20









                    Ethan VaughnEthan Vaughn

                    8111




                    8111













                    • How do you add ~/bin to $PATH?

                      – eric f
                      May 9 '13 at 15:39



















                    • How do you add ~/bin to $PATH?

                      – eric f
                      May 9 '13 at 15:39

















                    How do you add ~/bin to $PATH?

                    – eric f
                    May 9 '13 at 15:39





                    How do you add ~/bin to $PATH?

                    – eric f
                    May 9 '13 at 15:39











                    3















                    export EDITOR="/cygdrive/c/Program Files '(x86)'/Notepad++/notepad++.exe"



                    alias np="/cygdrive/c/Program Files '(x86)'/Notepad++/notepad++.exe"




                    also works for x86






                    share|improve this answer




























                      3















                      export EDITOR="/cygdrive/c/Program Files '(x86)'/Notepad++/notepad++.exe"



                      alias np="/cygdrive/c/Program Files '(x86)'/Notepad++/notepad++.exe"




                      also works for x86






                      share|improve this answer


























                        3












                        3








                        3








                        export EDITOR="/cygdrive/c/Program Files '(x86)'/Notepad++/notepad++.exe"



                        alias np="/cygdrive/c/Program Files '(x86)'/Notepad++/notepad++.exe"




                        also works for x86






                        share|improve this answer














                        export EDITOR="/cygdrive/c/Program Files '(x86)'/Notepad++/notepad++.exe"



                        alias np="/cygdrive/c/Program Files '(x86)'/Notepad++/notepad++.exe"




                        also works for x86







                        share|improve this answer












                        share|improve this answer



                        share|improve this answer










                        answered Oct 1 '13 at 22:16









                        mlanzeromlanzero

                        311




                        311























                            2














                            Just add a space and an ampersand (&) to the end of your command and the shell will immediately return to input mode while leaving notepad++ open.



                            on edit:



                            I'm not talking about adding it to your alias. Add it to the end of your command like this:



                            np whatever &






                            share|improve this answer



















                            • 1





                              Ooh. This looks good so far. Is there a way to put that in the .bash_profile so I don't need to type it all the time?

                              – Andrew
                              Jul 28 '10 at 18:36











                            • I'm not a bash expert but I assume you could make your alias take a variable which is the argument, and also include the ampersand at the end. Someone smarter with bash could probably give you the exact syntax. I only knew how to answer your question because I used to do the exact same thing while working in a windows dev environment :)

                              – Robert S Ciaccio
                              Jul 28 '10 at 18:46













                            • You can't make an alias take a variable in Bash. You have to use a function or a script.

                              – Dennis Williamson
                              Jul 28 '10 at 22:49
















                            2














                            Just add a space and an ampersand (&) to the end of your command and the shell will immediately return to input mode while leaving notepad++ open.



                            on edit:



                            I'm not talking about adding it to your alias. Add it to the end of your command like this:



                            np whatever &






                            share|improve this answer



















                            • 1





                              Ooh. This looks good so far. Is there a way to put that in the .bash_profile so I don't need to type it all the time?

                              – Andrew
                              Jul 28 '10 at 18:36











                            • I'm not a bash expert but I assume you could make your alias take a variable which is the argument, and also include the ampersand at the end. Someone smarter with bash could probably give you the exact syntax. I only knew how to answer your question because I used to do the exact same thing while working in a windows dev environment :)

                              – Robert S Ciaccio
                              Jul 28 '10 at 18:46













                            • You can't make an alias take a variable in Bash. You have to use a function or a script.

                              – Dennis Williamson
                              Jul 28 '10 at 22:49














                            2












                            2








                            2







                            Just add a space and an ampersand (&) to the end of your command and the shell will immediately return to input mode while leaving notepad++ open.



                            on edit:



                            I'm not talking about adding it to your alias. Add it to the end of your command like this:



                            np whatever &






                            share|improve this answer













                            Just add a space and an ampersand (&) to the end of your command and the shell will immediately return to input mode while leaving notepad++ open.



                            on edit:



                            I'm not talking about adding it to your alias. Add it to the end of your command like this:



                            np whatever &







                            share|improve this answer












                            share|improve this answer



                            share|improve this answer










                            answered Jul 28 '10 at 18:28









                            Robert S CiaccioRobert S Ciaccio

                            1,29541625




                            1,29541625








                            • 1





                              Ooh. This looks good so far. Is there a way to put that in the .bash_profile so I don't need to type it all the time?

                              – Andrew
                              Jul 28 '10 at 18:36











                            • I'm not a bash expert but I assume you could make your alias take a variable which is the argument, and also include the ampersand at the end. Someone smarter with bash could probably give you the exact syntax. I only knew how to answer your question because I used to do the exact same thing while working in a windows dev environment :)

                              – Robert S Ciaccio
                              Jul 28 '10 at 18:46













                            • You can't make an alias take a variable in Bash. You have to use a function or a script.

                              – Dennis Williamson
                              Jul 28 '10 at 22:49














                            • 1





                              Ooh. This looks good so far. Is there a way to put that in the .bash_profile so I don't need to type it all the time?

                              – Andrew
                              Jul 28 '10 at 18:36











                            • I'm not a bash expert but I assume you could make your alias take a variable which is the argument, and also include the ampersand at the end. Someone smarter with bash could probably give you the exact syntax. I only knew how to answer your question because I used to do the exact same thing while working in a windows dev environment :)

                              – Robert S Ciaccio
                              Jul 28 '10 at 18:46













                            • You can't make an alias take a variable in Bash. You have to use a function or a script.

                              – Dennis Williamson
                              Jul 28 '10 at 22:49








                            1




                            1





                            Ooh. This looks good so far. Is there a way to put that in the .bash_profile so I don't need to type it all the time?

                            – Andrew
                            Jul 28 '10 at 18:36





                            Ooh. This looks good so far. Is there a way to put that in the .bash_profile so I don't need to type it all the time?

                            – Andrew
                            Jul 28 '10 at 18:36













                            I'm not a bash expert but I assume you could make your alias take a variable which is the argument, and also include the ampersand at the end. Someone smarter with bash could probably give you the exact syntax. I only knew how to answer your question because I used to do the exact same thing while working in a windows dev environment :)

                            – Robert S Ciaccio
                            Jul 28 '10 at 18:46







                            I'm not a bash expert but I assume you could make your alias take a variable which is the argument, and also include the ampersand at the end. Someone smarter with bash could probably give you the exact syntax. I only knew how to answer your question because I used to do the exact same thing while working in a windows dev environment :)

                            – Robert S Ciaccio
                            Jul 28 '10 at 18:46















                            You can't make an alias take a variable in Bash. You have to use a function or a script.

                            – Dennis Williamson
                            Jul 28 '10 at 22:49





                            You can't make an alias take a variable in Bash. You have to use a function or a script.

                            – Dennis Williamson
                            Jul 28 '10 at 22:49











                            1














                            Aliases don't take interpolated arguments. Use a function instead.



                            function np() { /cygdrive/c/Program Files/Notepad++/notepad++.exe $1 & }





                            share|improve this answer




























                              1














                              Aliases don't take interpolated arguments. Use a function instead.



                              function np() { /cygdrive/c/Program Files/Notepad++/notepad++.exe $1 & }





                              share|improve this answer


























                                1












                                1








                                1







                                Aliases don't take interpolated arguments. Use a function instead.



                                function np() { /cygdrive/c/Program Files/Notepad++/notepad++.exe $1 & }





                                share|improve this answer













                                Aliases don't take interpolated arguments. Use a function instead.



                                function np() { /cygdrive/c/Program Files/Notepad++/notepad++.exe $1 & }






                                share|improve this answer












                                share|improve this answer



                                share|improve this answer










                                answered Jul 28 '10 at 19:17









                                garyjohngaryjohn

                                27.2k46572




                                27.2k46572























                                    1














                                    #!/bin/sh
                                    /cygdrive/c/Program Files/Notepad++/notepad++.exe $@ &


                                    This script starts Notepad++ in the background, passing the command line arguments before the '&'



                                    As Doug advised, having a default $EDITOR that does not block may cause problems.






                                    share|improve this answer






























                                      1














                                      #!/bin/sh
                                      /cygdrive/c/Program Files/Notepad++/notepad++.exe $@ &


                                      This script starts Notepad++ in the background, passing the command line arguments before the '&'



                                      As Doug advised, having a default $EDITOR that does not block may cause problems.






                                      share|improve this answer




























                                        1












                                        1








                                        1







                                        #!/bin/sh
                                        /cygdrive/c/Program Files/Notepad++/notepad++.exe $@ &


                                        This script starts Notepad++ in the background, passing the command line arguments before the '&'



                                        As Doug advised, having a default $EDITOR that does not block may cause problems.






                                        share|improve this answer















                                        #!/bin/sh
                                        /cygdrive/c/Program Files/Notepad++/notepad++.exe $@ &


                                        This script starts Notepad++ in the background, passing the command line arguments before the '&'



                                        As Doug advised, having a default $EDITOR that does not block may cause problems.







                                        share|improve this answer














                                        share|improve this answer



                                        share|improve this answer








                                        edited Mar 20 '17 at 10:17









                                        Community

                                        1




                                        1










                                        answered Jul 28 '10 at 19:27









                                        LeftiumLeftium

                                        6,77294271




                                        6,77294271























                                            0














                                            There's a specific command in cygwin to accomplish this. Make sure you download run.exe, and make sure it's in your PATH (or your PATH contains the executable)



                                            alias np="run.exe /cygdrive/c/Program Files/Notepad++/notepad++.exe"





                                            share|improve this answer




























                                              0














                                              There's a specific command in cygwin to accomplish this. Make sure you download run.exe, and make sure it's in your PATH (or your PATH contains the executable)



                                              alias np="run.exe /cygdrive/c/Program Files/Notepad++/notepad++.exe"





                                              share|improve this answer


























                                                0












                                                0








                                                0







                                                There's a specific command in cygwin to accomplish this. Make sure you download run.exe, and make sure it's in your PATH (or your PATH contains the executable)



                                                alias np="run.exe /cygdrive/c/Program Files/Notepad++/notepad++.exe"





                                                share|improve this answer













                                                There's a specific command in cygwin to accomplish this. Make sure you download run.exe, and make sure it's in your PATH (or your PATH contains the executable)



                                                alias np="run.exe /cygdrive/c/Program Files/Notepad++/notepad++.exe"






                                                share|improve this answer












                                                share|improve this answer



                                                share|improve this answer










                                                answered Aug 4 '10 at 17:02









                                                Rich HomolkaRich Homolka

                                                25.4k64367




                                                25.4k64367























                                                    0














                                                    im just learning how to use git, my tutor is using textmate. so he typed mate filename.txt and i did too...but i'm using notepad++.
                                                    Ethan Vaughn's answer made me realize that mate isnt aligned with notepad++.
                                                    i typed npp filename.txt
                                                    it worked





                                                    share








                                                    New contributor




                                                    mmatree is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                                                    Check out our Code of Conduct.

























                                                      0














                                                      im just learning how to use git, my tutor is using textmate. so he typed mate filename.txt and i did too...but i'm using notepad++.
                                                      Ethan Vaughn's answer made me realize that mate isnt aligned with notepad++.
                                                      i typed npp filename.txt
                                                      it worked





                                                      share








                                                      New contributor




                                                      mmatree is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                                                      Check out our Code of Conduct.























                                                        0












                                                        0








                                                        0







                                                        im just learning how to use git, my tutor is using textmate. so he typed mate filename.txt and i did too...but i'm using notepad++.
                                                        Ethan Vaughn's answer made me realize that mate isnt aligned with notepad++.
                                                        i typed npp filename.txt
                                                        it worked





                                                        share








                                                        New contributor




                                                        mmatree is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                                                        Check out our Code of Conduct.










                                                        im just learning how to use git, my tutor is using textmate. so he typed mate filename.txt and i did too...but i'm using notepad++.
                                                        Ethan Vaughn's answer made me realize that mate isnt aligned with notepad++.
                                                        i typed npp filename.txt
                                                        it worked






                                                        share








                                                        New contributor




                                                        mmatree is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                                                        Check out our Code of Conduct.








                                                        share


                                                        share






                                                        New contributor




                                                        mmatree is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                                                        Check out our Code of Conduct.









                                                        answered 1 min ago









                                                        mmatreemmatree

                                                        1




                                                        1




                                                        New contributor




                                                        mmatree is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                                                        Check out our Code of Conduct.





                                                        New contributor





                                                        mmatree is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                                                        Check out our Code of Conduct.






                                                        mmatree is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                                                        Check out our Code of Conduct.






























                                                            draft saved

                                                            draft discarded




















































                                                            Thanks for contributing an answer to Super User!


                                                            • Please be sure to answer the question. Provide details and share your research!

                                                            But avoid



                                                            • Asking for help, clarification, or responding to other answers.

                                                            • Making statements based on opinion; back them up with references or personal experience.


                                                            To learn more, see our tips on writing great answers.




                                                            draft saved


                                                            draft discarded














                                                            StackExchange.ready(
                                                            function () {
                                                            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fsuperuser.com%2fquestions%2f168971%2fuse-notepad-from-cygwin-without-having-the-shell-wait-for-an-exit-code%23new-answer', 'question_page');
                                                            }
                                                            );

                                                            Post as a guest















                                                            Required, but never shown





















































                                                            Required, but never shown














                                                            Required, but never shown












                                                            Required, but never shown







                                                            Required, but never shown

































                                                            Required, but never shown














                                                            Required, but never shown












                                                            Required, but never shown







                                                            Required, but never shown







                                                            Popular posts from this blog

                                                            Why not use the yoke to control yaw, as well as pitch and roll? Announcing the arrival of...

                                                            Couldn't open a raw socket. Error: Permission denied (13) (nmap)Is it possible to run networking commands...

                                                            VNC viewer RFB protocol error: bad desktop size 0x0I Cannot Type the Key 'd' (lowercase) in VNC Viewer...