2
1
Initially asked on SO.com, but I closed it. I think it better fits SU.com. Please tell me if it is also not the right place.
I want to add a context menu to a .sh file to run it in cygwin.
I tried to manipulate the default "Open Cygwin here" command:
C:\cygwin\bin\mintty.exe -e /bin/xhere /bin/bash.exe "%L"
Unfortunately, all I get is a window that closes again immediately.
Also, I am not 100% sure, what is the purpose and the meaning of the arguments of xhere.
This is working:
C:\cygwin\bin\bash.exe %1
But I'd like to have mintty as terminal window.
Final Question:
Is there a way to add a command string to be executed to the "Open Cygwin here" string?
2
$(cygpath "%1")
will not work with paths that contain a space. Use$(cygpath -ms "%1")
instead. – user11153 – 2015-05-20T12:13:05.7801Nice finding. I won't pull it into my answer, because depending on how your HDD has been formatted, the old 8.3 format might be unsupported. Anyway: For me it works even without the
-ms
switch! This is my console then:Starting /bin/bash.exe >> xxx@xxx /cygdrive/c/Program Files
I think it is a question of setting the right quotes. – Nippey – 2015-05-20T16:03:36.037