MCPcopy
hub / github.com/desktop/desktop / getSSHEnvironment

Function getSSHEnvironment

app/src/lib/ssh/ssh.ts:44–70  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

42 * context (OS and user settings).
43 */
44export 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
72export function parseAddSSHHostPrompt(prompt: string) {
73 const promptRegex =

Callers 1

withTrampolineEnvFunction · 0.90

Calls 3

getSSHWrapperPathFunction · 0.90

Tested by

no test coverage detected