The /clear command was using Rich's console.clear() and console.print() which write directly to stdout. Inside the TUI, prompt_toolkit's patch_stdout intercepts stdout via StdoutProxy, which doesn't interpret screen-clearing escape sequences and mangles Rich's ANSI output, resulting in raw escape codes dumped to the terminal. Fix: - Use prompt_toolkit's output.erase_screen() + cursor_goto() to clear the terminal directly (bypasses patch_stdout's StdoutProxy) - Render the banner through ChatConsole (which routes Rich output through prompt_toolkit's native print_formatted_text/ANSI renderer) - Use _cprint for the status message (prompt_toolkit-compatible) - Fall back to the old behavior when not inside the TUI (e.g. startup)
143 KiB
Executable File
143 KiB
Executable File