fix(app): resolve terminal profiles at creation boundary

Profile placeholders were reaching spawned processes because each menu decided whether to resolve them. Keep UI callers profile-only and perform empty-prompt resolution once when the workspace terminal is created.
This commit is contained in:
Mohamed Boudra
2026-08-17 22:55:46 +02:00
parent 5ec26f0c09
commit 3948bf4fd6
6 changed files with 70 additions and 30 deletions
@@ -6,6 +6,7 @@ import {
getTerminalProfileIcon,
guessTerminalProfileIcon,
profileTakesPrompt,
resolveTerminalProfileLaunch,
resolveTerminalProfiles,
substitutePrompt,
} from "./terminal-profiles.js";
@@ -285,6 +286,22 @@ describe("substitutePrompt", () => {
});
});
describe("resolveTerminalProfileLaunch", () => {
it("turns an empty prompt profile into a spawnable command with no prompt argument", () => {
expect(
resolveTerminalProfileLaunch(
{
id: "agent",
name: "Agent",
command: "agent-cli",
args: [PROMPT_SENTINEL],
},
"",
),
).toEqual({ name: "Agent", command: "agent-cli", args: [] });
});
});
describe("formatResolvedCommand", () => {
it("joins the command and its args with spaces", () => {
expect(formatResolvedCommand({ command: "/bin/sh", args: ["-c", "echo hi"] })).toBe(