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

Auto Resolve tilde ~ to Windows User Directory #54

Open
cardin opened this issue Jul 25, 2024 · 0 comments
Open

Auto Resolve tilde ~ to Windows User Directory #54

cardin opened this issue Jul 25, 2024 · 0 comments

Comments

@cardin
Copy link

cardin commented Jul 25, 2024

Is your feature request related to a problem? Please describe.
Currently, ~ paths are resolved to Linux user directories.

E.g. vim ~/.ssh/config is actually (Linux) vim /home/$USER/.ssh/config rather than (Windows) vim $env:USERNAME/.ssh/config

Describe the solution you'd like
A clear and concise description of what you want to happen.

Using tildes ~ should resolve to the Windows user directory.

Describe alternatives you've considered
As a quick patch, add the following line to WslInterop.psm1, within the for loop of path argument translation, as the last instruction of the for loop:

if (`$args[`$i].StartsWith("~")) {
   `$args[`$i] = `$args[`$i] -replace "^~", "/mnt/c/Users/`$env:USERNAME"
}

Additional context
Add any other context or screenshots about the feature request here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant