Files
orca/src/main/windows-path-access-host.ts
T
Neil 962c338b67 feat(wsl): Windows path actions for WSL hosts through one owner-routed capability (WSL-via-orcad C8) (#27955)
* feat(wsl): open WSL host paths from Windows through one owner-routed capability (WSL-via-orcad C8)

* test(wsl): typed shell handler lookup for the WSL owner tests

* fix(wsl): read known WSL hosts through a registered accessor; e2e for the Windows folder picker

* fix(wsl): open the host-path entry filled in after a Windows pick; e2e screenshots

* test(wsl): read the e2e picker's default path through the main process env

* refactor(wsl): read a WSL host's distro from its record instead of a new accessor

* fix(wsl): skip the host browser only for a path Windows' picker or an Explorer drop filled in

A path left filled from an earlier pick on an SSH or paired host opens the host browser again, as it did before.
2026-10-13 10:00:55 -07:00

18 lines
643 B
TypeScript

import { windowsPathAccess, type WindowsPathAccess } from '../shared/windows-path-access'
import { getWslHostService } from './wsl/wsl-host-service-instance'
/** {@link windowsPathAccess} as main resolves it: the WSL host records main persists. */
export function resolveWindowsPathAccess(
ownerHostId: unknown,
platform: NodeJS.Platform = process.platform
): WindowsPathAccess | null {
if (typeof ownerHostId !== 'string') {
return null
}
return windowsPathAccess(ownerHostId, {
platform,
wslDistroForEnvironment: (environmentId) =>
getWslHostService()?.recordForEnvironment(environmentId)?.distro ?? null
})
}