Windows – Cygwin instead of cmd open from explorer

cygwin;windowswindows-explorer

I know that in explorer you can go to the address bar and type in cmd to open a command prompt for the directory you're currently in. What I'm looking for is a way to do the same thing with cygwin. Inside cygwin I can cd C: to break out of the installation folder and into any drive but I'm looking for a quick way to open cygwin in explorer to the path I'm already at.

I've added C:\cygwin to the Path and can run Cygwin.bat from anywhere (even the address bar of explorer) but it opens up to my cygwin home directory. How can I change that bat to allow what I'm wanting it to do?

Best Answer

You could edit your Cygwin.bat, or if you prefer, create a second batch file to go along with it that looks like this...

@echo off

C:
chdir %cd%

C:\cygwin\bin\bash.exe --login -i -c "cd '%cd%' && bash"

Running that from Explorer should give you what you're looking for.

Related Question