[flutter_tools] catch StdinException while trying to re-set single char mode (#107256)

This commit is contained in:
Christopher Fujino
2022-07-07 15:40:05 -07:00
committed by GitHub
parent 26c6456936
commit 84c8abd0f6
2 changed files with 37 additions and 2 deletions

View File

@@ -12,6 +12,7 @@ import 'package:vm_service/vm_service.dart';
import '../android/android_device.dart';
import '../base/common.dart';
import '../base/file_system.dart';
import '../base/io.dart';
import '../base/utils.dart';
import '../build_info.dart';
import '../daemon.dart';
@@ -719,7 +720,11 @@ class RunCommand extends RunCommandBase {
} finally {
// However we exited from the runner, ensure the terminal has line mode
// and echo mode enabled before we return the user to the shell.
globals.terminal.singleCharMode = false;
try {
globals.terminal.singleCharMode = false;
} on StdinException {
// Do nothing, if the STDIN handle is no longer available, there is nothing actionable for us to do at this point
}
}
return FlutterCommandResult(
ExitStatus.success,