Skip to content

Commit

Permalink
[web][felt] Fix stdout inheritance for sub-processes (flutter#27070)
Browse files Browse the repository at this point in the history
  • Loading branch information
mdebbar authored Jun 30, 2021
1 parent d4431a7 commit 6e56edf
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
10 changes: 6 additions & 4 deletions lib/web_ui/dev/utils.dart
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,12 @@ Future<ProcessManager> 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);
Expand Down Expand Up @@ -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);
}
}

Expand Down
1 change: 1 addition & 0 deletions lib/web_ui/dev/watcher.dart
Original file line number Diff line number Diff line change
Expand Up @@ -245,6 +245,7 @@ class PipelineWatcher {
void _pipelineDone(int pipelineRunCount) {
if (pipelineRunCount == _pipelineRunCount) {
print('*** Done! ***');
print('Press \'q\' to exit felt');
}
}
}

0 comments on commit 6e56edf

Please sign in to comment.