I tried the WSL and it isn't quite seamless enough for me. I ran in to problems when editing in VSCode and having watchers on my files (ng serve
, dotnet watch run
, etc.). In addition, I kept running in to problems that only manifest themselves when running in WSL. For example, this issue with doing production builds and the terser plugin has made many a developer rage-quit on using WSL. Just figuring out that it was an issue with the WSL took a lot of time.
That terser plugin issue was never resolved and I ended up having to keep a git bash window open in addition to my WSL console window so I could do production builds. To make matters worse, my npm packages were platform-dependent so I couldn't use the same project folder. So, my procedure was: commit whatever changes to test branch, push to repo, git pull
on my "windows" project folder, and do a production build there. It wasn't untenable but it was far from ideal.
- Install git with git bash.
- Install msys2. Follow instructions on that page and be sure to close window when it tells you to and reopen to complete setup.
- In a msys2 window, use Pacman to install tmux (
pacman -S tmux
). - Copy
tmux
andmsys-event
binaries from msys2 bin folder (probablyC:\msys64\usr\bin
) to git bash bin folder (probablyC:\Program Files\Git\usr\bin
). - Restart your git bash and try
tmux
command.
If everything went according to plan, you should see tmux running in your git bash:
If you run npm
commands, you get no progress spinner or colors. The solution is to use winpty (which is installed as part of the git bash
shell as it uses msys
). Here's an example of an npm install
with and without winpty:
To always use winpty, edit your bashrc (vim ~/.bashrc
) and add the following alias:
alias npm="winpty npm.cmd"
Quoting from this answer:
What terminal are you using?