Comments (8)
Oh man, well tools like ag
will change their output format when they detect they are being piped to another process. git
uses the flag --porcelain
to indicate output that is verbose and meant to be parsed by another tool.
I think making --verbose
imply that is fine and I don't recommend those other approaches.
from flutter.
Ah, I just filed #147936 which is a duplicate. We need to check that stdout is a terminal type and disable the pretty printing if its not. It is also ok to allow manually disabling pretty printing to terminal types too.
from flutter.
As an aside, we need to go a bit out our way to fool Xcode since it pretends to be a terminal but can't handle being a terminal quite right. GN does this detection.
from flutter.
https://api.dart.dev/stable/3.3.4/dart-io/Stdout/hasTerminal.html may be what we need (and the one for stderr).
from flutter.
Update: We do some checks for hasTerminal
and supportsAnsiEscapes
, but it sounds like those are either insufficient, or give false-positives.
from flutter.
When I do:
flutter % et build -v | grep supportsAnsiEscapes
supportsAnsiEscapes: false | hasTerminal: false
... it appears detection does work, so I'm assuming we're not guarding something we should be.
from flutter.
The fix is as simple as:
diff --git a/tools/engine_tool/lib/src/logger.dart b/tools/engine_tool/lib/src/logger.dart
index 28bd847885..8b4565d94b 100644
--- a/tools/engine_tool/lib/src/logger.dart
+++ b/tools/engine_tool/lib/src/logger.dart
@@ -169,6 +169,8 @@ class Logger {
/// and emits a carriage return.
void clearLine() {
if (!io.stdout.hasTerminal || _test) {
+ // Just emit a newline in tests or when not connected to a terminal.
+ _ioSinkWrite(io.stdout, '\n');
return;
}
However, it is next to impossible to test because the Logger does a bunch of things with global state.
I'm going to provide a bit more TLC to logger.dart
and then land the fix.
from flutter.
This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of flutter doctor -v
and a minimal reproduction of the issue.
from flutter.
Related Issues (20)
- [web] Find an ergonomic solution for CORS images for CanvasKit and Skwasm
- Re-enable sandboxing for flutter/packages macOS tests
- mac-25 lost external connection phone device. HOT 1
- Basic example in RFW does not render. HOT 4
- [in_app_purchase_storekit] Remove OCMock from package
- Presubmit builds may check out the wrong commit HOT 21
- Upgrade 50% of macOS bots to macOS 14 HOT 2
- Update `flutter create -t plugin` to recommend supporting both CocoaPods and Swift Package Manager
- [CP] Update Flutter Fix Log on How to Update Kotlin Gradle Plugin HOT 3
- win-7 is getting dimensions error. HOT 1
- Flutter plugin check has too strict regular expression validation HOT 2
- [web] sink pictures/platform views to the lowest available overlay
- Assets path is different depending on compilation mode on web. HOT 1
- [webview_flutter] Allow returning a value from JavascriptChannel handler HOT 5
- ExoPlayer Playback Error: "Decoder init failed: OMX.qcom.video.decoder.avc. ExoPlayer MediaCodecVideoRenderer Error HOT 1
- [google_maps_flutter] Update iOS GoogleMaps dependency to support 9.0 HOT 1
- Unable to run "adb" HOT 3
- [WEB] [flutter_service_worker] Fails to register if called from multiple subdomain HOT 1
- Issue with canCheckBiometrics HOT 1
- Staggering of scroll view when scroll bar is held and scrolled to the last item in the list. HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from flutter.