From d19a59165df25c272ee8564d7e0d549d5e6f9a54 Mon Sep 17 00:00:00 2001 From: James Vega Date: Mon, 1 Aug 2011 20:44:17 -0400 Subject: [PATCH] Add g:GPGUsePipes variable to avoid saving unencrypted data to tempfiles Signed-off-by: James Vega --- plugin/gnupg.vim | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/plugin/gnupg.vim b/plugin/gnupg.vim index e68e964..10e1ab7 100644 --- a/plugin/gnupg.vim +++ b/plugin/gnupg.vim @@ -1,6 +1,6 @@ " Name: gnupg.vim -" Last Change: 2011 June 26 -" Author: James Vega +" Last Change: 2011 Aug 01 +" Maintainer: James Vega " Original Author: Markus Braun " Summary: Vim plugin for transparent editing of gpg encrypted files. " License: This program is free software; you can redistribute it and/or @@ -84,6 +84,11 @@ " If set, these recipients are used as defaults when no other recipient is " defined. This variable is a Vim list. Default is unset. " +" g:GPGUsePipes +" If set to 1, use pipes instead of temporary files when interacting with +" gnupg. When set to 1, this can cause terminal-based gpg agents to not +" display correctly when prompting for passwords. Defaults to 0. +" " Known Issues: {{{2 " " In some cases gvim can't decrypt files @@ -129,7 +134,7 @@ if (exists("g:loaded_gnupg") || &cp || exists("#BufReadCmd*.\(gpg\|asc\|pgp\)")) finish endif -let g:loaded_gnupg = '2.0' +let g:loaded_gnupg = '2.1' let s:GPGInitRun = 0 " check for correct vim version {{{2 @@ -227,6 +232,11 @@ function s:GPGInit() let g:GPGDefaultRecipients = [] endif + " prefer not to use pipes since it can garble gpg agent display + if (!exists("g:GPGUsePipes")) + let g:GPGUsePipes = 0 + endif + " print version call s:GPGDebug(1, "gnupg.vim ". g:loaded_gnupg) @@ -261,7 +271,7 @@ function s:GPGInit() " noshelltemp isn't currently supported on Windows, but it doesn't cause any " errors and this future proofs us against requiring changes if Windows " gains noshelltemp functionality - let s:shelltemp = 0 + let s:shelltemp = !g:GPGUsePipes if (has("unix")) " unix specific settings let s:shellredir = ">%s 2>&1"