fix(ui): resolve M2 blocking bugs with full POSIX fork/exec PTY spawn and tmux environment isolation
This commit is contained in:
@@ -0,0 +1,27 @@
|
||||
import 'dart:async';
|
||||
import 'dart:convert';
|
||||
import 'dart:io';
|
||||
import 'package:mam_pty/mam_pty.dart';
|
||||
import 'package:test/test.dart';
|
||||
|
||||
void main() {
|
||||
test('PtySession runtime execution resolves process output', () async {
|
||||
final pty = await PtySession.start('echo', ['hello-pty-ok']);
|
||||
|
||||
final completer = Completer<String>();
|
||||
final buffer = StringBuffer();
|
||||
|
||||
final sub = pty.stdout.listen((data) {
|
||||
buffer.write(utf8.decode(data));
|
||||
}, onDone: () {
|
||||
completer.complete(buffer.toString());
|
||||
});
|
||||
|
||||
final result = await completer.future.timeout(const Duration(seconds: 3));
|
||||
sub.cancel();
|
||||
pty.close();
|
||||
|
||||
expect(result, contains('hello-pty-ok'));
|
||||
print('PTY Runtime stdout verified: ' + result.trim());
|
||||
});
|
||||
}
|
||||
Reference in New Issue
Block a user