Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Try once again to fix stdin handling on Windows #907

Merged
merged 1 commit into from
Mar 2, 2022

Conversation

lmoureaux
Copy link
Contributor

@lmoureaux lmoureaux commented Feb 13, 2022

On Windows, there is apparently no unified non-blocking API to wait for
input on stdin. Thus, call the blocking API from a worker thread.

Tested the following use cases (before rebasing):

  • Starting from the Windows console
  • Starting from Windows Explorer (should be the same, but who knows)
  • Starting from the client (I guess stdin is a named pipe in this case)
  • Starting from the MSYS console (no idea what it uses, maybe a file)

The thread is only used on Windows, no reason for the extra overhead to
propagate to sane OSes.

Closes #850.

This should also be tested on Linux even though I don't expect differences there.

On Windows, there is apparently no unified non-blocking API to wait for
input on stdin.  Thus, call the blocking API from a worker thread.

Tested the following use cases:

* Starting from the Windows console
* Starting from Windows Explorer (should be the same, but who knows)
* Starting from the client (I guess stdin is a named pipe in this case)
* Starting from the MSYS console (no idea what it uses, maybe a file)

The thread is only used on Windows, no reason for the extra overhead to
propagate to sane OSes.

Closes longturn#850.
@lmoureaux lmoureaux marked this pull request as ready for review March 1, 2022 23:04
@lmoureaux lmoureaux requested a review from jwrober March 1, 2022 23:04
Copy link
Collaborator

@jwrober jwrober left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Works for me!

@jwrober jwrober merged commit 5f7c0af into longturn:master Mar 2, 2022
@lmoureaux lmoureaux deleted the bugfix/windows-stdin-again branch February 12, 2023 03: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.

Server started from Windows Explorer blocks on input
2 participants