Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Is $SECURITYSESSIONID needed to check? #72

Closed
delphinus opened this issue Aug 4, 2020 · 2 comments · Fixed by #73
Closed

Is $SECURITYSESSIONID needed to check? #72

delphinus opened this issue Aug 4, 2020 · 2 comments · Fixed by #73

Comments

@delphinus
Copy link
Contributor

I'm using NeoVim and know :SudoWrite cannot work by default settings. So I searched issues and found a workaround in #56 (comment) .

I tried this workaround but still it did not work. So I invested the source and found here.

let local_nvim = has('nvim') && len($DISPLAY . $SECURITYSESSIONID)

@tpope says this line detects the env is NeoVim in local ( #45 (comment) ). But is $SECURITYSESSIONID needed to check? At least in my env (macOS Mojave 10.14.6), $SECURITYSESSIONID is always empty even in local.


For a stopgap measure, I wrote below in init.vim and successfully :SudoWrite works! thx @TSFoster !

if $SECURITYSESSIONID == ''
  let $SECURITYSESSIONID = 'dummy'
endif
let $SUDO_ASKPASS = '/path/to/macos-askpass'
@tpope
Copy link
Owner

tpope commented Aug 4, 2020

I borrowed this check from Git, which has since changed the conditional: git/git@be537e4. Does adding a check for $TERM_PROGRAM fix it?

@delphinus
Copy link
Contributor Author

Ah, I got the reason for the code clearly by the comment in git's commit. $DISPLAY . $SECURITYSESSIONID . $TERM_PROGRAM seems sufficient. I will PR for this.

delphinus added a commit to delphinus/vim-eunuch that referenced this issue Aug 5, 2020
@tpope tpope closed this as completed in #73 Aug 7, 2020
tpope pushed a commit that referenced this issue Aug 7, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants