-
Notifications
You must be signed in to change notification settings - Fork 835
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
Leading backslash in path that includes spaces during --import
causes help-text
#12383
Comments
Logs are required for review from WSL teamIf this a feature request, please reply with '/feature'. If this is a question, reply with '/question'. How to collect WSL logsDownload and execute collect-wsl-logs.ps1 in an administrative powershell prompt:
The script will output the path of the log file once done. If this is a networking issue, please use collect-networking-logs.ps1, following the instructions here Once completed please upload the output files to this Github issue. Click here for more info on logging View similar issuesPlease view the issues below to see if they solve your problem, and if the issue describes your problem please consider closing this one and thumbs upping the other issue to help us prioritize it! Closed similar issues:
|
Diagnostic information
|
Didn't repro on
|
@elsaco Weird. But a thing I'm noticing is everyone who offered does not have a space in their So I picked a path that doesn't contain a space on my other disk.
It's a strange edge-case which I don't think is intentional. |
--import
causes help-text--import
causes help-text
Logs are required for review from WSL teamIf this a feature request, please reply with '/feature'. If this is a question, reply with '/question'. How to collect WSL logsDownload and execute collect-wsl-logs.ps1 in an administrative powershell prompt:
The script will output the path of the log file once done. If this is a networking issue, please use collect-networking-logs.ps1, following the instructions here Once completed please upload the output files to this Github issue. Click here for more info on logging View similar issuesPlease view the issues below to see if they solve your problem, and if the issue describes your problem please consider closing this one and thumbs upping the other issue to help us prioritize it! Open similar issues:
Closed similar issues:
|
Shoo. Be appeased with the same file: WslLogs-2024-12-15_22-56-27.zip |
Diagnostic information
|
If $USERPROFILE has a space in it, then what you're seeing is unfortunately the expected behavior since that would split the path into two arguments before calling wsl. To work around this the simplest would be always quote arguments that might contain spaces:
|
@OneBlue That's the thing: I tried that in the various incantations to figure out why the command was failing. I did, verbatim, try: wsl --import NixOSTest "$env:USERPROFILE\NixOS\" nixos-wsl.tar.gz --version 2 But it still failed. It also seems like PowerShell is a bit intelligent to notice cases like wsl --import NixOSTest $env:USERPROFILE\NixOS nixos-wsl.tar.gz --version 2 Will work as expected. |
For posterity, I did expand the variable to my wsl --import NixOSTest "C:\Users\Jarrod Farrell\NixOS\" nixos-wsl.tar.gz --version 2 |
Windows Version
Microsoft Windows [Version 10.0.19045.5247]
WSL Version
2.3.26.0
Are you using WSL 1 or WSL 2?
Issue
Origin issue: nix-community/NixOS-WSL#606
Another user was able to do it with a leading backslash, so there might be something specific on my machine that's causing this weird behavior.
PowerShell Version:
5.1.19041.5247
The text was updated successfully, but these errors were encountered: