mirror of
https://github.com/xpipe-io/xpipe.git
synced 2026-08-26 11:16:29 +00:00
Agent rc file fix for linux [stage]
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user