refactor: simplify exec stream chunks

This commit is contained in:
Peter Steinberger
2026-04-11 00:51:50 +01:00
parent 0f9de014e9
commit 2202392849

View File

@@ -629,7 +629,7 @@ export async function runExecProcess(opts: {
};
const handleStdout = (data: string) => {
const raw = data.toString();
const raw = data;
// Detect smkx/rmkx BEFORE sanitizeBinaryOutput strips ESC sequences.
// Note: PTY chunking is arbitrary, but smkx/rmkx sequences are typically short (4-5 bytes)
// and sent atomically by terminals. Split across chunks is rare in practice.
@@ -645,7 +645,7 @@ export async function runExecProcess(opts: {
};
const handleStderr = (data: string) => {
const str = sanitizeBinaryOutput(data.toString());
const str = sanitizeBinaryOutput(data);
for (const chunk of chunkString(str)) {
appendOutput(session, "stderr", chunk);
emitUpdate();