Skip to content

macvim-askpass opens in Finder #1091

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

Closed
CGamesPlay opened this issue Sep 17, 2020 · 2 comments · Fixed by #1093
Closed

macvim-askpass opens in Finder #1091

CGamesPlay opened this issue Sep 17, 2020 · 2 comments · Fixed by #1093
Milestone

Comments

@CGamesPlay
Copy link

The macvim-askpass script isn't playing nicely on my system. The password prompt is being opened in Finder, instead of MacVim, and isn't brought to the front when it happens. The end result is I see a window open underneath my semi-transparent MacVim, don't even know what App it's a part of, and when I use expose, I can't even see the window, so it's very confusing 🙂

It appears that the program is a script copied from the Internet, and after fiddling with it, I think we can do better. I've replaced my version with this, which causes the dialog to open in MacVim directly, which is a much better user experience. We also don't need to reactivate MacVim once it's closed.

#! /bin/sh

#
# An SSH_ASKPASS command for MacOS X
#
# Author: Joseph Mocker, Sun Microsystems
#
# http://blog.retep.org/2009/04/09/ssh-askpass-on-osx-10-5/

#
# To use this script:
#     setenv SSH_ASKPASS "macos-askpass"
#     setenv DISPLAY ":0"
#

TITLE=${MACOS_ASKPASS_TITLE:-"SSH"}

DIALOG="display dialog \"$@\" default answer \"\" with title \"$TITLE\""
DIALOG="$DIALOG with icon caution with hidden answer"

result=`osascript -e 'tell application "MacVim"' -e "activate"  -e "$DIALOG" -e "text returned of result" -e 'end tell'`

if [ "$result" = "" ]; then
    exit 1
else
    echo "$result"
    exit 0
fi
@ychin
Copy link
Member

ychin commented Sep 18, 2020

Yeah that looks good. Thanks for the contribution. Quick Google search seems to show at least a couple versions of ssh-askpass for macOS that… basically do the same thing. I guess people want this, and Apple never provided an official one.

@ychin
Copy link
Member

ychin commented Sep 18, 2020

It also makes the permission dialog box less scary as previously it would have MacVim requesting permission to control Finder which is a little sketchy.

ychin added a commit to ychin/macvim that referenced this issue Sep 18, 2020
This fixes the focus issues with it and also makes the permission dialog
box a little less sketchy (previously it would appear MacVim is trying
to control Finder).

See macvim-dev#1091 for code contribution.

Close macvim-dev#1091.
@ychin ychin added this to the snapshot-166 milestone Sep 18, 2020
ychin added a commit to ychin/macvim that referenced this issue Sep 18, 2020
This fixes the focus issues with it and also makes the permission dialog
box a little less sketchy (previously it would appear MacVim is trying
to control Finder).

See macvim-dev#1091 for code contribution.

Close macvim-dev#1091.
ychin added a commit that referenced this issue Sep 21, 2020
Updated to Vim 8.2.1719.

Features
====================

Touch Bar improvements
--------------------

Touch Bar now supports submenus, and allows mixed icon/text displays
using `tmenu`. When in edit modes (e.g. insert), it will also display an
emoji picker as well. See `:help touchbar` for documentation. #1084

Fixes
====================

- Window menu no longer shows duplicate "Enter Full Screen" or "Tile
  Window to Left of Screen" entries whenever the user switches among
  different MacVim windows. #566 #992
- Fix issue where going to full screen mode when titlebar appearance is
  set to "hidden" would result in lost focus of the window. #1078
- The password dialog box when using `:!sudo` or other commands that
  require password entry (`macvim-askpass`) will no longer focus on
  Finder, and will keep the focus on MacVim. #1091
- Fix minor wrong tooltip in the "Appearance" preference pane. #1087
- "General" preference pane will now be correctly sized when Sparkle
  updater is disabled (e.g. Homebrew builds). #1089
- Misc issues were fixed by Vim upstream, e.g. `vimgrep` causing a
  crash, and odd behaviors with using Shift-O on the first line. #1082
  #1083

Compatibility
====================

Requires macOS 10.9 or above.

Script interfaces have compatibility with these versions:

- Lua 5.3
- Perl 5.18
- Python2 2.7
- Python3 3.8
- Ruby 2.7
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