forked from firka/flutter
Remove support for function keys. (#8840)
Function keys don't work great on any platform we support: * Mac doesn't have first-class function keys. * On Ubuntu: F1 opens the system help and F10 opens the file dialog. * ... and Windows is a mess as well.
This commit is contained in:
committed by
GitHub
parent
fac0fe35ba
commit
2291a56842
@@ -255,10 +255,6 @@ class AnsiTerminal {
|
||||
supportsColor = (term != null && term != 'dumb') || flutterAnsiTerm;
|
||||
}
|
||||
|
||||
static const String KEY_F1 = '\u001BOP';
|
||||
static const String KEY_F5 = '\u001B[15~';
|
||||
static const String KEY_F10 = '\u001B[21~';
|
||||
|
||||
static const String _bold = '\u001B[1m';
|
||||
static const String _reset = '\u001B[0m';
|
||||
static const String _clear = '\u001B[2J\u001B[H';
|
||||
|
||||
@@ -235,8 +235,8 @@ abstract class ResidentRunner {
|
||||
|
||||
printStatus(''); // the key the user tapped might be on this line
|
||||
|
||||
if (lower == 'h' || lower == '?' || character == AnsiTerminal.KEY_F1) {
|
||||
// F1, help
|
||||
if (lower == 'h' || lower == '?') {
|
||||
// help
|
||||
printHelp(details: true);
|
||||
return true;
|
||||
} else if (lower == 'w') {
|
||||
@@ -265,8 +265,8 @@ abstract class ResidentRunner {
|
||||
print('Switched operating system to: $platform');
|
||||
return true;
|
||||
}
|
||||
} else if (lower == 'q' || character == AnsiTerminal.KEY_F10) {
|
||||
// F10, exit
|
||||
} else if (lower == 'q') {
|
||||
// exit
|
||||
await stop();
|
||||
return true;
|
||||
} else if (lower == 'd') {
|
||||
|
||||
@@ -165,9 +165,9 @@ class ColdRunner extends ResidentRunner {
|
||||
printHelpDetails();
|
||||
}
|
||||
if (haveDetails && !details) {
|
||||
printStatus('For a more detailed help message, press "h" or F1. To quit, press "q", F10, or Ctrl-C.');
|
||||
printStatus('For a more detailed help message, press "h". To quit, press "q".');
|
||||
} else {
|
||||
printStatus('To repeat this help message, press "h" or F1. To quit, press "q", F10, or Ctrl-C.');
|
||||
printStatus('To repeat this help message, press "h". To quit, press "q".');
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -230,7 +230,7 @@ class HotRunner extends ResidentRunner {
|
||||
@override
|
||||
Future<Null> handleTerminalCommand(String code) async {
|
||||
final String lower = code.toLowerCase();
|
||||
if ((lower == 'r') || (code == AnsiTerminal.KEY_F5)) {
|
||||
if (lower == 'r') {
|
||||
final OperationResult result = await restart(fullRestart: code == 'R');
|
||||
if (!result.isOk) {
|
||||
// TODO(johnmccutchan): Attempt to determine the number of errors that
|
||||
@@ -511,16 +511,16 @@ class HotRunner extends ResidentRunner {
|
||||
const String bold = '\u001B[0;1m';
|
||||
const String reset = '\u001B[0m';
|
||||
printStatus(
|
||||
'$fire To hot reload your app on the fly, press "r" or F5. To restart the app entirely, press "R".',
|
||||
'$fire To hot reload your app on the fly, press "r". To restart the app entirely, press "R".',
|
||||
ansiAlternative: '$red$fire$bold To hot reload your app on the fly, '
|
||||
'press "r" or F5. To restart the app entirely, press "R".$reset'
|
||||
'press "r". To restart the app entirely, press "R".$reset'
|
||||
);
|
||||
printStatus('The Observatory debugger and profiler is available at: $_observatoryUri');
|
||||
if (details) {
|
||||
printHelpDetails();
|
||||
printStatus('To repeat this help message, press "h" or F1. To quit, press "q", F10, or Ctrl-C.');
|
||||
printStatus('To repeat this help message, press "h". To quit, press "q".');
|
||||
} else {
|
||||
printStatus('For a more detailed help message, press "h" or F1. To quit, press "q", F10, or Ctrl-C.');
|
||||
printStatus('For a more detailed help message, press "h". To quit, press "q".');
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user