ignore exceptions from stdin.lineMode (#7439)

* ignore exceptions from stdin.lineMode

* only catch IOException
diff --git a/packages/flutter_tools/lib/src/base/logger.dart b/packages/flutter_tools/lib/src/base/logger.dart
index bd10a17..b841b6b 100644
--- a/packages/flutter_tools/lib/src/base/logger.dart
+++ b/packages/flutter_tools/lib/src/base/logger.dart
@@ -221,7 +221,11 @@
   String clearScreen() => supportsColor ? _clear : '\n\n';
 
   set singleCharMode(bool value) {
-    stdin.lineMode = !value;
+    try {
+      stdin.lineMode = !value;
+    } on IOException {
+      // This can throw for some terminals; we ignore the error.
+    }
   }
 
   /// Return keystrokes from the console.