From 539262ee643319c7b677bac077d66fc930b43500 Mon Sep 17 00:00:00 2001 From: Lex Christopherson Date: Fri, 13 Mar 2026 16:56:06 -0600 Subject: [PATCH] fix: strip hashline prefixes from TUI read output (#265) Hashline prefixes (e.g. "1#BQ:") were leaking into the TUI display for file reads, showing as weird characters to users. Strip them before rendering since they're only meant for model consumption. Co-Authored-By: Claude Opus 4.6 (1M context) --- .../src/modes/interactive/components/tool-execution.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/packages/pi-coding-agent/src/modes/interactive/components/tool-execution.ts b/packages/pi-coding-agent/src/modes/interactive/components/tool-execution.ts index b64755fbe..15562943d 100644 --- a/packages/pi-coding-agent/src/modes/interactive/components/tool-execution.ts +++ b/packages/pi-coding-agent/src/modes/interactive/components/tool-execution.ts @@ -633,7 +633,9 @@ export class ToolExecutionComponent extends Container { text = `${theme.fg("toolTitle", theme.bold("read"))} ${pathDisplay}`; if (this.result) { - const output = this.getTextOutput(); + const rawOutput = this.getTextOutput(); + // Strip hashline prefixes (e.g. "1#BQ:content") for TUI display + const output = rawOutput.replace(/^(\s*)\d+#[ZPMQVRWSNKTXJBYH]{2}:/gm, "$1"); const rawPath = str(this.args?.file_path ?? this.args?.path); const lang = rawPath ? getLanguageFromPath(rawPath) : undefined; const lines = lang ? highlightCode(replaceTabs(output), lang) : output.split("\n");