fix: SSH_ASKPASS can NOT use parameter

This commit is contained in:
leo 2024-07-10 10:47:43 +08:00
parent 7febac5843
commit ca461d1926
No known key found for this signature in database
3 changed files with 4 additions and 3 deletions

View file

@ -53,7 +53,7 @@ namespace SourceGit.Commands
// Force using this app as SSH askpass program
var selfExecFile = Process.GetCurrentProcess().MainModule.FileName;
start.Environment.Add("DISPLAY", "required");
start.Environment.Add("SSH_ASKPASS", $"\"{selfExecFile}\" --askpass");
start.Environment.Add("SSH_ASKPASS", selfExecFile); // Can not use parameter here, because it invoked by SSH with `exec`
start.Environment.Add("SSH_ASKPASS_REQUIRE", "prefer");
// If an SSH private key was provided, sets the environment.