back to GitHubPages

14 Sep 2023

MSYS2 and I

I stumbled into MSYS2 from GitHub Pages, which wants e.g. jekyll, nokogiri, kramdown,
which in turn want Ruby, which bundles MINGW64 and MSYS2.
A long time Cygwin and more recent WSL user,
MSYS2 immediately impressed with its responsive bash shell
and pleasant integration of Posix and Windows executibles.
Fighting pacman in Ruby's msys64/ folder quickly led to a separate MSYS2 installation,
with Ruby's bin/ folder early in its $PATH for jekyll.
Over time, using Ruby's icon and shortcut redirected to the separate MSYS2 installation,
I eventually forgot that my MSYS2 was NOT Ruby's...

Unplanned obsolescence

Fighting Visual Studio's obnoxious C# editor, I wanted to use indent, but pacman was substantially broken.
At this point, I rediscovered that my MSYS2 pacman was NOT Ruby's, which remains thoroughly broken...
The MSYS2 pacman default keyserver was hacked several years ago;  instead of merely fixing that website, it was abandoned.
Trying to use a new keyserver with that old pacman worked only for MSYS2 packages, where e.g. MINGW64 packages are wanted.
After wasting hours failing to fix it, a new MSYS2 installation was accomplished in minutes:
R:\TEMP>certUtil -hashfile msys2-x86_64-20230127.exe SHA256
SHA256 hash of msys2-x86_64-20230127.exe:
d05c0618027299e9a0834de968596c41bd2012ed8b2534b114a3b9d3fca56809
CertUtil: -hashfile command completed successfully.
then my old MSYS2 installation's home/ folder was moved into it.
While I much prefer MSYS2 Bash for command line, Windows Explorer is used for much file and folder manipulation.
GVIM launched from Bash uses a profile weirdly different from that launched from Explorer...?
Attempting to compare pacman -Q results between installations was doomed.  These packages were added:
  • mingw-w64-x86_64-indent
  • mingw-w64-x86_64-diffutils
Here are potentially useful contents from my .bash_profile,
which includes alias to invoke align.bat and imgdiff.bat DOS-style .bat files from within bash.

Open MinGW64 shell from Windows Explorer

Integrating Bash shell usage with Windows wants easily opening a shell in any folder:


This capability is implemented via Windows registry; bash.reg can do that,
provided that the path to msys2_shell.cmd matches your installation:
Windows Registry Editor Version 5.00

[HKEY_CLASSES_ROOT\Directory\shell\bash]
@="Open bash window here"
"NoWorkingDirectory"=""
"NeverDefault"=""
"Icon"="D:\msys64\mingw64.exe"

[HKEY_CLASSES_ROOT\Directory\shell\bash\command]
@="D:\msys64\msys2_shell.cmd -mingw64 -where \"%V\""
If (as happened to me) Windows complains about not a default application, then code directly in RegEdit:


installed MSYS2 packages

maintained by blekenbleu