Companion

Functions

Link copied to clipboard
fun screen(output: String): String

Output as a terminal would show it (TerminalText.plain): progress bars redrawn with \r collapse to their last state and escape codes go, so the model reads text, not control codes.

Link copied to clipboard
fun truncateTail(text: String, maxChars: Int): String

Keep the end of text (errors land there), marking what was cut, within maxChars (Harness truncate_tail).