sublime_merge icon indicating copy to clipboard operation
sublime_merge copied to clipboard

Set either `DISPLAY=whatever` or `SSH_ASKPASS_REQUIRE=force` on macOS

Open ffuugoo opened this issue 3 years ago • 6 comments

Problem description

ssh-add would only call SSH_ASKPASS if either DISPLAY environment variable is set (and, I'd assume, is not null) or if SSH_ASKPASS_REQUIRE is set to force (in which case SSH_ASKPASS is called even when DISPLAY is not set).

On macOS Monterey 12.3 (that's the version of macOS I'm using) the DISPLAY env-var is not set by default.

So, if using password-protected ssh-key, and it is not added to the ssh-agent when performing connection to the repo with Sublime Merge it causes "Permission denied / Could not read from remote repository" error.

I suppose that was the core issue of at least some previous reports of the issue (e.g., #498, #608, and multiple reports on forum.sublimetext.com).

Preferred solution

Either set DISPLAY environment variable to any non-null value or SSH_ASKPASS_REQUIRE=force when calling git from Sublime Merge.

Screenshots

Screen Shot 2022-03-21 at 23 12 17

ffuugoo avatar Mar 21 '22 22:03 ffuugoo

I can confirm that setting SSH_ASKPASS_REQUIRE=force fixes this for me when starting Sublime Merge from the terminal with smerge .

OS: Arch Linux

nralbrecht avatar Apr 08 '22 14:04 nralbrecht

2 years passed. Still remaining

qanyue avatar Dec 12 '24 12:12 qanyue

Arguably this doesn't seem something an application should do, but the user, by properly configuring their environment?

stinos avatar Dec 12 '24 12:12 stinos

In mac os 15, just add this in ~/.zprofile

#To enable sublime merge to input ssh passphrase .

export DISPLAY=1 

I do not know why the smerge has 'ssh-askpass-sublime' under '/Applications/Sublime Merge.app/Contents/MacOS' , but it never be called but it can be run by terminal.app.

Another git cilent fork quickly show the input box for passphrase. Compared with it ,Sublime Merge make me crazy to just push

qanyue avatar Dec 12 '24 13:12 qanyue

Arguably this doesn't seem something an application should do, but the user, by properly configuring their environment?

Bro, It's not a config task ,It's a bug.

qanyue avatar Dec 12 '24 13:12 qanyue

G'day all,

Thank you for your patience! We've resolved this internally, and the fix will be available in the next build of Sublime Merge.

Kind regards, - Dylan from Sublime HQ

dpjohnst avatar Dec 16 '24 02:12 dpjohnst