forked from firka/flutter
[flutter_tools] catch StdinException when setting terminal to SingleCharMode (#136283)
Fixes https://github.com/flutter/flutter/issues/129198
This commit is contained in:
committed by
GitHub
parent
54cf286e1a
commit
b416473bbb
@@ -314,13 +314,19 @@ class AnsiTerminal implements Terminal {
|
||||
return;
|
||||
}
|
||||
final io.Stdin stdin = _stdio.stdin as io.Stdin;
|
||||
// The order of setting lineMode and echoMode is important on Windows.
|
||||
if (value) {
|
||||
stdin.echoMode = false;
|
||||
stdin.lineMode = false;
|
||||
} else {
|
||||
stdin.lineMode = true;
|
||||
stdin.echoMode = true;
|
||||
|
||||
try {
|
||||
// The order of setting lineMode and echoMode is important on Windows.
|
||||
if (value) {
|
||||
stdin.echoMode = false;
|
||||
stdin.lineMode = false;
|
||||
} else {
|
||||
stdin.lineMode = true;
|
||||
stdin.echoMode = true;
|
||||
}
|
||||
} on io.StdinException {
|
||||
// If the pipe to STDIN has been closed it's probably because the
|
||||
// terminal has been closed, and there is nothing actionable to do here.
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user