Skip to content

docs(env): document HERMES_TUI Termux/inline/mouse env vars from #28910 - #29087

Open
r266-tech wants to merge 1 commit into
NousResearch:mainfrom
r266-tech:docs-tui-termux-env-vars-28910
Open

docs(env): document HERMES_TUI Termux/inline/mouse env vars from #28910#29087
r266-tech wants to merge 1 commit into
NousResearch:mainfrom
r266-tech:docs-tui-termux-env-vars-28910

Conversation

@r266-tech

Copy link
Copy Markdown
Contributor

What does this PR do?

#28910 (fix(tui): termux-gate scrollback preservation, touch-friendly defaults — salvage of #28779, merged 2026-05-19) added three new public TUI env vars that aren't yet listed in the reference docs.

Adds three rows to the Interface table in website/docs/reference/environment-variables.md:

  • HERMES_TUI_TERMUX_MODE — explicit on/off for Termux-focused TUI defaults
  • HERMES_TUI_INLINE — explicit on/off for primary-buffer (scrollback-preserving) rendering
  • HERMES_TUI_MOUSE_TRACKING — explicit on/off mouse-tracking override

Why

All three are user-facing opt-outs (the source PR body explicitly documents HERMES_TUI_TERMUX_MODE=0 as the opt-out, and the inline + mouse rows are the override knobs for the new Termux defaults). Today users on Termux can be confused by why mouse tracking is off, why scrollback is preserved, or how to opt back into desktop defaults — none of these are searchable in the docs.

Source-of-truth

Descriptions grounded in:

  • ui-tui/src/lib/termux.tsisTermuxEnv() detects via TERMUX_VERSION or the /data/data/com.termux/files/usr PREFIX path; isTermuxTuiMode() reads HERMES_TUI_TERMUX_MODE (truthy/falsy via the parseToggle matcher) with default `true` under Termux.
  • ui-tui/src/config/env.ts:
    • `MOUSE_TRACKING = mouseTrackingOverride ?? (TERMUX_TUI_MODE ? false : !mouseTrackingDisabledLegacy)` — explicit `HERMES_TUI_MOUSE_TRACKING` wins; otherwise Termux defaults off, non-Termux defaults on unless legacy `HERMES_TUI_DISABLE_MOUSE` is truthy.
    • `INLINE_MODE = inlineOverride ?? TERMUX_TUI_MODE` — explicit `HERMES_TUI_INLINE` wins; otherwise inline defaults on under Termux only.

The legacy `HERMES_TUI_DISABLE_MOUSE` is referenced inside the `HERMES_TUI_MOUSE_TRACKING` description to make the precedence chain explicit; documenting that legacy variable on its own line is intentionally left out of this PR's scope.

Type of Change

  • 🐛 Bug fix (non-breaking change that fixes an issue)
  • ✨ New feature (non-breaking change that adds functionality)
  • 🔒 Security fix
  • 📝 Documentation update
  • ✅ Tests (adding or improving test coverage)
  • ♻️ Refactor (no behavior change)
  • 🎯 New skill (bundled or hub)

Changes Made

  • website/docs/reference/environment-variables.md — adds three rows to the Interface section, immediately after HERMES_TUI_THEME.

How to Test

`npm run docs:typecheck` and the existing site build; no other tests touched. Visual smoke: render website/docs/reference/environment-variables.md locally and confirm the three new rows render in the Interface table.

Checklist

Code

@alt-glitch alt-glitch added type/docs Documentation improvements P3 Low — cosmetic, nice to have comp/tui Terminal UI (ui-tui/ + tui_gateway/) labels May 20, 2026
@teknium1

Copy link
Copy Markdown
Contributor

Thanks for tightening up the TUI env-var reference.

I don't see blocking issues in this PR. The premise still holds on current main: ui-tui/src/lib/termux.ts:17 reads HERMES_TUI_TERMUX_MODE, and ui-tui/src/config/env.ts:44 / ui-tui/src/config/env.ts:56 read HERMES_TUI_MOUSE_TRACKING and HERMES_TUI_INLINE, but the Interface table in website/docs/reference/environment-variables.md:639 still skips from HERMES_TUI_THEME to HERMES_INFERENCE_MODEL without documenting those three knobs.

The row text also matches the current runtime behavior: Termux detection comes from TERMUX_VERSION or the Termux PREFIX path in ui-tui/src/lib/termux.ts:5, mouse tracking uses the explicit env override before the legacy disable flag/defaults in ui-tui/src/config/env.ts:44, and inline mode defaults to Termux mode unless explicitly overridden in ui-tui/src/config/env.ts:56.

Salvage should be mostly mechanical; GitHub currently reports this PR as conflicting, likely because the environment-variable table has moved since the PR was opened.

Automated hermes-sweeper review.

@teknium1 teknium1 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for documenting these existing TUI controls. The reference gap remains on current main: website/docs/reference/environment-variables.md:767-771 lists HERMES_TUI_THEME and then HERMES_INFERENCE_MODEL, while runtime reads all three proposed variables in ui-tui/src/lib/termux.ts:22 and ui-tui/src/config/env.ts:45,63.

Problems

  • The proposed HERMES_TUI_TERMUX_MODE text says it can force Termux defaults on or off. ui-tui/src/lib/termux.ts:17-20 returns false outside detected Termux before reading the override; ui-tui/src/__tests__/termux.test.ts:28-30 covers HERMES_TUI_TERMUX_MODE=1 outside Termux and expects false.

Suggested changes

  • Describe this as an override of detected-Termux defaults, with =0 as the Termux opt-out, and state that it has no effect outside detected Termux. Relocate the corrected rows into the current Interface table at website/docs/reference/environment-variables.md:770 during salvage.

Automated hermes-sweeper review.

| `HERMES_TUI_DIR` | Path to a prebuilt `ui-tui/` directory (must contain `dist/entry.js` and populated `node_modules`). Used by distros and Nix to skip the first-launch `npm install`. |
| `HERMES_TUI_RESUME` | Resume a specific TUI session by ID on launch. When set, `hermes --tui` skips forging a fresh session and picks up the named session instead — useful for re-attaching after a disconnect or terminal crash. |
| `HERMES_TUI_THEME` | Force the TUI color theme: `light`, `dark`, or a raw 6-character background hex (e.g. `ffffff` or `1a1a2e`). When unset, Hermes auto-detects using `COLORFGBG` and terminal background queries; this variable overrides detection on terminals (Ghostty, Warp, iTerm2, etc.) that don't set `COLORFGBG`. |
| `HERMES_TUI_TERMUX_MODE` | Force Termux-focused TUI defaults on or off when set to `1`/`0` (also accepts `true`/`false`, `yes`/`no`, `on`/`off`). When unset, Hermes auto-detects Termux via `TERMUX_VERSION` or the Termux `PREFIX` path. Use `HERMES_TUI_TERMUX_MODE=0` on Termux to opt back into the desktop defaults for debugging. |

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

HERMES_TUI_TERMUX_MODE=1 does not force Termux defaults on outside detected Termux: isTermuxTuiMode() returns false before reading the override (ui-tui/src/lib/termux.ts:17-20), with coverage in ui-tui/src/__tests__/termux.test.ts:28-30. Please describe this as an override of detected-Termux defaults instead.

@teknium1 teknium1 added the sweeper:blast-contained Sweeper blast radius: contained — one narrow path / opt-in / few users label Jul 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comp/tui Terminal UI (ui-tui/ + tui_gateway/) P3 Low — cosmetic, nice to have sweeper:blast-contained Sweeper blast radius: contained — one narrow path / opt-in / few users type/docs Documentation improvements

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants