From 0ab11ab2527a33260062c9e12803e8196582df0d Mon Sep 17 00:00:00 2001 From: Mouad Debbar Date: Wed, 30 Jun 2021 12:26:02 -0700 Subject: [PATCH] [web][felt] Fix stdout inheritance for sub-processes (flutter/engine#27070) --- engine/src/flutter/lib/web_ui/dev/utils.dart | 10 ++++++---- engine/src/flutter/lib/web_ui/dev/watcher.dart | 1 + 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/engine/src/flutter/lib/web_ui/dev/utils.dart b/engine/src/flutter/lib/web_ui/dev/utils.dart index e3ab776954..8f8af9a521 100644 --- a/engine/src/flutter/lib/web_ui/dev/utils.dart +++ b/engine/src/flutter/lib/web_ui/dev/utils.dart @@ -83,7 +83,12 @@ Future startProcess( // Running the process in a system shell for Windows. Otherwise // the process is not able to get Dart from path. runInShell: io.Platform.isWindows, - mode: io.ProcessStartMode.normal, + // When [evalOutput] is false, we don't need to intercept the stdout of the + // sub-process. In this case, it's better to run the sub-process in the + // `inheritStdio` mode which lets it print directly to the terminal. + // This allows sub-processes such as `ninja` to use all kinds of terminal + // features like printing colors, printing progress on the same line, etc. + mode: evalOutput ? io.ProcessStartMode.normal : io.ProcessStartMode.inheritStdio, environment: environment, ); processesToCleanUp.add(process); @@ -112,9 +117,6 @@ class ProcessManager { if (_evalOutput) { _forwardStream(process.stdout, _stdout); _forwardStream(process.stderr, _stderr); - } else { - _forwardStream(process.stdout, io.stdout); - _forwardStream(process.stderr, io.stderr); } } diff --git a/engine/src/flutter/lib/web_ui/dev/watcher.dart b/engine/src/flutter/lib/web_ui/dev/watcher.dart index 04e903440b..85e9464563 100644 --- a/engine/src/flutter/lib/web_ui/dev/watcher.dart +++ b/engine/src/flutter/lib/web_ui/dev/watcher.dart @@ -245,6 +245,7 @@ class PipelineWatcher { void _pipelineDone(int pipelineRunCount) { if (pipelineRunCount == _pipelineRunCount) { print('*** Done! ***'); + print('Press \'q\' to exit felt'); } } }