mirror of
https://github.com/NousResearch/hermes-agent.git
synced 2026-05-18 04:41:56 +00:00
fix(tui): clear scrollback buffer on startup to prevent tmux scrollback leakage
When TUI exits, tmux captures some TUI output into its scrollback buffer. On restart, stale scrollback content appears at the top of screen before AlternateScreen takes over. Add ANSI escape sequences at startup: - ESC[2J clear visible screen - ESC[H cursor home - ESC[3J clear scrollback buffer
This commit is contained in:
parent
2a3140a814
commit
d33deb7cbe
1 changed files with 6 additions and 0 deletions
|
|
@ -20,6 +20,12 @@ if (!process.stdin.isTTY) {
|
|||
// terminal tab can still have mouse/focus/paste modes enabled.
|
||||
resetTerminalModes()
|
||||
|
||||
// Clear visible screen + scrollback buffer. Without this, tmux may retain
|
||||
// stale TUI output in its scrollback buffer from the previous session,
|
||||
// which is visible when the user scrolls up or briefly before AlternateScreen
|
||||
// takes over on restart. See entry.tsx → AlternateScreen flow.
|
||||
process.stdout.write('\x1b[2J\x1b[H\x1b[3J')
|
||||
|
||||
const gw = new GatewayClient()
|
||||
|
||||
gw.start()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue