diff --git a/src/state.ts b/src/state.ts index fbbbf56..af1436f 100644 --- a/src/state.ts +++ b/src/state.ts @@ -61,6 +61,7 @@ export interface GlobalSession extends Session { export async function loadAll(): Promise { const sandlotDir = join(homedir(), ".sandlot") const all: GlobalSession[] = [] + const seen = new Set() let repoDirs try { @@ -89,7 +90,8 @@ export async function loadAll(): Promise { } } - if (repoRoot) { + if (repoRoot && !seen.has(repoRoot)) { + seen.add(repoRoot) try { const st = await load(repoRoot) for (const session of Object.values(st.sessions)) {