diff --git a/packages/flutter_tools/lib/src/base/logger.dart b/packages/flutter_tools/lib/src/base/logger.dart index 73335e8448..dd9d53af96 100644 --- a/packages/flutter_tools/lib/src/base/logger.dart +++ b/packages/flutter_tools/lib/src/base/logger.dart @@ -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'; diff --git a/packages/flutter_tools/lib/src/resident_runner.dart b/packages/flutter_tools/lib/src/resident_runner.dart index bd3b8741e2..6023ef4f8a 100644 --- a/packages/flutter_tools/lib/src/resident_runner.dart +++ b/packages/flutter_tools/lib/src/resident_runner.dart @@ -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') { diff --git a/packages/flutter_tools/lib/src/run_cold.dart b/packages/flutter_tools/lib/src/run_cold.dart index ab2587ce4e..fa2e88c9d9 100644 --- a/packages/flutter_tools/lib/src/run_cold.dart +++ b/packages/flutter_tools/lib/src/run_cold.dart @@ -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".'); } } diff --git a/packages/flutter_tools/lib/src/run_hot.dart b/packages/flutter_tools/lib/src/run_hot.dart index 27379c59e1..7f2fbf58a8 100644 --- a/packages/flutter_tools/lib/src/run_hot.dart +++ b/packages/flutter_tools/lib/src/run_hot.dart @@ -230,7 +230,7 @@ class HotRunner extends ResidentRunner { @override Future 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".'); } }