FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

resolve issues with termios package to fix 'stty speed xxyyzz' by rminnich · Pull Request #3770 · u-root/u-root · GitHub

/ u-root Public

resolve issues with termios package to fix 'stty speed xxyyzz' - #3770

Merged
rminnich merged 6 commits into
u-root:mainfrom
rminnich:stty2
Oct 2, 2026
Merged

rminnich merged 6 commits into
u-root:mainfrom
rminnich:stty2

Conversation

Copy link
Copy Markdown
Member

baud rate setting never worked on Linux, fix that.

Fix improper code in this package (all of it my fault ...)

rminnich requested review from MDr164, abarisani, binjip978 and brho and a balanced review from Copilot September 30, 2026 21:53
rminnich added the Awaiting reviewer Waiting for a reviewer. label Sep 30, 2026

codecov Bot commented Sep 30, 2026 •
edited
Loading

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 38.09524% with 13 lines in your changes missing coverage. Please review.
✅ Project coverage is 61.32%. Comparing base (20821de) to head (b85bb42).

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3770      +/-   ##
==========================================
- Coverage   61.37%   61.32%   -0.05%     
==========================================
  Files         648      648              
  Lines       45706    45716      +10     
==========================================
- Hits        28051    28036      -15     
- Misses      17655    17680      +25     
Flag Coverage Δ
.-amd64 90.90% <ø> (ø)
cmds/...-amd64 52.37% <0.00%> (-0.02%) ⬇️
integration/generic-tests/...-amd64 29.35% <0.00%> (-0.02%) ⬇️
integration/generic-tests/...-arm 31.75% <0.00%> (-0.03%) ⬇️
integration/generic-tests/...-arm64 28.08% <0.00%> (-0.02%) ⬇️
integration/gotests/...-amd64 60.32% <42.10%> (-0.01%) ⬇️
integration/gotests/...-arm 60.57% <42.10%> (+<0.01%) ⬆️
integration/gotests/...-arm64 60.55% <42.10%> (-0.22%) ⬇️
pkg/...-amd64 59.10% <0.00%> (-0.19%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Components Coverage Δ
everything 66.25% <42.10%> (-0.06%) ⬇️
cmds/exp 34.30% <0.00%> (ø)
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Copilot review overview

🟡 Changes recommended

Linux SetTermios now rejects valid termios values returned or produced by existing package APIs.

Review effort: Balanced
Findings: 1

Open (1) What changed in this PR

Updates termios handling to support Linux baud-rate changes and reuse platform-specific ioctl wrappers.

Changes:

  • Converts Linux baud rates before applying terminal settings.
  • Routes SGTTY operations through shared termios helpers.
  • Uses platform-specific BSD ioctl constants.
File Description
pkg/​termios/​termios_linux.go Adds Linux baud conversion during setting.
pkg/​termios/​termios_bsd.go Uses platform-specific ioctl constants.
pkg/​termios/​sgtty.go Uses shared termios get/set helpers.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread pkg/termios/termios_linux.go Fixed
Comment thread pkg/termios/termios_linux.go Fixed
That constant no longer exists in bsd.

Signed-off-by: Ronald Minnich <rminnich@gmail.com>
Use the package constants, specifically designed to provide
the right values for different kernels.

Signed-off-by: Ronald Minnich <rminnich@gmail.com>
Use the old fashioned BAUD flags in Cflags, because the
Go unix package still can not handle TIOC?ETS2 and
its structs.

Signed-off-by: Ronald Minnich <rminnich@gmail.com>
We defined the per-os functions years ago and never
used them.

This fixes baud rate setting across a number of kernels,
particularly Linux.

Signed-off-by: Ronald Minnich <rminnich@gmail.com>
rminnich force-pushed the stty2 branch 2 times, most recently from d2873f7 to fac3309 Compare October 1, 2026 02:56
Comment thread pkg/termios/termios_linux.go Outdated
Convert returned Linux B* to a rate for Ispeed and Ospeed

Add 0 as a possible baud rate.

Signed-off-by: Ronald G Minnich <rminnich@gmail.com>
Signed-off-by: Ronald G Minnich <rminnich@gmail.com>
rminnich enabled auto-merge (rebase) October 2, 2026 04:37
rminnich merged commit 8c86aab into u-root:main Oct 2, 2026
32 of 35 checks passed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Awaiting reviewer Waiting for a reviewer.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants


Back | FazBrowse Home | New Git URL