refactor: use SSH_ASKPASS_REQUIRE=force instead of DISPLAY=required

Signed-off-by: leo <longshuang@msn.cn>
This commit is contained in:
leo
2025-07-15 11:51:24 +08:00
parent d28bd92e4f
commit 46690f4afb

View File

@@ -167,10 +167,8 @@ namespace SourceGit.Commands
// Force using this app as SSH askpass program
var selfExecFile = Process.GetCurrentProcess().MainModule!.FileName;
if (!OperatingSystem.IsLinux())
start.Environment.Add("DISPLAY", "required");
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");
start.Environment.Add("SSH_ASKPASS_REQUIRE", "force");
start.Environment.Add("SOURCEGIT_LAUNCH_AS_ASKPASS", "TRUE");
// If an SSH private key was provided, sets the environment.