brush: route rb_dbg diagnostics to /scheme/debug instead of stderr

Writing startup diagnostics to stderr interleaves with the interactive
console on the live image; /scheme/debug reaches the serial log without
disturbing the shell's tty.
This commit is contained in:
2026-07-20 09:05:44 +09:00
parent 299a86f6e3
commit 37c2ecece4
@@ -78,8 +78,8 @@ index 15340ad..46774c3 100644
+#[doc(hidden)]
+fn rb_dbg(m: &str) {
+ use std::io::Write;
+ let _ = std::io::stderr().write_all(m.as_bytes());
+ let _ = std::io::stderr().flush();
+ let df = std::fs::OpenOptions::new().write(true).open("/scheme/debug");
+ if let Ok(mut df) = df { let _ = df.write_all(m.as_bytes()); }
+}
+
/// Main entry point for the `brush` shell.