Skip to content

Commit 46690f4

Browse files
committed
refactor: use SSH_ASKPASS_REQUIRE=force instead of DISPLAY=required
Signed-off-by: leo <longshuang@msn.cn>
1 parent d28bd92 commit 46690f4

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

src/Commands/Command.cs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -167,10 +167,8 @@ private ProcessStartInfo CreateGitStartInfo(bool redirect)
167167

168168
// Force using this app as SSH askpass program
169169
var selfExecFile = Process.GetCurrentProcess().MainModule!.FileName;
170-
if (!OperatingSystem.IsLinux())
171-
start.Environment.Add("DISPLAY", "required");
172170
start.Environment.Add("SSH_ASKPASS", selfExecFile); // Can not use parameter here, because it invoked by SSH with `exec`
173-
start.Environment.Add("SSH_ASKPASS_REQUIRE", "prefer");
171+
start.Environment.Add("SSH_ASKPASS_REQUIRE", "force");
174172
start.Environment.Add("SOURCEGIT_LAUNCH_AS_ASKPASS", "TRUE");
175173

176174
// If an SSH private key was provided, sets the environment.

0 commit comments

Comments
 (0)