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

Clear input/output buffers on macOS upon TTY open #142

Merged
merged 1 commit into from
Dec 8, 2023
Merged

Clear input/output buffers on macOS upon TTY open #142

merged 1 commit into from
Dec 8, 2023

Conversation

astraw
Copy link
Contributor

@astraw astraw commented Nov 27, 2023

I don't understand why this works, but it resolves problematic behavior (#49) on macOS. Bisecting history, I found commit
3d6c1b2, which removed flushing the IO buffers for a TTY, was problematic on macOS. However, the test test_osx_pty_pair which tests pseudo-ttys with baud_rate 0 on macOS (introduced in b54264b) fails if I simply reintroduced flushing. Therefore, this change now re-introduces flushing the IO buffers upon opening a TTY, but only on macOS and only when baud-rate is non-zero.

Thanks to @berkus for the original work.

This supersedes #133.

I don't understand why this works, but it resolves problematic behavior
(#49) on macOS. Bisecting history, I found commit
3d6c1b2, which removed flushing the IO
buffers for a TTY, was problematic on macOS. However, the test
`test_osx_pty_pair` which tests pseudo-ttys with baud_rate 0 on macOS
(introduced in b54264b) fails if I
simply reintroduced flushing. Therefore, this change now re-introduces
flushing the IO buffers upon opening a TTY, but only on macOS and only
when baud-rate is non-zero.

Thanks to @berkus for the original work.
@astraw astraw mentioned this pull request Nov 27, 2023
Copy link
Contributor

@eldruin eldruin left a comment

Choose a reason for hiding this comment

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

Great, thank you for digging into this and finding a simpler solution.

@eldruin eldruin merged commit 7be36cb into serialport:main Dec 8, 2023
21 checks passed
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.

2 participants