andfoy / winpty-rs

Create and spawn processes inside a pseudoterminal in Windows from Rust
Other
23 stars 7 forks source link

PR: Use WaitForSingleObject instead of GetExitCodeProcess to determine if the PTY process ended #26

Closed andfoy closed 2 years ago

andfoy commented 2 years ago

According to the Windows API documentation, GetExitCodeProcess may return STILL_ALIVE even if the process has ended. This may lead to infinite loops if a program is waiting for a PTY process to end by calling is_alive continuously.

codecov-commenter commented 2 years ago

Codecov Report

Merging #26 (00321c7) into main (bd8e16a) will increase coverage by 0.40%. The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main      #26      +/-   ##
==========================================
+ Coverage   76.96%   77.36%   +0.40%     
==========================================
  Files           8        8              
  Lines        1211     1224      +13     
==========================================
+ Hits          932      947      +15     
+ Misses        279      277       -2     
Flag Coverage Δ
unittests 77.36% <100.00%> (+0.40%) :arrow_up:

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
src/pty/base.rs 74.22% <100.00%> (+2.13%) :arrow_up:
tests/winpty.rs 97.85% <0.00%> (-0.72%) :arrow_down:
tests/conpty.rs 88.67% <0.00%> (-0.63%) :arrow_down:

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update bd8e16a...00321c7. Read the comment docs.