msys2 / msys2-launcher

Helper for launching MSYS2 shells

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

how to open the msys2 shell at a specified path

cjwddtc opened this issue · comments

If you're using the .exe launchers (the ones that this repository is about), it's enough to uncomment the CHERE_INVOKING=1 line in the .ini file of the launcher (or in all three .ini files) located in your MSYS2 root.

After that, the shell will open in the directory from where it was called. If you're in a Windows command prompt, it will be the current working directory. Otherwise, you can create a shortcut and specify the starting directory in its properties.

Does that work for you?

I think this method is okay for most use cases and OP hasn't responded. Closing.

Hi,
I'm using context menu for a "MINGW64 here" command in explorer.
It works fine for Directory\Background using this registry entry:

[HKEY_CURRENT_USER\Software\Classes\Directory\Background\shell\MINGW64 here\command]
@="C:\\dev\\msys64\\mingw64.exe"

But for Directory I have to use the msys2_shell.cmd where I can set the where option or else it will open in the parent directory or c:\windows\system32...

[HKEY_CURRENT_USER\Software\Classes\Directory\shell\MINGW64 here\command]
#@="C:\\dev\\msys64\\mingw64.exe # not working"
@="C:\\dev\\msys64\\msys2_shell.cmd -mingw64 -where \"%1\""

Sure, it works but it just isn't pretty, and I get the msys2.exe application icon instead of mingw64.exe icon...

So I'm also interested in this feature.