FakeCliTerminal constructor
FakeCliTerminal({
- bool ansi = false,
- bool interactiveInput = false,
- bool outputIsTerminal = false,
- bool? errorIsTerminal,
- bool? hyperlinks,
- ColorMode colorMode = ColorMode.trueColor,
- bool styledUnderlines = true,
- bool? probedStyledUnderlines,
- int? columns,
- int width = 80,
- int height = 24,
- List<
String> lines = const [], - List<
String> input = const [], - List<
String> answers = const [], - FakeClock? fakeClock,
- bool progressReports = false,
A terminal of the capabilities given, all off by default: nobody
answers, the output is a pipe. lines answer readLine, input is
typed into the inline session, columns is its width (null for
none where output is no terminal), width × height the screen's
size where it is one; fakeClock times the session.
progressReports says the terminal shows a program's progress in
its tab (OSC 9;4), which the inline session then writes;
styledUnderlines false that it shows no underline styles, as
Terminal.app, and probedStyledUnderlines what the inline session's
probe finds of them, styledUnderlines by default: false beside a
true one is Terminal.app over ssh, which its environment doesn't
tell.
Implementation
FakeCliTerminal({
bool ansi = false,
bool interactiveInput = false,
bool outputIsTerminal = false,
bool? errorIsTerminal,
bool? hyperlinks,
this.colorMode = ColorMode.trueColor,
bool styledUnderlines = true,
bool? probedStyledUnderlines,
int? columns,
this.width = 80,
this.height = 24,
List<String> lines = const [],
List<String> input = const [],
List<String> answers = const [],
FakeClock? fakeClock,
this.progressReports = false,
}) : capabilities = CliCapabilities(
ansi: ansi,
interactiveInput: interactiveInput,
outputIsTerminal: outputIsTerminal,
errorIsTerminal: errorIsTerminal,
hyperlinks: hyperlinks,
colorMode: colorMode,
styledUnderlines: styledUnderlines,
),
_probedUnderlines = probedStyledUnderlines ?? styledUnderlines,
_columns = columns ?? (outputIsTerminal ? width : null),
_lines = [...lines],
_input = [...input],
_answers = [...answers],
clock = fakeClock == null
? const CliClock.system()
: _FakeCliClock(fakeClock),
screen = Vt(
width,
height,
scrollback: true,
allowLineFeed: true,
strict: false,
);