fix: fixed tab character display holes in UI by sanitizing output
- Fixed tab character display in error messages and bash tool output by applying replaceTabs() sanitization. - Added TUI rendering sanitization documentation to AGENTS.md with guidelines for sanitizing text in tool renderers. - Applied replaceTabs() function to error text in patch shared module to ensure proper tab-to-space conversion. - Applied replaceTabs() function to bash tool output lines in both expanded and collapsed display modes.
This commit is contained in:
@@ -265,13 +265,13 @@ export const editToolRenderer = {
|
||||
|
||||
if (result.isError) {
|
||||
if (errorText) {
|
||||
text += `\n\n${uiTheme.fg("error", errorText)}`;
|
||||
text += `\n\n${uiTheme.fg("error", replaceTabs(errorText))}`;
|
||||
}
|
||||
} else if (result.details?.diff) {
|
||||
text += renderDiffSection(result.details.diff, rawPath, expanded, uiTheme, ui, renderDiffFn);
|
||||
} else if (editDiffPreview) {
|
||||
if ("error" in editDiffPreview) {
|
||||
text += `\n\n${uiTheme.fg("error", editDiffPreview.error)}`;
|
||||
text += `\n\n${uiTheme.fg("error", replaceTabs(editDiffPreview.error))}`;
|
||||
} else if (editDiffPreview.diff) {
|
||||
text += renderDiffSection(editDiffPreview.diff, rawPath, expanded, uiTheme, ui, renderDiffFn);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user