FakeCliTerminal constructor

FakeCliTerminal({
  1. bool ansi = false,
  2. bool interactiveInput = false,
  3. bool outputIsTerminal = false,
  4. bool? errorIsTerminal,
  5. bool? hyperlinks,
  6. ColorMode colorMode = ColorMode.trueColor,
  7. bool styledUnderlines = true,
  8. bool? probedStyledUnderlines,
  9. int? columns,
  10. int width = 80,
  11. int height = 24,
  12. List<String> lines = const [],
  13. List<String> input = const [],
  14. List<String> answers = const [],
  15. FakeClock? fakeClock,
  16. 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,
     );