From 3ef7613fe5363feb083193b7e34be9a696fdfb65 Mon Sep 17 00:00:00 2001 From: Julius Marminge Date: Sat, 14 Nov 2026 14:51:21 +0000 Subject: [PATCH 1/2] test(server): editor launches from a boot service recover XDG_SESSION_TYPE Reproduces #36781: the session display recovered from the systemd user manager omits XDG_SESSION_TYPE, so Electron editors fall back to X11. Co-Authored-By: Claude Opus 5.5 --- apps/server/src/process/externalLauncher.test.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/apps/server/src/process/externalLauncher.test.ts b/apps/server/src/process/externalLauncher.test.ts index 4f6cabb783be9..97c8fe2810d27 100644 --- a/apps/server/src/process/externalLauncher.test.ts +++ b/apps/server/src/process/externalLauncher.test.ts @@ -274,6 +274,7 @@ it.effect.skipIf(windowsHost)( "HOME=/home/user", "WAYLAND_DISPLAY=wayland-1", "XAUTHORITY=/home/user/auth files/cookie", + "XDG_SESSION_TYPE=wayland", ], }), }), @@ -283,6 +284,8 @@ it.effect.skipIf(windowsHost)( WAYLAND_DISPLAY: "wayland-1", // Raw, not the $'...' quoting `systemctl show-environment` would print. XAUTHORITY: "/home/user/auth files/cookie", + // Electron editors pick X11 over Wayland without it, and render at the wrong scale. + XDG_SESSION_TYPE: "wayland", }, ); assert.deepEqual(yield* launchEnv({ stdout: "invalid JSON" }), { PATH: binDir }); From 286f51aeacf113032ffb01274ec2d80b765b0916 Mon Sep 17 00:00:00 2001 From: Julius Marminge Date: Sat, 14 Nov 2026 14:55:36 +0000 Subject: [PATCH 2/2] fix(server): editors opened from a boot-started service get the desktop's session type Electron editors such as VS Code fall back to X11 on a Wayland session when XDG_SESSION_TYPE is missing, and render at a different scale. Recover it from the systemd user manager along with the display variables. Fixes pingdotgg/t3code#36781 Co-Authored-By: Claude Opus 5.5 --- apps/server/src/process/externalLauncher.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/apps/server/src/process/externalLauncher.ts b/apps/server/src/process/externalLauncher.ts index bb38a9d56afd4..5030694756c53 100644 --- a/apps/server/src/process/externalLauncher.ts +++ b/apps/server/src/process/externalLauncher.ts @@ -752,6 +752,7 @@ const GRAPHICAL_SESSION_ENV_KEYS: ReadonlySet = new Set([ "DISPLAY", "WAYLAND_DISPLAY", "XAUTHORITY", + "XDG_SESSION_TYPE", ]); // The user manager's environment over D-Bus. `systemctl show-environment` would