writeln method
Writes a line to the terminal output and tracks it.
Implementation
void writeln([String line = '']) {
TerminalContext.output.writeln(line);
// Count the line itself plus any embedded newlines
_lineCount += 1 + '\n'.allMatches(line).length;
}