story-kit: merge 158_bug_pty_debug_log_panics_on_multi_byte_utf_8_characters

This commit is contained in:
Dave
2026-02-24 16:31:43 +00:00
parent d21a5ebee4
commit 8583f2389f

View File

@@ -246,10 +246,11 @@ fn run_pty_session(
continue; continue;
} }
slog!( let mut end = trimmed.len().min(120);
"[pty-debug] processing: {}...", while !trimmed.is_char_boundary(end) {
&trimmed[..trimmed.len().min(120)] end -= 1;
); }
slog!("[pty-debug] processing: {}...", &trimmed[..end]);
// Try to parse as JSON // Try to parse as JSON
if let Ok(json) = serde_json::from_str::<serde_json::Value>(trimmed) if let Ok(json) = serde_json::from_str::<serde_json::Value>(trimmed)