diff --git a/site/src/utils/apps.test.ts b/site/src/utils/apps.test.ts index 9e188efb2af35..9223668f65c8e 100644 --- a/site/src/utils/apps.test.ts +++ b/site/src/utils/apps.test.ts @@ -59,7 +59,7 @@ describe("create app link", () => { }, ); expect(href).toBe( - "/path-base/@username/Test-Workspace.a-workspace-agent/terminal?command=ls%20-la", + "/@username/Test-Workspace.a-workspace-agent/terminal?command=ls%20-la", ); }); diff --git a/site/src/utils/apps.ts b/site/src/utils/apps.ts index 6021f2ffebb52..b412984172f97 100644 --- a/site/src/utils/apps.ts +++ b/site/src/utils/apps.ts @@ -20,7 +20,10 @@ export const createAppLinkHref = ( agent.name }/apps/${encodeURIComponent(appSlug)}/`; if (app.command) { - href = `${preferredPathBase}/@${username}/${workspace.name}.${ + // Terminal links are relative. The terminal page knows how + // to select the correct workspace proxy for the websocket + // connection. + href = `/@${username}/${workspace.name}.${ agent.name }/terminal?command=${encodeURIComponent(app.command)}`; }