This allows the backend to communicate when it's ready to resize etc.
@@ -53,6 +53,9 @@ class FakeTerminalBackend extends TerminalBackend {
// ignore: close_sinks
late final _outStream;
+ @override
+ bool get isReady => true;
+
@override
Future<int> get exitCode => _exitCodeCompleter.future;
@@ -33,6 +33,9 @@ class LocalTerminalBackend extends TerminalBackend {
environment: Platform.environment,
);
Future<int> get exitCode => pty.exitCode;
@@ -34,6 +34,9 @@ class FakeTerminalBackend extends TerminalBackend {
final _outStream = StreamController<String>();
@@ -52,6 +52,9 @@ class SSHTerminalBackend extends TerminalBackend {
_outStream.sink.add(data);
}
@@ -669,7 +669,7 @@ class Terminal
String? get selectedText => getSelectedText();
- bool get isReady => true;
+ bool get isReady => backend?.isReady ?? true;
void onMouseTap(Position position) {
@@ -9,6 +9,9 @@ abstract class TerminalBackend {
/// then strongly consider instantiating them here
void init();
+ /// returns whether the backend is ready to be used
+ bool get isReady;
/// Stream for data that gets read from the backend
Stream<String> get out;
@@ -36,6 +36,9 @@ class FakeBackend implements TerminalBackend {
void ackProcessed() {}
// TODO: implement exitCode