Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
enndubyu opened this issue Aug 24, 2022 · 2 comments
Open

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

enndubyu opened this issue Aug 24, 2022 · 2 comments
Labels
Workaround We have a workaround for this issue.

Comments

@enndubyu
Copy link

enndubyu commented Aug 24, 2022

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 enndubyu changed the title Support appendWindowsPath=false in wsl.conf Feature Request: Support appendWindowsPath=false in wsl.conf Sep 21, 2022
@enndubyu
Copy link
Author

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
Copy link
Collaborator

Excellent, thank you a lot for the contributions.

@crramirez crramirez added the Workaround We have a workaround for this issue. label Nov 20, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Workaround We have a workaround for this issue.
Projects
None yet
Development

No branches or pull requests

2 participants