exitFullScreen static method

void exitFullScreen()

Exits the "alternate" fullscreen buffer and returns to the normal screen.

Throws UnsupportedError if a terminal is not detected. Uses the ANSI escape sequence \x1B[?1049l.

Implementation

static void exitFullScreen() {
  if (!stdout.hasTerminal) {
    throw UnsupportedError("Terminal is not available");
  }
  stdout.write('\x1B[?1049l'); // Disable alternate screen buffer
}