Skip to content
Closed
Show file tree
Hide file tree
Changes from 9 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions apps/desktop/src/shell/DesktopShellEnvironment.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,7 @@ describe("DesktopShellEnvironment", () => {
PATH: "/opt/homebrew/bin:/usr/bin",
SSH_AUTH_SOCK: "/tmp/secretive.sock",
HOMEBREW_PREFIX: "/opt/homebrew",
AZURE_DEVOPS_EXT_PAT: "pat-from-login-shell",
});
},
});
Expand All @@ -126,6 +127,7 @@ describe("DesktopShellEnvironment", () => {
assert.equal(env.PATH, "/opt/homebrew/bin:/usr/bin:/Users/test/.local/bin");
assert.equal(env.SSH_AUTH_SOCK, "/tmp/secretive.sock");
assert.equal(env.HOMEBREW_PREFIX, "/opt/homebrew");
assert.equal(env.AZURE_DEVOPS_EXT_PAT, "pat-from-login-shell");
}),
);

Expand All @@ -135,6 +137,7 @@ describe("DesktopShellEnvironment", () => {
SHELL: "/bin/zsh",
PATH: "/usr/bin",
SSH_AUTH_SOCK: "/tmp/inherited.sock",
AZURE_DEVOPS_EXT_PAT: "inherited-pat",
};

yield* runShellEnvironment({
Expand All @@ -144,11 +147,13 @@ describe("DesktopShellEnvironment", () => {
envOutput({
PATH: "/opt/homebrew/bin:/usr/bin",
SSH_AUTH_SOCK: "/tmp/login-shell.sock",
AZURE_DEVOPS_EXT_PAT: "pat-from-login-shell",
}),
});

assert.equal(env.PATH, "/opt/homebrew/bin:/usr/bin");
assert.equal(env.SSH_AUTH_SOCK, "/tmp/inherited.sock");
assert.equal(env.AZURE_DEVOPS_EXT_PAT, "inherited-pat");
}),
);

Expand Down
4 changes: 4 additions & 0 deletions apps/desktop/src/shell/DesktopShellEnvironment.ts
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,9 @@ const LOGIN_SHELL_ENV_NAMES = [
"XDG_CONFIG_HOME",
"XDG_CURRENT_DESKTOP",
"XDG_DATA_HOME",
// Azure DevOps CLI commonly receives its PAT from the user's login shell.
// Keep it available when the desktop app is launched outside a terminal.
"AZURE_DEVOPS_EXT_PAT",
"XDG_RUNTIME_DIR",
"XDG_SESSION_DESKTOP",
"XDG_SESSION_TYPE",
Expand Down Expand Up @@ -456,6 +459,7 @@ const installPosixEnvironment = Effect.fn("desktop.shellEnvironment.installPosix
"HOMEBREW_REPOSITORY",
"XDG_CONFIG_HOME",
"XDG_DATA_HOME",
"AZURE_DEVOPS_EXT_PAT",
"XDG_RUNTIME_DIR",
"WAYLAND_DISPLAY",
] as const) {
Expand Down
Loading
Loading