Closed yumengch closed 3 years ago
Looks promising. I'm a little surprised that select
works all the way. As you saw in the gist, previously I could only get it to work for
select.select([sys.stdin], [], [], 0) == ([sys.stdin], [], []):
in a function called kbhit
, to mimic the Windows solution.
selection
-based method is the way to go.Otherwise I think the thread-based method is the way to go.
There are 51 commits in this PR, most of which have long since been merged. I don't know why. But it does not look good for the history, and slightly complicates discussions. So we need to fix this. Please let me know if the issue is caused on my side.
- Indeed it is my fault. I squashed some commits and I think I should properly organize my repo and rebase commits after this pull request.
Works like a charm, also on Mac 😁
Congrats and thanks!
So, if I've understood correctly: this
TS_new[6][termios.VMIN] = 0
TS_new[6][termios.VTIME] = 0
seems to have caused an issue on WSL, while the new solution using select
does not seem to cause issues on any platform that we have tested.
So, if I've understood correctly: this
TS_new[6][termios.VMIN] = 0 TS_new[6][termios.VTIME] = 0
seems to have caused an issue on WSL, while the new solution using
select
does not seem to cause issues on any platform that we have tested.
Good news. Yes, this seems to be the problem.
In the end, I realise the non-canonical mode still works in WSL so I simply use
select
instead of settingVMIN
andVTIME
to 0. This leads to very little change in the code.I also added the
disable_user_interaction
output.