Skip to content

fix(cli): make Ctrl+J insert newline on macOS#26086

Open
dr4lamb wants to merge 1 commit into
NousResearch:mainfrom
dr4lamb:fix/ctrl-j-newline-macos
Open

fix(cli): make Ctrl+J insert newline on macOS#26086
dr4lamb wants to merge 1 commit into
NousResearch:mainfrom
dr4lamb:fix/ctrl-j-newline-macos

Conversation

@dr4lamb

@dr4lamb dr4lamb commented May 15, 2026

Copy link
Copy Markdown

Summary

On macOS, Ctrl+J (ASCII LF / c-j) is the wire encoding of Ctrl+Enter — a distinct keystroke from plain Enter (c-m). macOS terminal users naturally expect Ctrl+J to insert a newline (like Alt+Enter on Linux), but instead it submits the message.

Changes

Added sys.platform == "darwin" to _preserve_ctrl_enter_newline() so that c-j is left unbound from submit on macOS. The existing c-j → newline handler (originally added for Windows/WSL/SSH in issue #22379) then fires correctly.

This is a 2-line logical change that extends the existing pattern to macOS.

Related

@alt-glitch alt-glitch added type/bug Something isn't working comp/cli CLI entry point, hermes_cli/, setup wizard P2 Medium — degraded but workaround exists labels May 15, 2026
@alt-glitch

Copy link
Copy Markdown
Collaborator

Duplicate of #25111 (which is itself a duplicate of closed #23448). All three PRs make the same change: extend _preserve_ctrl_enter_newline() to return True on macOS so c-j inserts a newline instead of submitting. See also competing PR #23921 (Warp terminal variant) and the comprehensive #22911.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comp/cli CLI entry point, hermes_cli/, setup wizard P2 Medium — degraded but workaround exists type/bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants