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:
@@ -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(
|
||||
|
||||
Reference in New Issue
Block a user