WhitewaterFoundry / Pengwin

A Linux distro optimized for WSL based on Debian.
Other
1.48k stars 105 forks source link

Feature Request: Support appendWindowsPath=false in wsl.conf #749

Open enndubyu opened 2 years ago

enndubyu commented 2 years ago

Tab completion with appendWindowsPath=true is a nightmare on my system. Not only does it complete random .dlls in the system32 folder (which I would imagine is frustrating for all users), but I also have coreutils installed with scoop in windows which installs multiple shims for every binary in coreutils, so tab completion is always full of irrelevant junk like this: Screenshot 2022-08-23 180541

It would be nice to be able to set appendWindowsPath=false in my wsl.conf without breaking stuff like the cmd-exe script in /usr/local/bin and the start x410 init.d script. For me, I'd much rather manually add the few windows locations that I want in my $PATH. I've been able to get my system working fine by hardcoding the paths to the windows exe's in the aformetioned scripts and elsewhere on the system, but it would be nice for this to just work so I wouldn't have to worry about changes getting wiped out by updates or stuff that I've missed causing problems.

Not sure how much effort would be involved with something like this, but would be nice to have this option since being able to disable appendWindowsPath makes the system much nicer to use in my case (and I imagine many others).

enndubyu commented 1 year ago

I've settled on a workaround that is a lot simpler than the one I mentioned above while still having decent results: just leave appendWindowsPath at the default setting and use .bashrc to remove all of the windows paths except for the ones that pengwin needs.

Example:

export PATH=echo $PATH | sed 's/:/\n/g' | awk '!/\/mnt\/c\/Users/ && !/\/mnt\/c\/Program/ || /x410/' |
 xargs | tr ' ' ':'
export FIGNORE=".dll:.DLL"

This gets rid of all subdirs of Program Files except for x410's, and all subdirs of C:\Users\ (all my coreutils shims were in my home directory), but keeps everything else (including C:\Windows\system32 where pengwin looks for cmd.exe).

Finally, telling bash to ignore DLLs in tab completion gets me back to a place where there is rarely anything unexpected or irrelevant in my completion lists (there are still some EXEs in system32 that occasionally get completed, but the difference is night and day).

All that being said, I still think it would be preferable for pengwin to support non-default wsl.conf configurations.

crramirez commented 1 year ago

Excellent, thank you a lot for the contributions.