()
| 42 | * context (OS and user settings). |
| 43 | */ |
| 44 | export async function getSSHEnvironment() { |
| 45 | const baseEnv = { |
| 46 | SSH_ASKPASS: getDesktopAskpassTrampolinePath(), |
| 47 | // DISPLAY needs to be set to _something_ so ssh actually uses SSH_ASKPASS |
| 48 | DISPLAY: '.', |
| 49 | } |
| 50 | |
| 51 | const canUseWindowsSSH = await isWindowsOpenSSHAvailable() |
| 52 | if (canUseWindowsSSH && isWindowsOpenSSHUseEnabled()) { |
| 53 | // Replace git ssh command with Windows' OpenSSH executable path |
| 54 | return { |
| 55 | ...baseEnv, |
| 56 | GIT_SSH_COMMAND: WindowsOpenSSHPath, |
| 57 | } |
| 58 | } |
| 59 | |
| 60 | if (__DARWIN__ && __DEV__) { |
| 61 | // Replace git ssh command with our wrapper in dev builds, since they are |
| 62 | // launched from a command line. |
| 63 | return { |
| 64 | ...baseEnv, |
| 65 | GIT_SSH_COMMAND: `"${getSSHWrapperPath()}"`, |
| 66 | } |
| 67 | } |
| 68 | |
| 69 | return baseEnv |
| 70 | } |
| 71 | |
| 72 | export function parseAddSSHHostPrompt(prompt: string) { |
| 73 | const promptRegex = |
no test coverage detected