From fff48fc4415d6d4925bc466ba421361e8e11f756 Mon Sep 17 00:00:00 2001 From: Mex <44814932+MMexicann@users.noreply.github.com> Date: Sun, 15 Nov 2026 19:52:03 +0100 Subject: [PATCH] M0.9: escape terminal controls in CLI operation errors Apply the existing printable-text rule at the final Usage and Failed error output boundary, preserving exit codes and the help footer. --- apps/figcraft-cli/src/main.rs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/apps/figcraft-cli/src/main.rs b/apps/figcraft-cli/src/main.rs index 2d3596bca..44bdd4520 100644 --- a/apps/figcraft-cli/src/main.rs +++ b/apps/figcraft-cli/src/main.rs @@ -38,14 +38,15 @@ fn main() -> ExitCode { return ExitCode::from(u8::try_from(e.exit_code()).unwrap_or(2)); } }; + // Paths and imported/plugin errors may carry terminal controls; keep diagnostics printable. match run(cli) { Ok(code) => code, Err(CliError::Usage(msg)) => { - eprintln!("error: {msg}\n\nFor more information, try '--help'."); + eprintln!("error: {}\n\nFor more information, try '--help'.", files::plain(&msg)); ExitCode::from(2) } Err(CliError::Failed(msg)) => { - eprintln!("error: {msg}"); + eprintln!("error: {}", files::plain(&msg)); ExitCode::from(1) } }