Skip to main content
function Writable.close
def Writable.close() -> None
Closes this output stream. This drops the underlying handle, and subsequent writes will fail with “stream is closed”. function Writable.flush
def Writable.flush() -> None
Flushes this output stream, ensuring that all intermediately buffered contents reach their destination. function Writable.write
def Writable.write(
buf: typing.Any,
/,
*,
copy: bool = True
) -> int
Writes a buffer into this writer, returning how many bytes were written. What is written to stdout or stderr is also copied to the task history’s output.log and output.ansi; copy = False leaves it out of them. property Writable.color
Writable.color: bool
Whether lines written here may carry ANSI color, by the rules clap colors --help with: never under a non-empty NO_COLOR, always under a non-empty CLICOLOR_FORCE, never under CLICOLOR=0, and otherwise on a terminal whose TERM is not dumb (and, off Windows, is set), or with CLICOLOR or CI set. std.io.stderr also colors on a CI host whose log renders ANSI (GitHub Actions, Buildkite, CircleCI, GitLab CI). Never on any other stream (files, a child’s stdin). property Writable.is_tty
Writable.is_tty: bool
Returns true if the underlying stream is connected to a terminal/tty.