Fix terminal-detection logic for progress bar (#3775)

diff --git a/lib/src/progress.dart b/lib/src/progress.dart
index a127ae5..ebddb2f 100644
--- a/lib/src/progress.dart
+++ b/lib/src/progress.dart
@@ -40,7 +40,7 @@
     // The animation is only shown when it would be meaningful to a human.
     // That means we're writing a visible message to a TTY at normal log levels
     // with non-JSON output.
-    if (terminalOutputForStdout ||
+    if (!terminalOutputForStdout ||
         !log.verbosity.isLevelVisible(level) ||
         fine ||
         log.verbosity.isLevelVisible(log.Level.fine)) {
diff --git a/test/testdata/goldens/embedding/embedding_test/--color forces colors.txt b/test/testdata/goldens/embedding/embedding_test/--color forces colors.txt
index ed56eb3..e4ad1d1 100644
--- a/test/testdata/goldens/embedding/embedding_test/--color forces colors.txt
+++ b/test/testdata/goldens/embedding/embedding_test/--color forces colors.txt
@@ -1,14 +1,14 @@
 # GENERATED BY: test/embedding/embedding_test.dart
 
 $ tool/test-bin/pub_command_runner.dart pub --no-color get
-Resolving dependencies... 
+Resolving dependencies...
 + foo 1.0.0 (2.0.0 available)
 Changed 1 dependency!
 
 -------------------------------- END OF OUTPUT ---------------------------------
 
 $ tool/test-bin/pub_command_runner.dart pub --color get
-Resolving dependencies... 
+Resolving dependencies...
   foo 1.0.0 (2.0.0 available)
 Got dependencies!
 
diff --git a/test/testdata/goldens/embedding/embedding_test/run works, though hidden.txt b/test/testdata/goldens/embedding/embedding_test/run works, though hidden.txt
index 8eea7f3..214712a 100644
--- a/test/testdata/goldens/embedding/embedding_test/run works, though hidden.txt
+++ b/test/testdata/goldens/embedding/embedding_test/run works, though hidden.txt
@@ -1,7 +1,7 @@
 # GENERATED BY: test/embedding/embedding_test.dart
 
 $ tool/test-bin/pub_command_runner.dart pub get
-Resolving dependencies... 
+Resolving dependencies...
 Got dependencies!
 
 -------------------------------- END OF OUTPUT ---------------------------------