Coder Social home page Coder Social logo

Comments (11)

craigloewen-msft avatar craigloewen-msft commented on July 17, 2024 1

I was able to repro this on my machine as well. Not sure what could be causing this but I'll file a bug for this on the WSL team and investigate!

@craigloewen-msft what is the issue number for the bug you filed? I can't see it on WSL github. Maybe it's fixed in the latest preview?

I filed an issue for this on our internal tracking

from powershell-wsl-interop.

mikebattista avatar mikebattista commented on July 17, 2024 1

Awesome. I just published 0.3.0 of the WslInterop package with the changes.

I'm going to close this as the remaining bug is in WSL 2 and @craigloewen-msft is tracking that separately.

from powershell-wsl-interop.

mikebattista avatar mikebattista commented on July 17, 2024

Thanks for reporting. I can repro on my machine as well. Actually just running dir | wsl less is also broken, so it appears to be some regression with WSL 2 and nothing specific to this module.

@craigloewen-msft any ideas what could be going on here?

from powershell-wsl-interop.

craigloewen-msft avatar craigloewen-msft commented on July 17, 2024

I was able to repro this on my machine as well. Not sure what could be causing this but I'll file a bug for this on the WSL team and investigate!

from powershell-wsl-interop.

Praful avatar Praful commented on July 17, 2024

@mikebattista - for this issue, I have set up WSL so that the default distro runs v1 and another distro runs v2. v2 works better with an xserver that I use to run Linux GUI apps. (I saw today that WSL is going to officially support Linux GUI apps :))

Ideally, I'd like the default to be v2 (so that I can just type wsl). Is there a way to tell wslinterop to use a specific distro - something like wsl -d <distro>?

from powershell-wsl-interop.

mikebattista avatar mikebattista commented on July 17, 2024

Not right now, but it could be easy to add. Now it relies on the default WSL distro (set by wsl -s) which in your case sounds like it would be the v1 distro, and you don't want to change that. Is that correct? Or would you be willing to change your default to the v2 distro via wsl -s? The benefit of that would be that any explicit wsl calls you make that don't go through WslInterop would also use the v2 distro without having to specify it.

If you're not willing to change your default WSL distro via wsl -s, when using wsl directly to pass through commands, if you add -d <nondefaultdistro> before the command to pass through (e.g. wsl -d <nondefaultdistro> ls), does that successfully invoke the command in the <nondefaultdistro>?

If so, I could add support like $WslDefaultParameterValues["-d"] = "<nondefaultdistro>" which would then get passed through to the wsl command via -d. So you could add that to your profile and all WslInterop calls will go through the v2 distro even if your default distro set in wsl is the v1 distro.

from powershell-wsl-interop.

Praful avatar Praful commented on July 17, 2024

Yes, please add a -d option.

I'd like to change my default WSL distro to v2, which currently doesn't work because of this issue. The new option will let me point WslInterop to a (non-default) v1 distro until the WSL team fix the WSL2 regression. Thanks

from powershell-wsl-interop.

Praful avatar Praful commented on July 17, 2024

I was able to repro this on my machine as well. Not sure what could be causing this but I'll file a bug for this on the WSL team and investigate!

@craigloewen-msft what is the issue number for the bug you filed? I can't see it on WSL github. Maybe it's fixed in the latest preview?

from powershell-wsl-interop.

mikebattista avatar mikebattista commented on July 17, 2024

Yes, please add a -d option.

I'd like to change my default WSL distro to v2, which currently doesn't work because of this issue. The new option will let me point WslInterop to a (non-default) v1 distro until the WSL team fix the WSL2 regression. Thanks

Could you try the changes at https://github.com/mikebattista/PowerShell-WSL-Interop/blob/wsl-d-parameter/WslInterop.psm1?

Just replace the .psm1 file on your system with the one from that branch, start a new PS session, then set $WslDefaultParameterValues["-d"] = "<distro>".

from powershell-wsl-interop.

Praful avatar Praful commented on July 17, 2024

Just replace the .psm1 file on your system with the one from that branch, start a new PS session, then set $WslDefaultParameterValues["-d"] = "<distro>".

Thank you very much for the quick change. That works perfectly!

from powershell-wsl-interop.

mikebattista avatar mikebattista commented on July 17, 2024

https://task.ms/32245206

from powershell-wsl-interop.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.