fix(coding-agent): avoid redundant faint sequence in status cap

This commit is contained in:
can1357
2026-08-02 20:46:44 +02:00
parent 7f20bafc03
commit 81babef622
2 changed files with 3 additions and 3 deletions
@@ -1786,7 +1786,7 @@ export class StatusLineComponent implements Component {
: "";
const capPrefix = separatorDef.endCaps?.useBgAsFg ? bgAnsi.replace("\x1b[48;", "\x1b[38;") : bgAnsi + sepAnsi;
const capText = cap
? `${capPrefix}${this.#focusedAgentId ? "\x1b[22m" : ""}${cap}${this.#focusedAgentId ? "\x1b[2m" : ""}\x1b[0m`
? `${capPrefix}${this.#focusedAgentId ? "\x1b[22m" : ""}${cap}\x1b[0m`
: "";
let content = bgAnsi + fgAnsi;
@@ -177,8 +177,8 @@ describe("status line focused-agent dimming", () => {
const border = component.getTopBorder(80).content;
expect(border).toStartWith("\x1b[2m");
expect(border).toContain(`\x1b[22m${theme.sep.powerlineLeft}\x1b[2m`);
expect(border).toContain(`\x1b[22m${theme.sep.powerlineRight}\x1b[2m`);
expect(border).toContain(`\x1b[22m${theme.sep.powerlineLeft}\x1b[0m\x1b[2m`);
expect(border).toContain(`\x1b[22m${theme.sep.powerlineRight}\x1b[0m\x1b[2m`);
expect(border).toContain("\x1b[0m\x1b[2m");
expect(border).toEndWith("\x1b[22m");
});