mirror of
https://github.com/NousResearch/hermes-agent.git
synced 2026-05-30 06:41:51 +00:00
fix(tui): repaint + sync mouse mode when display.mouse_tracking changes
Two interacting bugs left the TUI blank when `display.mouse_tracking` switched at runtime (config edit, /mouse <preset>): 1. AlternateScreen's effect re-runs on every `mouseTracking` change, tearing down and re-entering the alt screen. After re-entry, ink's frame buffers are reset by `resetFramesForAltScreen()` but nothing schedules the follow-up render — the alt screen sits blank until some other state change happens to trigger one. Add a `scheduleRender()` in `setAltScreenActive`'s active=true branch so the freshly-entered alt screen gets a full repaint immediately. 2. `setAltScreenActive` early-returns when `active` hasn't changed, which silently drops a `mouseTracking` change if the cleanup→setup pair somehow leaves `altScreenActive` already true. Call `setAltScreenMouseTracking` explicitly from the AlternateScreen effect so the in-memory mode and terminal DECSET sequence stay in sync regardless of how `setAltScreenActive` resolved (the call is a no-op when the mode is unchanged).
This commit is contained in:
parent
6e5b8650cc
commit
ece0a2f4cc
2 changed files with 2 additions and 0 deletions
|
|
@ -75,6 +75,7 @@ export function AlternateScreen(t0: Props) {
|
|||
(enableMouse || DISABLE_MOUSE_TRACKING)
|
||||
)
|
||||
ink?.setAltScreenActive(true, mouseTracking)
|
||||
ink?.setAltScreenMouseTracking(mouseTracking)
|
||||
|
||||
return () => {
|
||||
ink?.setAltScreenActive(false)
|
||||
|
|
|
|||
|
|
@ -1272,6 +1272,7 @@ export default class Ink {
|
|||
|
||||
if (active) {
|
||||
this.resetFramesForAltScreen()
|
||||
this.scheduleRender()
|
||||
} else {
|
||||
this.repaint()
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue