msys2 / MSYS2-packages

Package scripts for MSYS2.
https://packages.msys2.org
BSD 3-Clause "New" or "Revised" License
1.28k stars 483 forks source link

/etc/fish/msys2.fish is broken #1634

Open ohmree opened 5 years ago

ohmree commented 5 years ago

In /etc/fish/msys2.fish, on line 45 executing sh '/etc/msystem' only sets the environment for the child sh.
The solution I came up with is installing bass and replacing the sh line with:

source /home/username/.config/fish/functions/bass.fish
bass source /etc/msystem

With stock msys2.fish:

❯ which clang
/usr/bin/clang

❯ echo $PATH
/usr/local/bin /usr/bin /bin /c/Windows/System32 /c/Windows /c/Windows/System32/Wbem /c/Windows/System32/WindowsPowerShell/v1.0/ /usr/bin/site_perl /usr/bin/vendor_perl /usr/bin/core_perl

With my change:

❯ which clang
/mingw64/bin/clang

❯ echo $PATH
/mingw64/bin /usr/local/bin /usr/bin /bin /c/Windows/System32 /c/Windows /c/Windows/System32/Wbem /c/Windows/System32/WindowsPowerShell/v1.0/ /usr/bin/site_perl /usr/bin/vendor_perl /usr/bin/core_perl
cdglove commented 4 years ago

I just hit this exact issue too. It's been a year, any sign of a more permanent fix?

ohmree commented 4 years ago

Man this is old.

Nowadays I don't use MSYS2 but I do still use Fish with bax instead of bass (it's written in pure Fish which is a bonus).

Here's how it works, seems pretty simple to integrate into MSYS2. It's possible to inline the function into /etc/fish/msys2.fish if that's the only place this functionality is required, or otherwise perhaps have it available somewhere in /etc/fish.

I'm not going to do this since I don't use MSYS2 anymore but it seems like a pretty low-hanging fruit, assuming there's no problem with the approach I suggested.