Skip to content

TUI hangs on startup with blank screen on WSL2 (no X server) #1773

@zlh124

Description

@zlh124

Description

On Linux, arboard::Clipboard::new() opens a blocking connect() to the X11 Unix socket (/tmp/.X11-unix/X0). When
no X server is running (headless, WSL2 without WSLg), the call hangs indefinitely. Because raw mode and the alternate
screen are already active at that point, Ctrl+C no longer generates SIGINT and the event loop hasn't started yet —
leaving the user with a blank screen and no way to exit.

Steps to reproduce

  1. Run WSL2 without WSLg (or any headless Linux without X server)
  2. Run deepseek-tui
  3. Observe the TUI never appears — blank alt-screen, unresponsive to Ctrl+C

Expected behavior

TUI starts normally, shows onboarding or chat interface. If clipboard is unavailable, it should gracefully fall back
to OSC 52 / pbcopy / PowerShell paths.

Actual behavior

Process hangs on connect(/tmp/.X11-unix/X0) with a blank alternate screen. Ctrl+C doesn't work because raw mode
suppresses SIGINT and the event loop hasn't started yet. The only way out is pkill -9 from another terminal.

Impact

100% reproducible on any Linux system without an X server. Blocks all WSL2 users who haven't installed WSLg or a
third-party X server.

Environment

  • OS: WSL2 (Linux 6.6.87.2-microsoft-standard-WSL2)
  • DeepSeek CLI version: 0.8.39 (eeccf7d)
  • Install method: source build
  • Model/provider: N/A (startup issue, never reaches model selection)
  • Terminal app: Windows Terminal
  • Shell: zsh

Logs, screenshots, or recordings

strace shows the process blocked on:
connect(5, {sa_family=AF_UNIX, sun_path="/tmp/.X11-unix/X0"}, 20)

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    Status
    Done

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions