Skip to content

fix(tui): honor documented mouse_tracking config key#17188

Merged
OutThisLife merged 2 commits into
mainfrom
fix/tui-linux-native-selection
Apr 29, 2026
Merged

fix(tui): honor documented mouse_tracking config key#17188
OutThisLife merged 2 commits into
mainfrom
fix/tui-linux-native-selection

Conversation

@OutThisLife

Copy link
Copy Markdown
Collaborator

Summary

  • Treat display.mouse_tracking as the canonical TUI mouse-tracking config key, with display.tui_mouse kept as a legacy fallback.
  • Make /mouse write display.mouse_tracking, so persistent config matches docs and user-facing examples.
  • Add TUI/client and gateway tests for canonical-vs-legacy precedence.

Test plan

  • cd ui-tui && npm run type-check
  • cd ui-tui && npm test -- --run src/__tests__/useConfigSync.test.ts
  • cd ui-tui && npm test -- --run
  • scripts/run_tests.sh tests/test_tui_gateway_server.py::test_config_mouse_uses_documented_key_with_legacy_fallback

The TUI runtime was reading display.tui_mouse while docs and user-facing
examples pointed users at display.mouse_tracking. That made persistent
mouse-disable config look like a no-op for users trying to restore native
terminal selection/copy behavior on Linux/SSH/tmux terminals.

Use display.mouse_tracking as the canonical key, keep display.tui_mouse as
a legacy fallback, and have /mouse write the documented key. Both gateway
config.get and client-side config sync now share the same precedence: the
canonical key wins, then the legacy key, then default on.

Copilot AI 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.

Pull request overview

Aligns TUI mouse tracking with the documented config key by making display.mouse_tracking canonical (while still honoring display.tui_mouse for legacy configs), and ensures the /mouse command persists the documented key.

Changes:

  • Add display.mouse_tracking to the client config types and keep display.tui_mouse as a legacy alias.
  • Update TUI config normalization to prefer mouse_tracking over tui_mouse.
  • Update gateway /mouse handling to read canonical-with-legacy-fallback and to write display.mouse_tracking, plus add regression tests.

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
ui-tui/src/gatewayTypes.ts Adds mouse_tracking and documents tui_mouse as a legacy alias.
ui-tui/src/app/useConfigSync.ts Normalizes mouse tracking with canonical-vs-legacy precedence and wires into UI state.
ui-tui/src/tests/useConfigSync.test.ts Adds tests covering canonical vs legacy precedence for mouse tracking.
tui_gateway/server.py Adds canonical/legacy resolution helper, updates config.get/config.set for mouse, and writes display.mouse_tracking.
tests/test_tui_gateway_server.py Adds gateway test ensuring canonical key is written and legacy fallback still works.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread tui_gateway/server.py Outdated
Comment thread ui-tui/src/app/useConfigSync.ts Outdated
Comment thread ui-tui/src/gatewayTypes.ts Outdated
Comment thread tui_gateway/server.py
- Load gateway config once before deriving display.mouse_tracking state.
- Use key-presence precedence on the TUI client too, so canonical
  mouse_tracking wins over legacy tui_mouse even when the value is null.
- Treat numeric 0 as disabled on both gateway and client, matching the
  existing string "0" handling.
- Widen ConfigDisplayConfig mouse fields because config.get full returns raw
  YAML, not normalized booleans.
@alt-glitch alt-glitch added type/bug Something isn't working P3 Low — cosmetic, nice to have comp/tui Terminal UI (ui-tui/ + tui_gateway/) area/config Config system, migrations, profiles labels Apr 29, 2026
@OutThisLife OutThisLife requested a review from Copilot April 29, 2026 00:27

Copilot AI 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.

Pull request overview

This PR aligns TUI mouse-tracking behavior with the documented config key by treating display.mouse_tracking as canonical (with display.tui_mouse as a legacy fallback) across both the TUI client and the gateway, and ensures /mouse persists the canonical key.

Changes:

  • Add display.mouse_tracking to the TUI config wire types and keep display.tui_mouse as a legacy alias with widened raw-YAML types.
  • Implement canonical-vs-legacy precedence and normalization in the TUI (normalizeMouseTracking) and apply it in applyDisplay.
  • Add client and gateway tests covering precedence, numeric/string falsey handling, and persistence of the canonical key.

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated no comments.

Show a summary per file
File Description
ui-tui/src/gatewayTypes.ts Adds mouse_tracking and widens types for raw YAML compatibility; documents tui_mouse as legacy.
ui-tui/src/app/useConfigSync.ts Introduces normalizeMouseTracking and uses it when fanning config into UI state.
ui-tui/src/tests/useConfigSync.test.ts Adds unit tests for canonical precedence and normalization behavior.
tui_gateway/server.py Adds _display_mouse_tracking, uses it for /mouse status, and makes /mouse persist display.mouse_tracking.
tests/test_tui_gateway_server.py Adds gateway test ensuring canonical key persistence and legacy fallback behavior.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@OutThisLife OutThisLife merged commit 188eaa5 into main Apr 29, 2026
15 of 16 checks passed
@OutThisLife OutThisLife deleted the fix/tui-linux-native-selection branch April 29, 2026 00:39
02356abc pushed a commit to 02356abc/hermes-agent that referenced this pull request May 14, 2026
)

* fix(tui): honor documented mouse_tracking config key

The TUI runtime was reading display.tui_mouse while docs and user-facing
examples pointed users at display.mouse_tracking. That made persistent
mouse-disable config look like a no-op for users trying to restore native
terminal selection/copy behavior on Linux/SSH/tmux terminals.

Use display.mouse_tracking as the canonical key, keep display.tui_mouse as
a legacy fallback, and have /mouse write the documented key. Both gateway
config.get and client-side config sync now share the same precedence: the
canonical key wins, then the legacy key, then default on.

* review(copilot): align mouse tracking config coercion

- Load gateway config once before deriving display.mouse_tracking state.
- Use key-presence precedence on the TUI client too, so canonical
  mouse_tracking wins over legacy tui_mouse even when the value is null.
- Treat numeric 0 as disabled on both gateway and client, matching the
  existing string "0" handling.
- Widen ConfigDisplayConfig mouse fields because config.get full returns raw
  YAML, not normalized booleans.
jsboige pushed a commit to jsboige/hermes-agent that referenced this pull request May 14, 2026
)

* fix(tui): honor documented mouse_tracking config key

The TUI runtime was reading display.tui_mouse while docs and user-facing
examples pointed users at display.mouse_tracking. That made persistent
mouse-disable config look like a no-op for users trying to restore native
terminal selection/copy behavior on Linux/SSH/tmux terminals.

Use display.mouse_tracking as the canonical key, keep display.tui_mouse as
a legacy fallback, and have /mouse write the documented key. Both gateway
config.get and client-side config sync now share the same precedence: the
canonical key wins, then the legacy key, then default on.

* review(copilot): align mouse tracking config coercion

- Load gateway config once before deriving display.mouse_tracking state.
- Use key-presence precedence on the TUI client too, so canonical
  mouse_tracking wins over legacy tui_mouse even when the value is null.
- Treat numeric 0 as disabled on both gateway and client, matching the
  existing string "0" handling.
- Widen ConfigDisplayConfig mouse fields because config.get full returns raw
  YAML, not normalized booleans.
dannyJ848 pushed a commit to dannyJ848/hermes-agent that referenced this pull request May 17, 2026
)

* fix(tui): honor documented mouse_tracking config key

The TUI runtime was reading display.tui_mouse while docs and user-facing
examples pointed users at display.mouse_tracking. That made persistent
mouse-disable config look like a no-op for users trying to restore native
terminal selection/copy behavior on Linux/SSH/tmux terminals.

Use display.mouse_tracking as the canonical key, keep display.tui_mouse as
a legacy fallback, and have /mouse write the documented key. Both gateway
config.get and client-side config sync now share the same precedence: the
canonical key wins, then the legacy key, then default on.

* review(copilot): align mouse tracking config coercion

- Load gateway config once before deriving display.mouse_tracking state.
- Use key-presence precedence on the TUI client too, so canonical
  mouse_tracking wins over legacy tui_mouse even when the value is null.
- Treat numeric 0 as disabled on both gateway and client, matching the
  existing string "0" handling.
- Widen ConfigDisplayConfig mouse fields because config.get full returns raw
  YAML, not normalized booleans.
gweeteve pushed a commit to gweeteve/hermes-agent that referenced this pull request Jun 2, 2026
)

* fix(tui): honor documented mouse_tracking config key

The TUI runtime was reading display.tui_mouse while docs and user-facing
examples pointed users at display.mouse_tracking. That made persistent
mouse-disable config look like a no-op for users trying to restore native
terminal selection/copy behavior on Linux/SSH/tmux terminals.

Use display.mouse_tracking as the canonical key, keep display.tui_mouse as
a legacy fallback, and have /mouse write the documented key. Both gateway
config.get and client-side config sync now share the same precedence: the
canonical key wins, then the legacy key, then default on.

* review(copilot): align mouse tracking config coercion

- Load gateway config once before deriving display.mouse_tracking state.
- Use key-presence precedence on the TUI client too, so canonical
  mouse_tracking wins over legacy tui_mouse even when the value is null.
- Treat numeric 0 as disabled on both gateway and client, matching the
  existing string "0" handling.
- Widen ConfigDisplayConfig mouse fields because config.get full returns raw
  YAML, not normalized booleans.
Egavasyug pushed a commit to Egavasyug/hermes-agent that referenced this pull request Jun 10, 2026
)

* fix(tui): honor documented mouse_tracking config key

The TUI runtime was reading display.tui_mouse while docs and user-facing
examples pointed users at display.mouse_tracking. That made persistent
mouse-disable config look like a no-op for users trying to restore native
terminal selection/copy behavior on Linux/SSH/tmux terminals.

Use display.mouse_tracking as the canonical key, keep display.tui_mouse as
a legacy fallback, and have /mouse write the documented key. Both gateway
config.get and client-side config sync now share the same precedence: the
canonical key wins, then the legacy key, then default on.

* review(copilot): align mouse tracking config coercion

- Load gateway config once before deriving display.mouse_tracking state.
- Use key-presence precedence on the TUI client too, so canonical
  mouse_tracking wins over legacy tui_mouse even when the value is null.
- Treat numeric 0 as disabled on both gateway and client, matching the
  existing string "0" handling.
- Widen ConfigDisplayConfig mouse fields because config.get full returns raw
  YAML, not normalized booleans.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/config Config system, migrations, profiles 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