fix(prodtest): remove extra crlf in response in non-interactive mode
What changed, and why it matters
This commit fixes a minor formatting bug in the Trezor production-test command-line tool. Previously, every response line in non-interactive mode had an extra blank line (CRLF) appended. The change moves that blank line so it only appears in interactive mode, where it serves as a prompt separator. There is no security relevance in the commit or diff.
No security action needed. Treat as a normal bugfix.
Security signals we found
No strong security signals were identified.
Evidence from the diff
In core/embed/rtl/cli.c, the cli_process_command function previously printed an unconditional \r\n after a command finished, then printed another \r\n and the interactive prompt only when cli->interactive was true. The patch removes the unconditional \r\n and makes it conditional on interactive mode. A changelog fragment notes the extra CRLF was removed in non-interactive mode. This is purely a UI/output formatting fix.
Changed components
core/embed/rtl/cli.cTrezor production-test CLI output formattingInspect captured patch +3 / −3
diff --git a/core/embed/projects/prodtest/.changelog.d/5595.fixed b/core/embed/projects/prodtest/.changelog.d/5595.fixed
new file mode 100644
index 000000000..6c36cbba1
--- /dev/null
+++ b/core/embed/projects/prodtest/.changelog.d/5595.fixed
@@ -0,0 +1 @@
+Removed the extra CRLF added to each response line in non-interactive mode.
diff --git a/core/embed/rtl/cli.c b/core/embed/rtl/cli.c
index 07b37a1ed..6f061f91c 100644
--- a/core/embed/rtl/cli.c
+++ b/core/embed/rtl/cli.c
@@ -551,12 +551,11 @@ void cli_process_command(cli_t* cli, const cli_command_t* cmd) {
cli_error(cli, CLI_ERROR_FATAL,
"Command handler didn't finish properly.");
}
- } else {
- // Finalize the last command with an empty line
- cli_printf(cli, "\r\n");
}
if (cli->interactive) {
+ // Finalize the last command with an empty line
+ cli_printf(cli, "\r\n");
// Print the prompt
cli_printf(cli, "> ");
}
Why this scored 15/100
Community notes
Notes can correct, qualify, or add evidence to the AI analysis. Every note shown here has been validated by a human moderator.
The AI analysis stands alone for now. Submit a note if you can add evidence or important context.