run<T> method

T run<T>(
  1. T body()
)

Runs body with this as Terminal.current and the prompt mode worked out from it.

Implementation

T run<T>(T Function() body) {
  final previous = PromptMode.forced;
  PromptMode.current = interactive ? PromptMode.rich : PromptMode.line;
  try {
    return Terminal.use(this, body);
  } finally {
    PromptMode.current = previous;
  }
}