-
Notifications
You must be signed in to change notification settings - Fork 147
[Linux] Fix hanging terminal #944
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
Conversation
cca3622
to
e05601d
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! Just tried it and works perfectly! Ill try to understand whats going on on Monday
Kudos for this deep dive @bugadani! I'm sorry that did not manage to to look deeper into it so far, but I gave the fix from this PR a spin on macOS 15.6 on a M1 machine. I still end up in a locked state after about ten key strokes in the monitor. |
Thanks for trying! I think it's not too surprising that a 1:1 port doesn't work - it took me quite a bit of trial and error to figure out something working. Can you perhaps share your code? Maybe it's a good enough start to work on. |
I just ran espflash as of e05601d on macOS as follows:
There was no bespoke code involved. |
Ah all the workarounds here are gated for linux (macos has a different timer API), and the small throttling shouldn't really affect much if the second flush never returns :) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thanks! Im trying to investigate and port this changes to MacOS!
Edit: Mind rebasing your changes to resolve the conflict?
I'm sorry for the noise! I misread the description that this PR also applies to macOS and did not notice the gating. Thank you for #947 @SergioGasquez! |
Some terrible timer+signal hackery but this seems to be the recommended way in case tcdrain blocks indefinitely.
I've also added a bit of a flush-throttling so that we're not completely swamped by timeouting blocking calls on every keypress if the user mashes the keyboard.
The reason for all this is that nothing moves the data out of the USB endpoing on the device, so it doesn't accept new data.
I don't feel qualified, prepared or well enough equipped to try this on macOS.
cc #681