clearScreen static method

void clearScreen()

Clear the terminal screen

Implementation

static void clearScreen() {
  if (Platform.isWindows) {
    // Windows
    print(Process.runSync('cls', [], runInShell: true).stdout);
  } else {
    // Unix-like (macOS, Linux)
    stdout.write('\x1B[2J\x1B[0;0H');
  }
}