From 0ad4b419d55ed50ae945e8f1a00981c84cfc3746 Mon Sep 17 00:00:00 2001 From: ivanmilevtues Date: Fri, 23 Oct 2026 23:29:01 +0200 Subject: [PATCH] feat(coding-agent): show the linked worktree beside the branch in the footer Co-Authored-By: Claude Opus 5.5 --- .../src/modes/interactive/components/footer.ts | 3 ++- packages/coding-agent/test/footer-width.test.ts | 8 ++++++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/packages/coding-agent/src/modes/interactive/components/footer.ts b/packages/coding-agent/src/modes/interactive/components/footer.ts index 8bb7b353e5b1..381e8d5eee23 100644 --- a/packages/coding-agent/src/modes/interactive/components/footer.ts +++ b/packages/coding-agent/src/modes/interactive/components/footer.ts @@ -166,8 +166,9 @@ export class FooterComponent implements Component { // Add git branch if available const branch = this.footerData.getGitBranch(); + const worktree = this.footerData.getWorktreeName(); if (branch) { - pwd = `${pwd} (${branch})`; + pwd = worktree ? `${pwd} (${branch} @ ${worktree})` : `${pwd} (${branch})`; } // Add session name if set diff --git a/packages/coding-agent/test/footer-width.test.ts b/packages/coding-agent/test/footer-width.test.ts index e49ba677994f..7a3c5835f754 100644 --- a/packages/coding-agent/test/footer-width.test.ts +++ b/packages/coding-agent/test/footer-width.test.ts @@ -280,4 +280,12 @@ describe("FooterComponent width handling", () => { expect(stats).toContain("$1.234"); expect(stats).not.toContain("(sub)"); }); + + it("names the linked worktree beside the branch", () => { + const session = createSession({ sessionName: "" }); + expect(stripAnsi(new FooterComponent(session, createFooterData(1, "feature-x")).render(120)[0])).toContain( + "(main @ feature-x)", + ); + expect(stripAnsi(new FooterComponent(session, createFooterData(1)).render(120)[0])).toContain("(main)"); + }); });