pub struct TaskRenderer { /* private fields */ }Expand description
Renderer facade that forwards every call to a background OS thread.
Implements the Renderer trait so the event loop can use it as a
drop-in replacement for AnsiRenderer / PlainRenderer — the wire
protocol is the same UiLine enum.
Implementations§
Trait Implementations§
Source§impl Drop for TaskRenderer
impl Drop for TaskRenderer
Source§impl Renderer for TaskRenderer
impl Renderer for TaskRenderer
Source§fn render(&mut self, line: UiLine)
fn render(&mut self, line: UiLine)
Emit one UiLine. Implementations may batch internally; call
flush() to force.fn flush(&mut self)
Source§fn reset(&mut self)
fn reset(&mut self)
Forget all cached rendering state (footer rows, last footer snapshot,
assistant-text mid-line buffer, markdown parser) AND clear the
physical terminal screen. Used by callers that hand control back
to a non-TUI process (e.g. the blocking OAuth flow in /login)
and then want a clean slate — without this, the next render
tries to
erase_footer at a position the terminal cursor is no
longer at, corrupting every subsequent ANSI cursor move.Source§fn clear_screen(&mut self)
fn clear_screen(&mut self)
Wipe the physical terminal with
\x1b[2J\x1b[H and flush.
Does not touch cached footer/stream state — callers that want a
full state wipe should call reset() instead. Use this when only
the visible scrollback should be cleared (e.g. the /clear
command after which the footer immediately redraws).Source§fn suspend_for_external(&mut self)
fn suspend_for_external(&mut self)
Hand the terminal off to a non-TUI child process (blocking OAuth
flow,
/shell, etc.): disable raw mode + bracketed paste, finish
any pending writes. After this returns, the child is free to use
the terminal in cooked mode; resume_from_external() must be
called before any further render() calls.Source§fn resume_from_external(&mut self)
fn resume_from_external(&mut self)
Take the terminal back after
suspend_for_external(): re-enable
raw mode + bracketed paste AND call reset() to wipe the cached
state (the child wrote to stdout in cooked mode, so our cursor
tracking is now lying).Source§fn flush_deferred(&mut self)
fn flush_deferred(&mut self)
Paint any throttled payload that’s been sitting in the deferred
queue past its throttle window. Called from the event loop on a
~50fps timer so the “trailing edge” of a burst of input renders
actually lands — without this tick a lone stale payload would
stay invisible until the next unrelated render arrived. Read more
Source§fn on_resize(&mut self, cols: u16, rows: u16)
fn on_resize(&mut self, cols: u16, rows: u16)
Terminal window was resized to
(cols, rows). DECSTBM-based
renderers must re-issue the scroll region (\x1b[1;H-N r) so
the fixed footer stays pinned to the new bottom. Non-DECSTBM
renderers can treat this as a redraw hint or a no-op. Read moreSource§fn pop_approval_prompt(&mut self)
fn pop_approval_prompt(&mut self)
Remove the most recent
ApprovalPrompt body row, if the tail
row is one. Called by the event loop after the user responds
Y/A/N so the prompt stops sitting in the body above the footer.
Default: no-op — implementations that stream body lines to
stdout (plain/pipe mode) can’t retract them.Source§fn scroll_body(&mut self, delta: i32)
fn scroll_body(&mut self, delta: i32)
Scroll the body viewport up (negative
delta) or down
(positive delta) by delta rows. Used by AltScreenRenderer
to support PageUp / PageDown / arrow-up scrollback navigation
inside the alt-screen (where the host terminal’s native
scrollback is unavailable). Read moreSource§fn scroll_body_to_top(&mut self)
fn scroll_body_to_top(&mut self)
Jump the body viewport to the absolute top / bottom of
scrollback. Used for Home / End key handling.
fn scroll_body_to_bottom(&mut self)
Source§fn begin_selection(&mut self, col: u16, row: u16)
fn begin_selection(&mut self, col: u16, row: u16)
Mouse text-selection hooks. Backends that own mouse capture can
override these; streaming/native-scrollback backends keep host
terminal selection behavior and no-op here.
fn update_selection(&mut self, col: u16, row: u16)
fn end_selection(&mut self)
Source§fn copy_selection(&mut self) -> bool
fn copy_selection(&mut self) -> bool
Copy the current mouse-selection text to the system clipboard
(using arboard, not OSC 52) and clear the selection highlight.
Returns
true if a non-empty selection was copied. Read moreUpdate the cached welcome banner’s model / working_dir fields in
place and trigger a repaint of the banner rows. Used after the
QR-onboarding
/codingplan claim finishes: the banner was
painted at the top of scrollback with model="" (the claim
hadn’t picked a default provider yet) — once the claim writes
ctx.model_name, this hook splices the resolved model into the
existing banner rows so the user doesn’t see a permanently
blank model bullet. Read moreAuto Trait Implementations§
impl Freeze for TaskRenderer
impl !RefUnwindSafe for TaskRenderer
impl Send for TaskRenderer
impl Sync for TaskRenderer
impl Unpin for TaskRenderer
impl UnsafeUnpin for TaskRenderer
impl !UnwindSafe for TaskRenderer
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more