Skip to content

help: fix terminal newline handling in raw-mode terminals#322

Open
rowantrollope wants to merge 1 commit into
antirez:mainfrom
rowantrollope:codex/help-ghostty-help-output
Open

help: fix terminal newline handling in raw-mode terminals#322
rowantrollope wants to merge 1 commit into
antirez:mainfrom
rowantrollope:codex/help-ghostty-help-output

Conversation

@rowantrollope
Copy link
Copy Markdown

Fix --help rendering in Ghostty, or any TTY terminal, when the terminal has OPOST/ONLCR disabled. In that state moves down without returning to column zero, producing stair-stepped help output.

The fix is scoped to ds4_help_print(): save the terminal mode, enable normal newline output while printing help to a TTY, flush, then restore the original mode.

Also aligns the colorized help option table with the plain-text layout.

Validation:

  • make ds4-agent
  • git diff --check
  • ./ds4-agent --help
  • pseudo-tty repro with stty -opost

@rowantrollope rowantrollope marked this pull request as ready for review June 1, 2026 19:00
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.

1 participant