fix: Auto-detect WSL and default to X11 for clipboard compatibility - #20
Merged
Conversation
WSL2 with WSLg has clipboard issues with the smithay-clipboard library (Wayland clipboard), causing GUI crashes on Windows 11. This change: - Adds WSL detection via /proc/version - Defaults to X11 on WSL (working clipboard via arboard) - Defaults to Wayland on native Linux - Adds --x11 and --wayland CLI flags to override defaults 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
birme
pushed a commit
to eyevinn-osaas/strom
that referenced
this pull request
Feb 2, 2026
fix: Auto-detect WSL and default to X11 for clipboard compatibility
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
/proc/versionto auto-detect when running under Windows Subsystem for Linux--x11and--waylandCLI flags to override the platform defaultsProblem
WSL2 with WSLg has clipboard issues with the smithay-clipboard library (Wayland clipboard), causing GUI crashes on Windows 11 with errors like:
The X11 server closed the connectionConnection reset by peerWinitEventLoop(ExitFailure(1))Solution
By detecting WSL and forcing X11 mode (setting
WAYLAND_DISPLAY=""), the application uses arboard's X11 clipboard implementation instead of the problematic smithay-clipboard Wayland implementation.Test plan
--x11flag on native Linux--waylandflag on WSL🤖 Generated with Claude Code