Agent rc file fix for linux [stage]

This commit is contained in:
crschnick
2025-07-19 05:47:27 +00:00
parent 84b40b4198
commit 986f6dd2b8
2 changed files with 3 additions and 7 deletions
@@ -212,17 +212,13 @@ public class SshIdentityStateManager {
stopWindowsAgents(false, true, true);
sc.executeSimpleBooleanCommand("ssh-agent start");
checkLocalAgentIdentities(null);
} else if (sc.getOsType() == OsType.MACOS) {
// On macOS, we prefer the shell variable compared to any global env variable
} else if (sc.getOsType() == OsType.LINUX || sc.getOsType() == OsType.MACOS) {
// On Linux and macOS, we prefer the shell variable compared to any global env variable
// as that one is set by default and might not be the right one
// This happens for example with homebrew ssh
var shellVariable = sc.view().getEnvironmentVariable("SSH_AUTH_SOCK");
var socketEnvVariable = shellVariable.isEmpty() ? System.getenv("SSH_AUTH_SOCK") : shellVariable;
checkLocalAgentIdentities(socketEnvVariable);
} else {
// On Linux, there is no automatically set env variable, so we can always prefer the env variable
var socketEnvVariable = System.getenv("SSH_AUTH_SOCK");
checkLocalAgentIdentities(socketEnvVariable);
}
runningAgent = RunningAgent.SSH_AGENT;
+1 -1
View File
@@ -1 +1 @@
17.0-23
17.0-24