Show agent terminals created in workspace subdirectories (#1245)
Terminals were bucketed and looked up by exact cwd, so a terminal an agent opened in a subdirectory of the workspace never appeared in the workspace panel and its live updates were dropped — the panel only ever queried and subscribed the exact root. getTerminals(root) now aggregates every bucket at or below the root, and the session controller delivers a subdirectory change to each subscribed root above it, keyed by that root and carrying the full aggregated list. Keying by the root with the complete set is what keeps the client's cache replacement from dropping the terminals that live at the root.
This commit is contained in:
@@ -96,6 +96,19 @@ it("creates separate terminals for different cwds", async () => {
|
||||
expect(tmpTerminals[0].id).not.toBe(homeTerminals[0].id);
|
||||
});
|
||||
|
||||
it("lists subdirectory terminals when querying the workspace root", async () => {
|
||||
manager = createTerminalManager();
|
||||
const rootCwd = mkdtempSync(join(tmpdir(), "terminal-manager-subdir-root-"));
|
||||
const subdirCwd = join(rootCwd, "apps", "mobile");
|
||||
mkdirSync(subdirCwd, { recursive: true });
|
||||
temporaryDirs.push(rootCwd);
|
||||
|
||||
const created = await manager.createTerminal({ cwd: subdirCwd, name: "Mobile" });
|
||||
|
||||
const rootTerminals = await manager.getTerminals(rootCwd);
|
||||
expect(rootTerminals.map((terminal) => terminal.id)).toEqual([created.id]);
|
||||
});
|
||||
|
||||
it("creates additional terminal with auto-incrementing name", async () => {
|
||||
manager = createTerminalManager();
|
||||
const cwd = realpathSync(tmpdir());
|
||||
|
||||
Reference in New Issue
Block a user