let cursor = 0;
const result = await terminal.output({ since: cursor });
process.stdout.write(result.text);
cursor = result.cursor;import sys
cursor = 0
result = terminal.output(since=cursor)
sys.stdout.write(result["text"])
cursor = result["cursor"]sincenumberOutput cursor to continue from. Defaults to 0 for all retained output.
The response carries new text, the next cursor, terminal status, exit code and busy state. The instance's status, busy, exitCode and cwd are updated when returned by the API.