Minor bug fix for padding

This commit is contained in:
Matthew Breedlove
2025-08-12 03:28:59 -04:00
parent e0012bc0eb
commit a69a6997d0
2 changed files with 9 additions and 3 deletions
+2 -1
View File
@@ -1,6 +1,6 @@
{
"name": "ccstatusline",
"version": "1.1.5",
"version": "1.1.6",
"description": "A customizable status line formatter for Claude Code CLI",
"module": "src/ccstatusline.ts",
"type": "module",
@@ -12,6 +12,7 @@
],
"scripts": {
"start": "bun run patch && bun run src/ccstatusline.ts",
"statusline": "bun run src/ccstatusline.ts",
"patch": "patch-package",
"build": "bun run patch && rm -rf dist/* && bun build src/ccstatusline.ts --target=node --outfile=dist/ccstatusline.js --target-version=14",
"prepublishOnly": "bun run build"
+7 -2
View File
@@ -718,9 +718,14 @@ export function renderStatusLine(
elem.content +
applyColorsWithOverride(padding, undefined, elem.item?.backgroundColor);
finalElements.push(paddedContent);
} else if (padding) {
// Wrap padding in ANSI reset codes to prevent trimming
// This ensures leading spaces aren't trimmed by terminals
const protectedPadding = chalk.reset(padding);
finalElements.push(protectedPadding + elem.content + protectedPadding);
} else {
// No colors or no padding
finalElements.push(padding + elem.content + padding);
// No padding
finalElements.push(elem.content);
}
}
});