Unverified Commit c9c1068c authored by Jason Simmons's avatar Jason Simmons Committed by GitHub

Filter invalid characters in the terminal input stream (#18892)

Fixes https://github.com/flutter/flutter/issues/18007
parent 35ad2a78
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
// found in the LICENSE file. // found in the LICENSE file.
import 'dart:async'; import 'dart:async';
import 'dart:convert' show ascii; import 'dart:convert' show AsciiDecoder;
import 'package:quiver/strings.dart'; import 'package:quiver/strings.dart';
...@@ -87,7 +87,7 @@ class AnsiTerminal { ...@@ -87,7 +87,7 @@ class AnsiTerminal {
/// ///
/// Useful when the console is in [singleCharMode]. /// Useful when the console is in [singleCharMode].
Stream<String> get onCharInput { Stream<String> get onCharInput {
_broadcastStdInString ??= io.stdin.transform(ascii.decoder).asBroadcastStream(); _broadcastStdInString ??= io.stdin.transform(const AsciiDecoder(allowInvalid: true)).asBroadcastStream();
return _broadcastStdInString; return _broadcastStdInString;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment