Skip to content

Code incorrectly assumes wsl.exe outputs UTF-16LE when the WSL_UTF8 environment variable is set #276253

@integerbang

Description

@integerbang

Type: Bug

Visual Studio Code seems to expect wsl.exe to output in UTF-16LE, which typically doesn't cause problems unless WSL_UTF8=1 is set. In which case, wsl.exe outputs UTF-8 instead, causing distribution names to be interpreted incorrectly:

Image

To reproduce:

  1. Set up a WSL distribution.
  2. Add a new user environment variable named WSL_UTF8 with its value set to 1.
  3. Open Code, press Ctrl+Shift+P (Command Palette), and then type and enter Create New Terminal (With Profile) to look at the list of Terminal profiles.

The profiles ending in (WSL) should list the actual names for each distribution. Instead, they are incorrectly displayed as garbled text.

VS Code version: Code 1.105.1 (7d842fb, 2025-10-14T22:33:36.618Z)
OS version: Windows_NT x64 10.0.26200
Modes:

System Info
Item Value
CPUs 12th Gen Intel(R) Core(TM) i5-1235U (12 x 2496)
GPU Status 2d_canvas: enabled
direct_rendering_display_compositor: disabled_off_ok
gpu_compositing: enabled
multiple_raster_threads: enabled_on
opengl: enabled_on
rasterization: enabled
raw_draw: disabled_off_ok
skia_graphite: disabled_off
trees_in_viz: disabled_off
video_decode: enabled
video_encode: enabled
vulkan: disabled_off
webgl: enabled
webgl2: enabled
webgpu: enabled
webnn: disabled_off
Load (avg) undefined
Memory (System) 7.69GB (0.54GB free)
Process Argv --crash-reporter-id 146bd52b-6676-45ec-a263-24c5e71e8f7a
Screen Reader no
VM 0%
Extensions (7)
Extension Author (truncated) Version
remote-wsl ms- 0.104.3
cmake-tools ms- 1.21.36
cpptools ms- 1.28.3
cpptools-extension-pack ms- 1.3.1
hexeditor ms- 1.11.1
makefile-tools ms- 0.12.17
cmake twx 0.0.17

(1 theme extensions excluded)

A/B Experiments
vsliv368:30146709
vswsl492cf:30256860
binariesv615:30325510
nativeloc1:31344060
dwcopilot:31170013
dwoutputs:31242946
copilot_t_ci:31333650
e5gg6876:31282496
pythonrdcb7:31342333
aj953862:31281341
b6b4d950:31327385
nes-set-on:31340697
testaa123:31335226
6abeh943:31336334
c12345:31413568
0574c672:31404437
cloudbuttont:31379625
todos-1:31405332
v66_all_req:31402695
treatment_gpt5applypatchexclusively:31412086
3efgi100_wstrepl:31403338
trigger-command-fix:31379601
auto_model_enabled:31385282
use-responses-api:31390855
applesignin:31399435
anonusage:31403420
d5i5i512:31405346
ff8f5884:31411053

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions