hermes - 💡(How to fix) Fix [Bug]: Shift+Enter no longer inserts a newline in classic Hermes CLI [1 pull requests]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…

Error Message

Additional Logs / Traceback (optional)

Root Cause

Root Cause Analysis (optional)

Fix Action

Fixed

Code Example

Report       https://paste.rs/1Lg8U
agent.log    https://paste.rs/U0uXO
gateway.log  https://paste.rs/iJqBj

---

None captured for this bug.
RAW_BUFFERClick to expand / collapse

Bug Description

Shift+Enter stopped inserting a newline in the classic Hermes CLI chat input. Instead, Enter behavior changed in a way that broke multiline composition in normal local terminal usage on macOS.

This appears to have regressed after the LF-submit fix for thin PTYs. In my case, Shift+Enter used to be a practical multiline shortcut and then stopped working.

Steps to Reproduce

  1. Start classic Hermes CLI with hermes (not hermes --tui).
  2. Type part of a message.
  3. Press Shift+Enter.
  4. Observe that no newline is inserted / multiline composition is broken.

Expected Behavior

In the classic CLI, Shift+Enter should insert a newline so multiline prompts can be composed normally.

Actual Behavior

Shift+Enter no longer inserts a newline. The CLI treats LF / c-j as submit, which breaks terminals that deliver Shift+Enter as LF / c-j.

Affected Component

CLI (interactive chat)

Messaging Platform (if gateway-related)

N/A (CLI only)

Debug Report

Report       https://paste.rs/1Lg8U
agent.log    https://paste.rs/U0uXO
gateway.log  https://paste.rs/iJqBj

Operating System

MacOS Sequoia

Python Version

3.14.4

Hermes Version

Hermes Agent v0.13.0 (2026.5.7)

Additional Logs / Traceback (optional)

None captured for this bug.

Root Cause Analysis (optional)

The relevant upstream change appears to be:

  • fix(cli): submit LF enter in thin PTYs (commit 5044e1cbf)

In cli.py, _bind_prompt_submit_keys() was changed to bind both enter and c-j to submit. On terminals where Shift+Enter is delivered as LF / c-j, this makes Shift+Enter submit instead of inserting a newline.

Proposed Fix (optional)

For normal local CLI use, bind only enter to submit by default. Handle c-j separately so it inserts \n by default, and gate LF-submit behind an opt-in environment variable for thin PTYs, e.g. HERMES_CLI_SUBMIT_ON_LF=1. A working local pattern was:

  • _bind_prompt_submit_keys() binds only enter
  • @kb.add('c-j') inserts newline by default
  • when HERMES_CLI_SUBMIT_ON_LF=1 is set, the c-j handler calls handle_enter(event) instead

Are you willing to submit a PR for this?

  • I'd like to fix this myself and submit a PR

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING

hermes - 💡(How to fix) Fix [Bug]: Shift+Enter no longer inserts a newline in classic Hermes CLI [1 pull requests]