Skip to content

pty: Implement TCSBRK and TCFLSH#12915

Merged
copybara-service[bot] merged 2 commits intomasterfrom
test/cl897772400
Apr 10, 2026
Merged

pty: Implement TCSBRK and TCFLSH#12915
copybara-service[bot] merged 2 commits intomasterfrom
test/cl897772400

Conversation

@copybara-service
Copy link
Copy Markdown

pty: Implement TCSBRK and TCFLSH

Linux PTYs accept TCSBRK as a no-op and implement TCFLSH by flushing the input and/or output queues. gVisor returned ENOTTY, which breaks programs such as pyserial during terminal setup.

Handle TCSBRK in the PTY ioctl paths and route TCFLSH through lineDiscipline.tcFlush(), including packet mode flush notification and queue wakeups, to match Linux PTY semantics.

FUTURE_COPYBARA_INTEGRATE_REVIEW=#12914 from tanyifeng:pty-tcsbrk-tcflsh e00ca0a

Linux PTYs accept TCSBRK as a no-op and implement TCFLSH by
flushing the input and/or output queues. gVisor returned ENOTTY,
which breaks programs such as pyserial during terminal setup.

Handle TCSBRK in the PTY ioctl paths and route TCFLSH through
lineDiscipline.tcFlush(), including packet mode flush notification
and queue wakeups, to match Linux PTY semantics.

Signed-off-by: Tan Yifeng <yiftan@tencent.com>
@copybara-service copybara-service Bot added the exported Issue was exported automatically label Apr 10, 2026
@copybara-service copybara-service Bot merged commit c83005f into master Apr 10, 2026
@copybara-service copybara-service Bot deleted the test/cl897772400 branch April 10, 2026 19:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

exported Issue was exported automatically

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants