Skip to content

Add timeout to host WSL command to prevent startup freeze - #789

Open
RawJat wants to merge 1 commit into
athasdev:mainfrom
RawJat:fix/wsl-startup-timeout
Open

RawJat wants to merge 1 commit into
athasdev:mainfrom
RawJat:fix/wsl-startup-timeout

Conversation

@RawJat

@RawJat RawJat commented Nov 8, 2026 •

Copy link
Copy Markdown

Summary

  • run_host_wsl calls command.output() with no deadline; when WSL is not installed the System32 wsl.exe stub hangs for ~60s before returning REGDB_E_CLASSNOTREG, freezing the entire app during bootstrap
  • Replace the blocking call with spawn + poll loop capped at 5 seconds; if wsl.exe does not exit in time it is killed and an error is returned so list_distributions gracefully fails

Test plan

  • On a Windows machine without WSL installed, launch Athas and confirm it becomes interactive within a few seconds (previously took ~60s)
  • On a Windows machine with WSL installed, launch Athas and confirm WSL distributions still appear in the terminal shell dropdown
  • Open a WSL terminal session and verify it connects and runs commands normally
  • cargo test -p athas-wsl passes

Fixes #788

run_host_wsl blocks on command.output() with no deadline. When WSL
is not installed the stub wsl.exe in System32 hangs for roughly 60
seconds before returning REGDB_E_CLASSNOTREG, freezing the entire
app during bootstrap.

Replace the blocking call with spawn + poll loop capped at 5 seconds.
If wsl.exe does not exit in time it is killed and an error is returned,
so list_distributions gracefully fails and the shell list falls back to
non-WSL entries.

Fixes athasdev#788
@RawJat
RawJat force-pushed the fix/wsl-startup-timeout branch from 4c9adcb to ac4cea3 Compare November 8, 2026 20:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

App freezes for ~60s on every startup (bootstrap phase hangs)

2 participants