Skip to content

vmm: prevent CR translation to LF in interactive term#563

Merged
jakecorrenti merged 1 commit intocontainers:mainfrom
jakecorrenti:cr-support
Feb 26, 2026
Merged

vmm: prevent CR translation to LF in interactive term#563
jakecorrenti merged 1 commit intocontainers:mainfrom
jakecorrenti:cr-support

Conversation

@jakecorrenti
Copy link
Member

Fix a bug where Carriage Return (CR) get's translated into a Line Feed (LF) in interactive terminal use-cases.

Fixes #562

Fix a bug where Carriage Return (CR) get's translated into a Line Feed
(LF) in interactive terminal use-cases.

Fixes: containers#562

Signed-off-by: Jake Correnti <jakecorrenti+github@proton.me>
@slp
Copy link
Collaborator

slp commented Feb 26, 2026

/gemini review

@mtjhrc
Copy link
Collaborator

mtjhrc commented Feb 26, 2026

Probably also fixes this old bug containers/krunvm#39

Copy link

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request addresses an issue where carriage returns were incorrectly translated to line feeds in interactive terminal sessions. The fix involves replacing a manual and partial implementation for setting raw terminal mode with a call to the standard cfmakeraw function. This change is a significant improvement as it correctly configures all necessary terminal flags, including ICRNL to prevent the CR/LF translation, thus resolving the bug. The new implementation is more robust, idiomatic, and easier to maintain.

Copy link
Collaborator

@slp slp left a comment

Choose a reason for hiding this comment

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

LGTM, thanks!

@slp
Copy link
Collaborator

slp commented Feb 26, 2026

Also thanks to @jsks for the detailed bug report!

Copy link
Collaborator

@mtjhrc mtjhrc left a comment

Choose a reason for hiding this comment

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

LGTM, too thanks!

@jakecorrenti jakecorrenti merged commit 757b080 into containers:main Feb 26, 2026
11 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.

Enter (CR) translated to LF in interactive TTY sessions

3 participants