fix(tui): inherit terminal background

This commit is contained in:
Xubin Ren
2026-08-17 20:56:10 +08:00
parent a80993e413
commit a583b1ffda
3 changed files with 63 additions and 29 deletions
+10
View File
@@ -144,6 +144,16 @@ def main() -> int:
raise AssertionError(f"TUI did not render committed input {glyph!r}")
if "Traceback" in text or "Task exception was never retrieved" in text:
raise AssertionError("TUI emitted an exception during shutdown")
# The UI must inherit the host terminal background. Fixed RGB/indexed
# surfaces become black strips in embedded terminals after long output.
for escape in (
b"\x1b[48;2;14;15;17m",
b"\x1b[48;2;23;24;27m",
b"\x1b[48;5;233m",
b"\x1b[48;5;234m",
):
if escape in output:
raise AssertionError(f"TUI painted a fixed background: {escape!r}")
print("PTY smoke test passed: Unicode input, resize, and terminal restoration")
return 0