Simple tricks: “cyghere”: open Cygwin shell here

I’m sure there’s other solutions out there, but I’ll share mine.

  • Create a directory on your system and add it to your path. In my case, I use C:\scripts.
  • Create a script, cyghere.bat, as follows (assuming cygwin is installed to C:\cygwin):
    start C:\cygwin\bin\mintty.exe -i /Cygwin-Terminal.ico --exec /bin/bash
    

Now, you can launch a cygwin shell from basically any program that lets you launch subprocesses. Most common for myself is either the Windows command prompt or Windows Explorer.

Tip: if you have a folder open via Windows Explorer and you want to “cygwin here”, press Alt-D to jump to the location bar, then type “cyghere” and press Enter. This also works!

For a right-click option to open a folder via Cygwin, I defer to the rest of the Internet. 🙂 With the above, I generally don’t need the right-click option.

Leave a Reply

Your email address will not be published. Required fields are marked *