Skip to content

fix: stop LocalBackend execute hanging on Windows date/time - #108

Open
khuzaymahbinharis-jpg wants to merge 1 commit into
vstorm-co:mainfrom
khuzaymahbinharis-jpg:fix/local-execute-noninteractive-stdin
Open

fix: stop LocalBackend execute hanging on Windows date/time#108
khuzaymahbinharis-jpg wants to merge 1 commit into
vstorm-co:mainfrom
khuzaymahbinharis-jpg:fix/local-execute-noninteractive-stdin

Conversation

@khuzaymahbinharis-jpg

Copy link
Copy Markdown

Summary

  • Close stdin with DEVNULL for foreground LocalBackend.execute() and async_execute(), matching the existing background-process behavior.
  • Prevent interactive Windows shell built-ins such as date and time from blocking until the execution timeout.
  • Add regression coverage for both synchronous and asynchronous execution.

Fixes #103

Why

On Windows, commands run through cmd /c. Bare date and time are interactive commands: after displaying the current value, they wait for user input.

LocalBackend does not expose stdin to callers, so foreground executions should be non-interactive. Passing DEVNULL causes these commands to receive EOF immediately rather than hanging until timeout.

Testing

Passed:

  • uv run ruff check .
  • uv run ruff format --check .
  • Sync and async DEVNULL regression tests
  • Windows date / time regression tests
  • Existing ordinary command execution coverage

On Windows, date and time now return immediately rather than waiting for the configured execution timeout.

The broader test/typecheck commands expose existing Unix-specific assumptions when run on Windows, including Unix commands/filesystem behavior such as sleep, pwd, os.chown, Unix permissions and /tmp. These failures are unrelated to this change.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Triage

Development

Successfully merging this pull request may close these issues.

LocalBackend.execute("date") hangs on Windows because cmd.exe date/time are interactive

2 participants