Repository navigation
Fix terminal line endings in the TTY output discipline - #7
Merged
Merged
Conversation
JohnAmadis
approved these changes
Oct 18, 2026
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
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Serial terminal output on STM32F746G-DISCO contains bare LF bytes, so minicom advances the row without returning to column zero. Add default LF-to-CRLF output processing in dmtty's line discipline, shared by application writes and input echo, before forwarding to the backing stream or kernel fallback.
Output processing is independent of echo/canonical input flags: dmell temporarily clears both while editing commands, and Enter still needs CRLF. Existing CRLF is preserved across calls and handles. Per-node serialization and short-write accounting prevent duplicate CR on retries. The new
onlcrconfiguration key and appended get/set ioctls allow byte-exact output when needed; previous ioctl numbers are unchanged. UART drivers and ordinary file writes retain their existing behavior.Validation:
origin/main(e8d09f5).BOARD=stm32f746g-discowith the local module and flashed via ST-Link (Verified OK). Raw UART capture at 921600 baud: before the fix,echoproduced three bare LFs; after the fix,echo, multilinehelp, andls /devcontain only CRLF, including the shell's Enter echo, with no CRCRLF.Compatibility: clients sending arbitrary binary output through a TTY must explicitly disable
onlcr(or use the backing device directly). Disabling canonical input alone intentionally keeps terminal output processing enabled. The YMODEM receiver's binary input and LF-free output protocol bytes are unaffected.