xterm.dart icon indicating copy to clipboard operation
xterm.dart copied to clipboard

TerminalIsolate will block on start()

Open Daliji opened this issue 3 years ago • 2 comments

When using TerminalIsolate:

Future<TerminalIsolate> _ensureTerminalStarted() async {
    print("start");
    if (terminal == null) {
      terminal = TerminalIsolate(
        backend: FakeTerminalBackend(),
        maxLines: 10000,
        theme: widget.theme,
      );
    }

    if (!terminal!.isReady) {
      await terminal!.start(); // block here
    }
    print("end");
    return terminal!;
  }

the code will block on start().

Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel stable, 2.5.3, on macOS 12.1 21C52 darwin-arm, locale zh-Hans-CN)
[!] Android toolchain - develop for Android devices (Android SDK version 31.0.0)
    ✗ cmdline-tools component is missing
      Run `path/to/sdkmanager --install "cmdline-tools;latest"`
      See https://developer.android.com/studio/command-line for more details.
    ✗ Android license status unknown.
      Run `flutter doctor --android-licenses` to accept the SDK licenses.
      See https://flutter.dev/docs/get-started/install/macos#android-setup for more details.
[✓] Xcode - develop for iOS and macOS
[✓] Chrome - develop for the web
[✓] Android Studio (version 2020.3)
[✓] IntelliJ IDEA Ultimate Edition (version 2021.2.1)
[✓] VS Code (version 1.63.2)
[✓] Connected device (2 available)

! Doctor found issues in 1 category.

Daliji avatar Jan 25 '22 16:01 Daliji

I assume you tried to run the isolate example, right? I opened a PR that fixes the issue that sample currently has. Thanks for reporting it!

devmil avatar Jan 25 '22 19:01 devmil

Is the issue fixed?

devmil avatar Mar 13 '22 13:03 devmil