#1506·wslg

WSLg does not play nice with AutoHotKey - forced to go back to VcXsrv (X server)

Author: ananthchellappaCreated Sep 3, 2026Updated Sep 9, 2026

AutoHotKey is a great windows scripting utility that boosts productivity in manipulating windows.

The msrdc layer is where the break is.

From Claude Code :

The short version: the piece we need to fix is open, and one of your three symptoms turns out to be a literal //TODO in code you can rebuild.

What actually got open-sourced

WSL's core went open source in May 2025 (microsoft/WSL), joining microsoft/wslg, the Weston/FreeRDP/PulseAudio mirrors, and the WSL2 kernel. The stated exceptions are lxcore.sys (WSL1) and the \wsl.localhost 9P redirector.

But msrdc.exe was never part of that. Your C:\Program Files\WSL\ folder has it next to rdclientax.dll and rdpnanoTransport.dll — it's vendored as the Microsoft.RemoteDesktop.Client.MSRDC.SessionHost NuGet package, the same closed client shipped for Azure Virtual Desktop. So the chain is:

gedit ──► Weston + rdprail-shell ──► FreeRDP 2.4.0 (server) ──► RDP/RAIL over vsock OPEN OPEN ──► msrdc.exe ──► RAIL_WINDOW proxy ──► your AHK script CLOSED

Both ends of the problem are open source. Only the middleman isn't.