From 7e67d64c73b2727db1b4033d946385da23b5c69d Mon Sep 17 00:00:00 2001 From: Resham Joshi <65915470+iamtoruk@users.noreply.github.com> Date: Fri, 6 Nov 2026 05:49:31 -0800 Subject: [PATCH] fix(warp): probe Warp's Linux paths only on Linux Every non-macOS, non-Windows platform fell through to the Linux locations. Candidates are now exact per platform: macOS bundles, Linux state dirs, Windows LOCALAPPDATA, and none elsewhere. --- src/providers/warp.ts | 5 +++-- tests/provider-probe-roots.test.ts | 2 +- tests/providers/warp.test.ts | 1 + 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/providers/warp.ts b/src/providers/warp.ts index 1434d059..aaa3b0f4 100644 --- a/src/providers/warp.ts +++ b/src/providers/warp.ts @@ -134,11 +134,12 @@ export function getDbCandidates(dbPathOverride?: string, platform: string = proc const localAppData = process.env['LOCALAPPDATA'] || join(homedir(), 'AppData', 'Local') return [join(localAppData, 'warp', 'Warp', 'data', 'warp.sqlite')] } - if (platform !== 'darwin') { + if (platform === 'linux') { const stateHome = process.env['XDG_STATE_HOME'] || join(homedir(), '.local', 'state') return [join(stateHome, 'warp-terminal', 'warp.sqlite'), join(stateHome, 'warp-terminal-preview', 'warp.sqlite')] } - return [warpDbPath(WARP_STABLE_BUNDLE_ID), warpDbPath(WARP_PREVIEW_BUNDLE_ID)] + if (platform === 'darwin') return [warpDbPath(WARP_STABLE_BUNDLE_ID), warpDbPath(WARP_PREVIEW_BUNDLE_ID)] + return [] } function normalizeModel(rawModel: string): string { diff --git a/tests/provider-probe-roots.test.ts b/tests/provider-probe-roots.test.ts index 3c49958b..edd611f3 100644 --- a/tests/provider-probe-roots.test.ts +++ b/tests/provider-probe-roots.test.ts @@ -62,7 +62,7 @@ describe('probeRoots mirrors discovery resolution', () => { ]) const defaults = await createWarpProvider().probeRoots!() expect(defaults.map(root => root.path)).toEqual(getDbCandidates()) - expect(defaults).toHaveLength(process.platform === 'win32' ? 1 : 2) + expect(defaults).toHaveLength(process.platform === 'win32' ? 1 : process.platform === 'darwin' || process.platform === 'linux' ? 2 : 0) for (const root of defaults) { expect(isAbsolute(root.path)).toBe(true) expect(root.label).toBe('db') diff --git a/tests/providers/warp.test.ts b/tests/providers/warp.test.ts index bb3f24fe..6d0a10e8 100644 --- a/tests/providers/warp.test.ts +++ b/tests/providers/warp.test.ts @@ -524,5 +524,6 @@ describe('warp db locations', () => { join('C:\\Users\\me\\AppData\\Local', 'warp', 'Warp', 'data', 'warp.sqlite'), ]) expect(getDbCandidates(undefined, 'darwin')[0]).toContain('Group Containers') + expect(getDbCandidates(undefined, 'freebsd')).toEqual([]) }) })