Skip to content

Commit 35b9b4f

Browse files
dracgenericagent-author
andcommitted
fix(tui_v3): silence Renderer's cpr_not_supported_callback too
The Application's cpr_not_supported_callback override was not enough — prompt-toolkit's Renderer captures its own copy during __init__ and calls that one when CPR times out. The warning wrote directly to the real terminal fd (via self.output.write()), causing a brief flash before the TUI overwrote it on the next frame. Silence both callbacks (app + renderer) to fully suppress the flash. Co-Authored-By: GenericAgent <bot@gaagent.ai>
1 parent 6983b95 commit 35b9b4f

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

frontends/tui_v3.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5982,7 +5982,12 @@ def _pre_run() -> None:
59825982
before_render=_before_render,
59835983
output=_ptk_output,
59845984
)
5985-
app.cpr_not_supported_callback = lambda: None # silence the CPR warning
5985+
# Silence the CPR warning. The Application's callback is checked by
5986+
# prompt_toolkit's Application.run() path, but the Renderer captures its
5987+
# own copy during __init__ and that is the one that actually fires the
5988+
# warning. Both must be no-ops to prevent the brief flash on startup.
5989+
app.cpr_not_supported_callback = lambda: None
5990+
app.renderer.cpr_not_supported_callback = lambda: None
59865991
self._ptk_app = app
59875992

59885993
try:

0 commit comments

Comments
 (0)