3 ms·
While we're on the topic of WSL2 causing issues, I will add one that I noted to the pile. If you have WSL2 installed then the first bash on PATH is the WSL2 ver
by tgbugs 6y ago
While we're on the topic of WSL2 causing issues, I will add one that I noted to the pile. If you have WSL2 installed then the first bash on PATH is the WSL2 version of bash. For whatever reason, this version of bash has a major impedance mismatch with Emacs and org-mode. From windows native Emacs (not an Emacs installed in WSL2) if you try to run an org babel block that contains bash code, whole commands will simply be ignored. The end result is that if you blindly execute bash blocks in Emacs on windows without checking which bash is being used there can be disastrous results because a seemingly safe script like `pushd some-folder; rm -r ; popd` suddenly becomes `rm -r ` without warning. I'm guessing that it has to do with mismatched line endings since mingw bash (aka git bash) doesn't have these issues. Also, you can't rely on the ordering of your PATH environment variable to protect you because updates can change it.
tl;dr WSL2 bash is not bash but it pretends to be and there are terrifying changes to the semantics of bash scripts as a result.
- oahuja 6y agoI have experienced this exact issue as well.