fix: Windows console compatibility via hermes chat -Q#5
Open
na-navi wants to merge 1 commit into
Open
Conversation
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.
b37bc8a to
f3a86a1
Compare
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.
Fixes
NoConsoleScreenBufferErroron Windows whenhermes chat -qis spawned from Node.js child_process.Root cause
hermes chat -qusesprompt_toolkitfor colored output. On Windows,prompt_toolkitrequires 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 withoutprompt_toolkit, designed for programmatic use. The response format is simpler (no╭─...╰─block), soparseChatOutputis updated to handle:-Q): response text followed bysession_id: <id>line╭─...╰─block (kept as fallback for non-Windows or future use)Verified on Windows 11:
$ hermes chat -q "hello" -m grok-4.3 -Q Hi session_id: 20260518_093529_57afba