fix(cli): preserve Ctrl+Enter newline over SSH/WSL, submit on pure POSIX#22495
Closed
liuhao1024 wants to merge 3 commits into
Closed
fix(cli): preserve Ctrl+Enter newline over SSH/WSL, submit on pure POSIX#22495liuhao1024 wants to merge 3 commits into
liuhao1024 wants to merge 3 commits into
Conversation
…INSTALL_TIMEOUT Increase the default npm install timeout for WhatsApp bridge from 60s to 300s (5 minutes) to accommodate slower systems like Unraid NAS. Make it configurable via WHATSAPP_NPM_INSTALL_TIMEOUT environment variable for users who need even longer timeouts. Closes NousResearch#14980
- Add 'path', 'old_string', 'new_string', and 'patch' to required list - Update description to clarify mode-specific parameter requirements - This addresses issue where LLMs would omit these parameters because they were not marked as required in the schema, even though they are required depending on the mode Fixes NousResearch#15524
On WSL, SSH, and Windows Terminal, Ctrl+Enter arrives as c-j (LF) and should insert a newline for multiline input. On pure POSIX local terminals, c-j is the literal Enter key for thin PTYs and must submit. Changes: - Add _is_wsl() and _preserve_ctrl_enter_newline() predicates to detect platform context (Windows, WSL, SSH, Windows Terminal) - Make c-j binding conditional: newline on WSL/SSH/Windows, submit on pure POSIX (thin PTY fallback) - Create hermes_cli/pt_input_extras.py with CSI-u and modifyOtherKeys sequence handlers for enhanced terminal protocols (Kitty, iTerm2, WezTerm, xterm) - Add regression tests for platform detection and key binding behavior Fixes Ctrl+Enter newline submits prompt over SSH/WSL because c-j is bound as submit NousResearch#22379
Collaborator
|
Duplicate of #22777 (merged 2026-05-09). The Ctrl+Enter/c-j WSL/SSH fix is already in main. This PR also bundles unrelated changes to whatsapp.py and file_tools.py. |
Contributor
Author
|
Closing — @alt-glitch confirmed this is a duplicate of #22777 (merged 2026-05-09). The Ctrl+Enter/c-j WSL/SSH fix is already in main. |
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.
Summary
Fix Ctrl+Enter inserting a newline instead of submitting on pure POSIX terminals, and conversely, submitting instead of inserting a newline on WSL/SSH/Windows Terminal.
Root Cause
The
c-jkey binding (which most terminals send for Ctrl+Enter) was unconditionally mapped to insert a newline. This breaks two scenarios:c-j) for the Enter key. Withc-jbound to newline, these PTYs cannot submit input.Fix
_is_wsl()(checks/proc/versionformicrosoft) and_preserve_ctrl_enter_newline()predicates that detect WSL, SSH (SSH_CONNECTION/SSH_CLIENT/SSH_TTY), and Windows Terminal (WT_SESSION).c-jbinding: On WSL/SSH/Windows Terminal,c-jinserts a newline. On pure POSIX (local terminal),c-jsubmits (thin PTY fallback).hermes_cli/pt_input_extras.pywith CSI-u (Kitty) and modifyOtherKeys (xterm) sequence handlers, so Ctrl+Enter works even when terminals send escape sequences instead of raw LF.Regression Coverage
9 new tests in
tests/hermes_cli/test_prompt_submit_keys.py:Testing
Fixes Ctrl+Enter newline submits prompt over SSH/WSL because c-j is bound as submit #22379