Fix crash when bash mode outputs binary data

Sanitize shell output by removing Unicode Format characters and lone
surrogates that crash string-width. This fixes crashes when running
commands like curl that download binary files.
This commit is contained in:
Mario Zechner 2025-12-08 23:26:58 +01:00
parent a054fecd11
commit ad42ebf5f5
5 changed files with 141 additions and 111 deletions

View file

@ -65,6 +65,7 @@ export class BashExecutionComponent extends Container {
appendOutput(chunk: string): void {
// Strip ANSI codes and normalize line endings
// Note: binary data is already sanitized in tui-renderer.ts executeBashCommand
const clean = stripAnsi(chunk).replace(/\r\n/g, "\n").replace(/\r/g, "\n");
// Append to output lines