render
Class info¶
๐ DocStrings¶
Small rendering helpers: terminal output, pills, icons.
MAX_TERMINAL_LINES
module-attribute
¶
Lines of terminal output rendered (older ones are scrolled out).
TOOL_KIND_ICONS
module-attribute
¶
TOOL_KIND_ICONS: dict[str, str] = {
"read": "ยป",
"edit": "โ",
"delete": "โ",
"move": "โ",
"search": "โ",
"execute": "$",
"think": "โฆ",
"fetch": "โ",
"switch_mode": "โ",
"other": "โข",
}
Single-width symbols for tool kinds (emoji widths vary between terminals).
human_tokens
¶
pill
¶
Text as a pill with half-block ends.
Adapted from toad (https://github.com/batrachianai/toad, src/toad/pill.py),
Copyright (c) Will McGugan, AGPL-3.0.
Source code in src/acptui/ui/render.py
status_icon
¶
terminal_text
¶
terminal_text(data: bytes, max_lines: int = MAX_TERMINAL_LINES) -> Text
Render terminal output bytes: ANSI colors, carriage-return overwrites, last max_lines.
This is not a terminal emulator: cursor movement is ignored, but colors and progress lines redrawn with carriage returns come out right.