use linesplitter on stdout

master
fuwa 4 years ago
parent a35249348f
commit 094417ac68

@ -75,7 +75,7 @@ build:
build-debug: build-debug:
cd cyberwow && \ cd cyberwow && \
flutter build apk --debug --target-platform android-arm64 -v flutter build apk --debug --target-platform android-arm64
install: build install: build
cd cyberwow && \ cd cyberwow && \

@ -79,7 +79,11 @@ Stream<String> runBinary
if (input != null) { if (input != null) {
printInput(); printInput();
} }
await for (final line in outputProcess.stdout.transform(utf8.decoder)) {
final _stdout = outputProcess.stdout
.transform(utf8.decoder).transform(const LineSplitter());
await for (final line in _stdout) {
log.finest('process output: ' + line); log.finest('process output: ' + line);
yield line; yield line;
} }

@ -66,7 +66,7 @@ class SyncedState extends AppState {
} }
void appendInput(final String line) { void appendInput(final String line) {
stdout.addLast(config.c.promptString + line + '\n'); stdout.addLast(config.c.promptString + line);
syncState(); syncState();
processInput.add(line); processInput.add(line);

@ -34,7 +34,7 @@ import 'exiting.dart';
class SyncingState extends AppState { class SyncingState extends AppState {
final Queue<String> stdout = Queue.from(['']); final Queue<String> stdout = Queue();
bool synced = false; bool synced = false;

@ -278,7 +278,7 @@ Widget terminalView(BuildContext context, String title, SyncedState state) {
Text Text
( (
state.stdout.join(), state.stdout.join('\n'),
style: Theme.of(context).textTheme.body2, style: Theme.of(context).textTheme.body2,
) )
], ],

@ -52,7 +52,7 @@ Widget build(BuildContext context, SyncingState state) {
reverse: true, reverse: true,
child: Text child: Text
( (
state.stdout.join(), state.stdout.join('\n'),
style: Theme.of(context).textTheme.body1, style: Theme.of(context).textTheme.body1,
) )
) )

Loading…
Cancel
Save