Skip to content

fix: Windows console compatibility via hermes chat -Q#5

Open
na-navi wants to merge 1 commit into
mainfrom
fix/windows-conpty
Open

fix: Windows console compatibility via hermes chat -Q#5
na-navi wants to merge 1 commit into
mainfrom
fix/windows-conpty

Conversation

@na-navi

@na-navi na-navi commented May 18, 2026

Copy link
Copy Markdown
Owner

Fixes NoConsoleScreenBufferError on Windows when hermes chat -q is spawned from Node.js child_process.

Root cause

hermes chat -q uses prompt_toolkit for colored output. On Windows, prompt_toolkit requires a real console screen buffer (Win32Output). When spawned as a subprocess, stdout is a pipe — no console — causing the crash.

Fix

Use -Q (--quiet) flag which outputs plain text without prompt_toolkit, designed for programmatic use. The response format is simpler (no ╭─...╰─ block), so parseChatOutput is updated to handle:

  1. Quiet mode (-Q): response text followed by session_id: <id> line
  2. Normal mode: ╭─...╰─ block (kept as fallback for non-Windows or future use)
  3. Fallback: metadata-stripped raw output

Verified on Windows 11:

$ hermes chat -q "hello" -m grok-4.3 -Q
Hi

session_id: 20260518_093529_57afba

On Windows, hermes chat -q uses prompt_toolkit which requires a real
console screen buffer. When spawned from Node.js child_process, there
is no console, causing NoConsoleScreenBufferError.

The -Q (--quiet) flag suppresses banner, spinner, and tool previews,
outputting only the final response and session info in plain text.
This avoids prompt_toolkit entirely and works in subprocess contexts.

Update parseChatOutput to handle -Q format (plain response followed by
session_id: line) in addition to the existing decorated block format.
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.

2 participants