diff --git a/src/MacVim/MacVim.xcodeproj/project.pbxproj b/src/MacVim/MacVim.xcodeproj/project.pbxproj index 5bfac7810b..bf35f7f7c9 100644 --- a/src/MacVim/MacVim.xcodeproj/project.pbxproj +++ b/src/MacVim/MacVim.xcodeproj/project.pbxproj @@ -68,6 +68,7 @@ 52A364761C4A57C1005757EC /* Sparkle.framework in Copy Frameworks */ = {isa = PBXBuildFile; fileRef = 52A364721C4A5789005757EC /* Sparkle.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; 52B7ED9B1C4A4D6900AFFF15 /* dsa_pub.pem in Resources */ = {isa = PBXBuildFile; fileRef = 52B7ED9A1C4A4D6900AFFF15 /* dsa_pub.pem */; }; 52818B031C1C08CE00F59085 /* QLStephen.qlgenerator in Copy QuickLookPlugin */ = {isa = PBXBuildFile; fileRef = 52818AFF1C1C075300F59085 /* QLStephen.qlgenerator */; settings = {ATTRIBUTES = (CodeSignOnCopy, ); }; }; + 528DA66A1426D4F9003380F1 /* macvim-askpass in Copy Scripts */ = {isa = PBXBuildFile; fileRef = 528DA6691426D4EB003380F1 /* macvim-askpass */; }; 8D11072A0486CEB800E47090 /* MainMenu.nib in Resources */ = {isa = PBXBuildFile; fileRef = 29B97318FDCFA39411CA2CEA /* MainMenu.nib */; }; 8D11072B0486CEB800E47090 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 089C165CFE840E0CC02AAC07 /* InfoPlist.strings */; }; 8D11072D0486CEB800E47090 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 29B97316FDCFA39411CA2CEA /* main.m */; settings = {ATTRIBUTES = (); }; }; @@ -153,6 +154,17 @@ name = "Copy QuickLookPlugin"; runOnlyForDeploymentPostprocessing = 0; }; + 528DA6671426D456003380F1 /* Copy Scripts */ = { + isa = PBXCopyFilesBuildPhase; + buildActionMask = 2147483647; + dstPath = ""; + dstSubfolderSpec = 6; + files = ( + 528DA66A1426D4F9003380F1 /* macvim-askpass in Copy Scripts */, + ); + name = "Copy Scripts"; + runOnlyForDeploymentPostprocessing = 0; + }; /* End PBXCopyFilesBuildPhase section */ /* Begin PBXFileReference section */ @@ -237,6 +249,7 @@ 29B97325FDCFA39411CA2CEA /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = /System/Library/Frameworks/Foundation.framework; sourceTree = ""; }; 32CA4F630368D1EE00C91783 /* MacVim_Prefix.pch */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MacVim_Prefix.pch; sourceTree = ""; }; 52818AFA1C1C075300F59085 /* QuickLookStephen.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = QuickLookStephen.xcodeproj; path = qlstephen/QuickLookStephen.xcodeproj; sourceTree = ""; }; + 528DA6691426D4EB003380F1 /* macvim-askpass */ = {isa = PBXFileReference; lastKnownFileType = text.script.sh; path = "macvim-askpass"; sourceTree = ""; }; 52A364721C4A5789005757EC /* Sparkle.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; path = Sparkle.framework; sourceTree = ""; }; 52B7ED9A1C4A4D6900AFFF15 /* dsa_pub.pem */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = dsa_pub.pem; sourceTree = ""; }; 8D1107310486CEB800E47090 /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist; path = Info.plist; sourceTree = ""; }; @@ -454,6 +467,14 @@ name = Products; sourceTree = ""; }; + 528DA6681426D477003380F1 /* Scripts */ = { + isa = PBXGroup; + children = ( + 528DA6691426D4EB003380F1 /* macvim-askpass */, + ); + name = Scripts; + sourceTree = ""; + }; /* End PBXGroup section */ /* Begin PBXNativeTarget section */ @@ -469,6 +490,7 @@ 52818B021C1C088000F59085 /* Copy QuickLookPlugin */, 1DE608B80C58807F0055263D /* Copy Vim Runtime Files */, 1D1C31F00EFFBFD6003FE9A5 /* Make Document Icons */, + 528DA6671426D456003380F1 /* Copy Scripts */, ); buildRules = ( ); diff --git a/src/MacVim/gvimrc b/src/MacVim/gvimrc index 4b4ff38292..f1d7e725f4 100644 --- a/src/MacVim/gvimrc +++ b/src/MacVim/gvimrc @@ -105,3 +105,7 @@ endif " exists("macvim_hig_shift_movement") " Restore the previous value of 'cpoptions'. let &cpo = s:cpo_save unlet s:cpo_save + +" askpass +let $SSH_ASKPASS = simplify($VIM . '/../../MacOS') . '/macvim-askpass' +let $SUDO_ASKPASS = $SSH_ASKPASS diff --git a/src/MacVim/macvim-askpass b/src/MacVim/macvim-askpass new file mode 100755 index 0000000000..608439aa63 --- /dev/null +++ b/src/MacVim/macvim-askpass @@ -0,0 +1,29 @@ +#! /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 "Finder"' -e "activate" -e "$DIALOG" -e "text returned of result" -e 'end tell'` +osascript -e 'tell application "MacVim"' -e "activate" -e 'end tell' + +if [ "$result" = "" ]; then + exit 1 +else + echo "$result" + exit 0 +fi