You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
WSL API missing function to enumerate installed distributions #4644
Consuming the WSL API requires developers to populate the distribution name parameter for most functions. There is no API to retrieve a list of valid distribution names, however, and none of the APIs support a nullptr input to signify the user's default distribution should be used, as general Win32 programming patterns would nudge you towards.
How are developers meant to consume these APIs? The dev story seems incomplete.
Trick to turn this tag feature, contrast death by tag discussion ref #3515, is providing the use case for your AP change request. [With no implication there is no use case. But that's how the dupe died two weeks after it was opened.]
This submission is spiritually similar to #3515. #3515 was a discussion thread (label/tag 'discussion') that ran course and was closed. The hope is some use cases for the implied API enhancement are provided, thumbs up on the OP appear, and this one (which to be clear is entirely sensible) has a better chance than #3515. Question / observational commentary ("How are developers meant to consume these APIs? The dev story seems incomplete"), on a statistical basis anyway, usually end up chirping crickets.
Thanks for clarifying. (I fundamentally have an issue with your ability to label/close issues using an imaginary rubric and without Microsoft involvement.)
In this particular case, Microsoft is providing an API that is useless without the enumeration capability and I'd continue to argue this is a bug.
Reacted by Daniel Niccoli, skycommand, Thor K. Høgås, Stephen McDaniel, Hernan Martinez and geekstuff-dev
+1 to enumerate wls list via the API. I'm building a remoting terminal that also supports WSL but I can't list them to the user without having to parts executable output. Would love if I could query for it instead of parsing text.
Activity
Biswa96 commentedon Nov 4, 2019
The Microsoft-ish suggestion is to parse the output of
wsl.exe -l -vcommand. You can use the other way, you-know-what.riverar commentedon Nov 4, 2019
Ha, parsing executable output is not a solution.
therealkenc commentedon Nov 6, 2019
Trick to turn this tag feature, contrast death by tag discussion ref #3515, is providing the use case for your AP change request. [With no implication there is no use case. But that's how the dupe died two weeks after it was opened.]
riverar commentedon Nov 9, 2019
therealkenc no idea what your comment means, looks like a typo?
therealkenc commentedon Nov 9, 2019
This submission is spiritually similar to #3515. #3515 was a discussion thread (label/tag 'discussion') that ran course and was closed. The hope is some use cases for the implied API enhancement are provided, thumbs up on the OP appear, and this one (which to be clear is entirely sensible) has a better chance than #3515. Question / observational commentary ("How are developers meant to consume these APIs? The dev story seems incomplete"), on a statistical basis anyway, usually end up chirping crickets.
riverar commentedon Nov 9, 2019
Thanks for clarifying. (I fundamentally have an issue with your ability to label/close issues using an imaginary rubric and without Microsoft involvement.)
In this particular case, Microsoft is providing an API that is useless without the enumeration capability and I'd continue to argue this is a bug.
javierdlg commentedon Jun 12, 2020
+1 to enumerate wls list via the API. I'm building a remoting terminal that also supports WSL but I can't list them to the user without having to parts executable output. Would love if I could query for it instead of parsing text.
TBBle commentedon Jun 21, 2020
I think this API would also improve the Windows Terminal support for autogenerating profiles for WSL distros, which currently contains 70 lines of boilerplate code to call and parse
wsl --list(plus six more), before 12 lines of actual code.I assume the Windows Terminal team would rather consume an API from wslapi.h than maintain this code, but haven't checked.
Biswa96 commentedon Apr 29, 2021
From Build 21327, it has been easier to enumerate WSL-ed distributions with undocumented IWslSupport COM interface. Something is coming... 🔍