microsoft / wslg

Enabling the Windows Subsystem for Linux to include support for Wayland and X server related scenarios
MIT License
9.9k stars 296 forks source link

.wslconfig hyphen and underscore parsing / encoding issue #1173

Open yumasheta opened 6 months ago

yumasheta commented 6 months ago

Windows build number:

22621.2861 [Version 10.0.22621.2861]

Your Distribution version:

22.04

Your WSL versions:

WSL version: 2.0.9.0
Kernel version: 5.15.133.1-1
WSLg version: 1.0.59
MSRDC version: 1.2.4677
Direct3D version: 1.611.1-81528511
DXCore version: 10.0.25131.1002-220531-1700.rs-onecore-base2-hyp
Windows version: 10.0.22621.2861

Steps to reproduce:

I tried configuring the wslg with options from: the docs. I attached the exact file I am using, renamed so it's accepted as an attachment.

wslconfig.txt

WSL logs:

weston.log

stderr.log

WSL dumps:

No response

Expected behavior:

No response

Actual behavior:

When launching the WSL and checking in the event viewer, I get the following error logged:

Expected ']' in C:\Users\myuser\.wslconfig:3
Expected '=' in C:\Users\myuser\.wslconfig:4
Expected '=' in C:\Users\myuser\.wslconfig:5
Expected '=' in C:\Users\myuser\.wslconfig:6

and none of the settings from the system-distro-env section apply.

By playing around with the file, I was able pin it down to the hyphen in the section name and the underscores in the key names. Somehow they aren't parsed correctly. When removing the hyphens and underscores I get unknown key errors instead. And when removing the system-distro-env section entirely, it works normally. The file is UTF-8 with (CLRF).