Skip to content

fix(tui): decode TUI startup subprocess output as utf-8 on Windows - #44328

Merged
teknium1 merged 2 commits into
mainfrom
fix/tui-utf8-subprocess-decode
Jun 11, 2026
Merged

fix(tui): decode TUI startup subprocess output as utf-8 on Windows#44328
teknium1 merged 2 commits into
mainfrom
fix/tui-utf8-subprocess-decode

Conversation

@teknium1

Copy link
Copy Markdown
Contributor

Summary

Windows hermes --tui no longer crashes with UnicodeDecodeError: 'charmap' codec can't decode byte 0x8f when npm/node emit bytes outside the active ANSI code page — all TUI launcher subprocess captures now decode as UTF-8 with replacement.

Salvage of #43790 by @helix4u (authorship preserved via cherry-pick), plus one sibling fix.

Changes

  • hermes_cli/main.py: encoding="utf-8", errors="replace" on the node bootstrap probe, TUI npm install, dev prebuild, and npm run build captures (contributor)
  • hermes_cli/main.py: same fix for the WhatsApp bridge npm install capture — same bug class, audited via subprocess-capture sweep (follow-up)
  • tests/hermes_cli/test_tui_npm_install.py: asserts the decode policy on the npm captures

Validation

Check Result
pytest tests/hermes_cli/test_tui_npm_install.py 27 passed
E2E: subprocess emitting raw 0x8f byte with the new decode args no exception, replacement char
Contributor's Windows AppData check startup traceback gone
Sweep of remaining capture_output+text=True sites in main.py rest are git/systemctl/ps (ASCII output), left alone

Infographic

tui-utf8-decode

@github-actions

Copy link
Copy Markdown
Contributor

🔎 Lint report: fix/tui-utf8-subprocess-decode vs origin/main

ruff

Total: 0 on HEAD, 0 on base (➖ 0)

🆕 New issues: none

✅ Fixed issues: none

Unchanged: 0 pre-existing issues carried over.

ty (type checker)

Total: 10717 on HEAD, 10717 on base (➖ 0)

🆕 New issues: none

✅ Fixed issues: none

Unchanged: 5609 pre-existing issues carried over.

Diagnostics are surfaced as warnings — this check never fails the build.

@alt-glitch alt-glitch added type/bug Something isn't working P3 Low — cosmetic, nice to have comp/cli CLI entry point, hermes_cli/, setup wizard comp/tui Terminal UI (ui-tui/ + tui_gateway/) labels Jun 11, 2026
@teknium1
teknium1 merged commit 5508f4b into main Jun 11, 2026
28 checks passed
@teknium1
teknium1 deleted the fix/tui-utf8-subprocess-decode branch June 11, 2026 16:00
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 comp/tui Terminal UI (ui-tui/ + tui_gateway/) P3 Low — cosmetic, nice to have type/bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants