fix(tui): fix scrollback overwrite when appending lines past viewport
Appended lines were not committed to terminal scrollback because the renderer used cursor movement (CSI B) and carriage return without linefeed. This caused earlier content to be overwritten when the viewport filled up. Changes: - For appended lines, emit \r\n to create real scrollback lines - When target row is below viewport, scroll with \r\n before positioning - Add PI_TUI_WRITE_LOG env var for debugging raw ANSI output - Add fullRedraws readonly property to TUI class - Add viewport-overwrite-repro.ts test script fixes #954
This commit is contained in:
@@ -443,6 +443,14 @@ interface MyTheme {
|
||||
}
|
||||
```
|
||||
|
||||
## Debug logging
|
||||
|
||||
Set `PI_TUI_WRITE_LOG` to capture the raw ANSI stream written to stdout.
|
||||
|
||||
```bash
|
||||
PI_TUI_WRITE_LOG=/tmp/tui-ansi.log npx tsx packages/tui/test/chat-simple.ts
|
||||
```
|
||||
|
||||
## Performance
|
||||
|
||||
Cache rendered output when possible:
|
||||
|
||||
Reference in New Issue
Block a user