Skip to content

Instantly share code, notes, and snippets.

Created January 5, 2018 16:29
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save Dillie-O/1f8670b3f7ecc0a8c5f5a662919dcdd1 to your computer and use it in GitHub Desktop.
[WSL Remove Win Path in ZSH] Remove windows specific path from WSL environment in ZSHRC #wsl #environment #configuration
# Remove Windows paths to Ruby since it causes conflicts with npm/bower/etc.
PATH=$(echo :$PATH: | sed -e 's,:/mnt/c/tools/ruby22/bin:,:,g' -e 's/^://' -e 's/:$//')
Copy link

Rinat84 commented Sep 22, 2023

1st step - Disable Windows path on WSL
Option A: Add to wsl.conf (after Build 17093)

sudo nano /etc/wsl.conf

Then add

appendWindowsPath = false

then Ctrl+S then Ctrl+X then exit.

2nd step - Restart WSL
Option A:
Simple reenter WSL and test:

echo $PATH
Option B:
Run at PowerShell as Admin:

Restart-Service LxssManager
Option C:
Terminating WSL from PowerShell as Admin using

wslconfig /t Ubuntu

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment