| 179 | } |
| 180 | |
| 181 | export function extractPathFromShellOutput(output: string): string | null { |
| 182 | const startIndex = output.indexOf(PATH_CAPTURE_START); |
| 183 | if (startIndex === -1) return null; |
| 184 | |
| 185 | const valueStartIndex = startIndex + PATH_CAPTURE_START.length; |
| 186 | const endIndex = output.indexOf(PATH_CAPTURE_END, valueStartIndex); |
| 187 | if (endIndex === -1) return null; |
| 188 | |
| 189 | const pathValue = output.slice(valueStartIndex, endIndex).trim(); |
| 190 | return pathValue.length > 0 ? pathValue : null; |
| 191 | } |
| 192 | |
| 193 | export function readPathFromLoginShell( |
| 194 | shell: string, |