(cwd: string)
| 77 | const lifecycleListeners = new Set<(event: PtyLifecycleEvent) => void>() |
| 78 | |
| 79 | function validateCwd(cwd: string): void { |
| 80 | if (!cwd || typeof cwd !== "string") { |
| 81 | throw new Error("cwd must be a non-empty string") |
| 82 | } |
| 83 | if (!fs.existsSync(cwd)) { |
| 84 | throw new Error(`Working directory does not exist: ${cwd}`) |
| 85 | } |
| 86 | if (!fs.statSync(cwd).isDirectory()) { |
| 87 | throw new Error(`Path is not a directory: ${cwd}`) |
| 88 | } |
| 89 | } |
| 90 | |
| 91 | function getDefaultShell(): string { |
| 92 | if (os.platform() === "win32") { |
no test coverage detected