Download packages/api/terminal-controller/src/client/shell-preference.ts from SaylorTwift/deepseek-harness: direct link, hf CLI and curl.
- Browser
- Download file 821 Bytes
-
https://huggingface.co/SaylorTwift/deepseek-harness/resolve/main/packages/api/terminal-controller/src/client/shell-preference.ts
- Command line
-
hf download hf://SaylorTwift/deepseek-harness/packages/api/terminal-controller/src/client/shell-preference.ts
-
curl -L -o shell-preference.ts https://huggingface.co/SaylorTwift/deepseek-harness/resolve/main/packages/api/terminal-controller/src/client/shell-preference.ts
821 Bytes
| /** Browser-local shell preference; Host discovery decides whether the saved path is usable. */ | |
| const KEY = 'dsh.terminal.shell' | |
| /** | |
| * Read the browser preference. | |
| * @returns the last selected shell path, or null when storage is unavailable. | |
| */ | |
| export function preferredShell(): string | null { | |
| try { return typeof localStorage === 'undefined' ? null : localStorage.getItem(KEY) } | |
| catch (_storageUnavailable) { return null } | |
| } | |
| /** | |
| * Remember the selected shell without making storage a startup dependency. | |
| * @param path - verified executable path offered by the Host. | |
| */ | |
| export function rememberShell(path: string): void { | |
| try { if (typeof localStorage !== 'undefined') localStorage.setItem(KEY, path) } | |
| catch (_storageUnavailable) { /* Private browsing or quota failure leaves this launch usable. */ } | |
| } | |