Repository navigation
Description
Environment
- Windows 11 build 10.0.26200.9457
- WSL 3.0.3.0 (MSI install at
C:\Program Files\WSL, installed 2026-10-14) - Kernel
6.18.54.1-1, WSLg1.0.79 WSLServicerunning normally- Two registered distributions: Debian (default) and Ubuntu, both WSL2
HKCU\Software\Microsoft\Windows\CurrentVersion\Lxsskeys complete (11 values each,State=1,Flags=15)- AppX packages
Status = Ok wsl -d Debian -e ...,wsl -d Ubuntu -e ...,wsl --system -e ...all work correctly
Steps to reproduce
-
Open
cmd.exein a console window. -
Run:
wsl -l -vResult: the table prints correctly:
NAME STATE VERSION * Debian Running 2 Ubuntu Running 2wsl --statuslikewise prints默认发行版: Debian/默认版本: 2correctly. -
Run the same command with stdout redirected:
wsl -l -v > out.txt echo %ERRORLEVEL%Result:
out.txtis 0 bytes,%ERRORLEVEL%is 0. -
Run it through a pipe:
wsl -l -q | findstr .Result: downstream receives nothing.
Expected behavior
stdout should contain the same content regardless of whether stdout is a console, a pipe, or a file (as it did in WSL 2.x, where wsl -l -q produced UTF-16 output).
Actual behavior
Output is only emitted when stdout is a console handle. When stdout is redirected or piped, the command writes nothing at all — no error, no partial output — and still exits with code 0, so callers cannot distinguish "no distributions installed" from "the command is broken".
Also affected
wsl --statuswsl --list --onlinewsl --list --running,wsl --list --quiet(all variants)wslc container list(same CLI table-output layer)- inbox
C:\Windows\System32\wslconfig.exe /list→ also 0 bytes, exit 0
Not affected
wsl --version, wsl --help, and error messages from the same binary are written to a redirected stdout correctly (e.g. wsl --version > f.txt yields 362 bytes). So the problem is specific to the table/status output path.
Things already ruled out (all still reproduce)
- Removing
%USERPROFILE%\.wslconfigentirely WSL_UTF8=1/WSL_DISABLE_WARNINGS=1- Invoking
C:\Windows\System32\wsl.exevs"C:\Program Files\WSL\wsl.exe" - Running with no console attached vs. inside a real console window (spawned via
Start-Process): same result - Registry / AppX state: both
Lxsskeys and AppX packages are intact - Service state:
WSLServicerunning, binary versions consistent with the install directory
Impact
Any tool that enumerates distributions by capturing wsl.exe stdout is affected.
Concrete case: VS Code Remote-WSL (ms-vscode-remote.remote-wsl 0.104.3) calls
const e = await this.wslExecServer.runWSLCommandLine(["--list", "--verbose"]);
if (!e.status) return this.parseDistros(e.stdout, ...); // exit code is 0It gets an empty string, parses 0 distributions, logs No distros found, then its wslconfig /list fallback also returns nothing, and resolveAuthority(wsl) hangs until it is canceled (observed: 141 s / 218 s / 6 s before Canceled). From the user's perspective VS Code simply "cannot detect any WSL distribution".
Suspected cause
Regression in the 3.0.x CLI table-output rework (CLI: Table output with color and routing support, #40848): the table/status writer appears to take a console-only path (WriteConsoleW) and silently skips writing when stdout is not a console.
Activity
github-actions commentedon Oct 15, 2026
Logs are required for review from WSL team
If this a feature request, please reply with '/feature'. If this is a question, reply with '/question'.
Otherwise, please attach logs by following the instructions below, your issue will not be reviewed unless they are added. These logs will help us understand what is going on in your machine.
How to collect WSL logs
Download 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-wsl-logs.ps1 -LogProfile networkinginstead, following the instructions in Collect WSL logs for networking issuesOnce completed please upload the output files to this GitHub issue.
See Collect WSL logs (recommended method).
If you choose to email these logs instead of attaching them to the bug, please send them to [email protected] with the GitHub issue number in the subject, and include a link to your GitHub issue comment in the message body, and reply with '/emailed-logs'.
JiuJiuYeha commentedon Oct 16, 2026
wsl41937-repro-evidence.zip
Logs collected — plus two new findings: the bug is nondeterministic, and successful output is UTF-16LE
I collected logs with the official
collect-wsl-logs.ps1(default WPR profile) while reproducing. The full ETW trace (logs.etl, 1.15 GB raw) exceeds the GitHub attachment limit — happy to provide it on request (upload or email to [email protected]).New finding 1: the empty output is nondeterministic (~30/70).
Yesterday the repro was 100% deterministic (always 0 bytes). Today, while the WPR trace was running, the same command sometimes succeeds:
cmd.exe /c "wsl.exe --list --verbose > out.txt 2>&1"
WSL_UTF8=1Exit code is 0 in all 44 runs. Console code page (65001 / 936 / 437) showed no correlation. This suggests a race in the redirected-output path rather than a missing code path.
New finding 2: when output IS produced, it is UTF-16LE — even with
WSL_UTF8=1.Successful capture (
loop_2.txtin the zip) hex-dumps as20 00 20 00 4E 00 …and decodes to the correct table. So a consumer that redirects stdout gets UTF-16LE (nondeterministically) or nothing at all;WSL_UTF8=1has no effect on this path.wsl --statusappears to be a separate, deterministic bug: redirected output was 0 bytes in all runs — no nondeterminism observed.Attached:
wsl41937-repro-evidence.zip— all 44 repro output files (the empty ones are evidence too) +RESULTS-SUMMARY.txt+README.txt+ collection info.Environment: WSL 3.0.3.0 (MSI install), Windows 11 10.0.26200.9457, two healthy WSL2 distros (Debian default + Ubuntu).
github-actions commentedon Oct 16, 2026
No logs.etl found in the archive. Make sure that you ran
collect-wsl-logs.ps1as administrator and that thelogs.etlfile is in the archive.Diagnostic information
JiuJiuYeha commentedon Oct 16, 2026
WslLogs-2026-10-16_10-48-44.tar.gz
Full logs attached —
collect-wsl-logs.ps1output,logs.etlfrom a 15s WPR (WSL profile) capture withwpr -start/-stopboth exiting 0.Repro runs were executed inside the capture window, so the ETW trace contains the failing
wsl.exe --list --verboseinvocations.Two corrections/additions to my previous comment:
The bug is nondeterministic, not deterministic. Across 91 redirected runs in 4 rounds:
wsl --list --verboseproduced output in ~40% of runs (11/44, 7/20, 8/15, 7/12),wsl --statusin 2/7. Exit code is 0 in every single run. This looks like a race in the redirected-output path — worth checking whether the writer can exit before the console/output buffer is flushed when stdout is not a console.Correction to my previous comment: I wrote that
wsl --status"appears to be a separate, deterministic bug" — that was based on a small sample. It is also nondeterministic (2/7 non-empty).Also confirmed again: whenever output does appear it is UTF-16LE, even with
WSL_UTF8=1(e.g.repro/r2_status_2.txtstartsd8 9e= U+9ED8). Console code page (65001/936/437) has no effect.Archive contents:
logs.etl(44 MB),wpr.txt(start/stop codes), all repro captures from the 4 rounds inrepro/(empty files are evidence too) withFINAL-SUMMARY.txt, plus the standard environment files.github-actions commentedon Oct 16, 2026
Diagnostic information
chemwolf6922 commentedon Oct 16, 2026
Hi JiuJiuYeha .
Please attach a short Procmon PML covering one empty-output run and one successful wsl --list --verbose run. Capture File System and Process/Thread activity and save all events.
Please check that the log does not contain sensitive data before sharing.
JiuJiuYeha commentedon Oct 16, 2026
Hi Feng Wang, thanks for looking into this.
Background / how I got here: after upgrading to WSL 3.0, opening VS Code
could no longer connect into my WSL environment - it failed with a "distro not
found" style error. While debugging that I noticed
wsl --list/wsl --statussometimes print nothing when stdout is redirected or piped (exit code still 0),
which is what this issue is about.
Procmon capture attached (
wsl41937-procmon.tgz, 14 MB) as requested:One empty-output run and several successful runs of
wsl --list --verboseare all covered.Captured with Procmon64 using
/BackingFile, no filters applied, andall events saved - File System and Process/Thread activity included
(Profiling disabled).
Repro command:
cmd.exe /c "wsl.exe --list --verbose > run_N.txt 2>&1",every run exiting with code 0.
Exact timestamps of each run (UTC+8), from
runs-log.txtinside the archive:Sensitive-data check: before sharing, I scanned the capture for
credentials (JWTs,
token=/secret=/password=, bearer/authorizationheaders, private keys, AWS/GitHub key patterns) in both ASCII and UTF-16 -
zero matches. Processes that put tokens on their command lines (WeCom, VS
Code remote sessions) were closed during the capture window.
Extracting: the archive is gzip'ed tar containing an xz-compressed PML
(GitHub's 25 MB limit):
JiuJiuYeha commentedon Oct 16, 2026
wsl41937-procmon.tgz
chemwolf6922 commentedon Oct 22, 2026
Hi JiuJiuYeha .
Thanks for the capture. The data shows that some iOA (Tencent security software) logic (likely a bug) causes the process to terminate early during process shutdown. Which causes the output to be not flushed sometimes. The dll is
Txumon64.dll. Please consider reporting this to your IT or Tencent to investigate this failure.chemwolf6922 commentedon Oct 22, 2026
Closing this as the cause is external.
disk: a copied disk keeps WSL 3.0.2's user-only permissions (#120)