Remove Windows executables from your WSL Linux path
Windows and WSL interoperability is fantastic but sometimes you end up with unintended side effects. When coding I like to have specific tools and configurations for each environment. Otherwise, I can get pathing or other problems. Why is it complaining about a '\r' character when I'm running Linux? It is because some Linux tools and Windows files collide with each other. With that in mind, you may wish to remove the Windows executables from your Linux $PATH. There are two ways to configure the WSL to not import the Windows $PATH. You can disable or enable it on a per WSL instance basis. You can globally configure WSL so that the PATHbehavior is the same for all WSL instances you have configured. Configuring individual WSL instances with wsl.conf Each individual WSL instance looks in its own configuration file /etc/wsl.conf that may not be created by default in your WSL instance. 1. Edit the existing /etc/wsl.conf . Creat...