dart_console icon indicating copy to clipboard operation
dart_console copied to clipboard

windowWidth and windowHeight do not update on window resize (linux)

Open rightbrace opened this issue 3 years ago • 0 comments

Like the title says, the fields console.windowWidth and console.windowHeight work correctly, but do not update after a window resize. Here's an example:

import 'package:dart_console/dart_console.dart';
import 'dart:io';

void main() {
  final console = Console();
  while (true) {
    var key = console.readKey();
    if (key.char == 'q') {
      break;
    } else {
      // Press some keys, resize the window, press some more keys
      stdout.writeln('${console.windowWidth}x${console.windowHeight}'); // Does not update
      stdout.writeln('${stdout.terminalColumns}x${stdout.terminalLines}'); // Updates
    }
  }
}

This was observed in gnome-terminal and vscode's integrated terminal.

rightbrace avatar Jan 15 '21 16:01 rightbrace