1
0
mirror of https://github.com/trezor/trezor-firmware.git synced 2025-03-19 01:26:06 +00:00

feat(core/prodtest): Allow prodtest to exit from interactive mode [no changelog]

This commit is contained in:
kopecdav 2025-02-11 12:39:48 +01:00 committed by kopecdav
parent 296f51a059
commit f1db0e6906
2 changed files with 11 additions and 0 deletions

View File

@ -12,6 +12,8 @@ The prodtest includes a simple text-based command-line interface that can be con
Pressing the ENTER key twice switches the interface to interactive mode, enabling basic line editing, autocomplete functionality (using the TAB key), and text coloring.
To exit from interactive mode type `.+ENTER`.
### Commands
These commands begin with the command name and may optionally include parameters separated by spaces.

View File

@ -569,6 +569,15 @@ void cli_run_loop(cli_t* cli) {
}
cli->empty_lines = 0;
// Quit interactive mode on `.+ENTER`
if ((strcmp(cli->cmd_name, ".") == 0)) {
if (cli->interactive) {
cli->interactive = false;
cli_trace(cli, "Exiting interactive mode...");
}
continue;
}
// Find the command handler
cli->current_cmd = cli_find_command(cli, cli->cmd_name);