Repository navigation
Commit 43cd698
3code
fix Windows getchr hang: drain termPeeked before _getch
On Windows getchr was a direct _getch import, so it never drained
termPeeked (unlike the POSIX branch). When the "getchr drains termPeeked"
test set termPeeked='Z' and called getchr(), _getch ignored the peeked
byte and blocked waiting for a real keypress, hanging the Windows test
run for the full timeout. Wrap _getch in a getchr that returns the
peeked byte first, matching POSIX.1 parent 891d0de commit 43cd698
1 file changed
Lines changed: 12 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
71 | 71 | | |
72 | 72 | | |
73 | 73 | | |
74 | | - | |
75 | | - | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
76 | 86 | | |
77 | 87 | | |
78 | 88 | | |
| |||
0 commit comments