Skip to content

Handle modified Enter as newline in multiline linenoise#426

Draft
ljubomirj wants to merge 1 commit into
antirez:mainfrom
ljubomirj:codex/ds4-agent-option-enter-newline
Draft

Handle modified Enter as newline in multiline linenoise#426
ljubomirj wants to merge 1 commit into
antirez:mainfrom
ljubomirj:codex/ds4-agent-option-enter-newline

Conversation

@ljubomirj

Copy link
Copy Markdown

Summary

This teaches the linenoise multiline editor to insert a literal newline when the terminal reports modified Enter.

Handled cases:

  • Meta/Option+Enter as ESC followed by CR or LF, used by macOS terminals and other terminal configurations.
  • Kitty keyboard protocol Enter reports such as ESC [ 13 ; modifier u.

The behavior is gated on mlmode, so normal single-line linenoise use continues to ignore those modified Enter sequences.

Validation

  • git diff --check upstream/main...HEAD
  • make -j8 ds4-agent ds4_agent_test
  • ./ds4_agent_test

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