From d6119b43f54c53d3fdffd995699337b100eee2c0 Mon Sep 17 00:00:00 2001 From: rhatto Date: Thu, 27 Mar 2014 22:03:39 -0300 Subject: Avoid viminfo if VIM is set as $EDITOR (#50) --- ChangeLog | 4 ++++ lib/keyringer/actions/edit | 1 + lib/keyringer/functions | 7 +++++++ 3 files changed, 12 insertions(+) diff --git a/ChangeLog b/ChangeLog index 5b1c53e..736bff5 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2014-03-27 - Silvio Rhatto + + Avoid viminfo if VIM is set as $EDITOR (#50) + 2014-03-22 - 0.3.3 - Silvio Rhatto Use --recv-keys instead of --refresh-keys diff --git a/lib/keyringer/actions/edit b/lib/keyringer/actions/edit index 03ccdab..ff220a1 100755 --- a/lib/keyringer/actions/edit +++ b/lib/keyringer/actions/edit @@ -38,6 +38,7 @@ fi # Prompt echo "Press any key to open the decrypted data with $APP, Ctrl-C to abort" +echo "WARNING: please make sure that $APP doesn't leak data to external applications os files" read key $APP "$TMPWORK" diff --git a/lib/keyringer/functions b/lib/keyringer/functions index f1af951..af300ef 100755 --- a/lib/keyringer/functions +++ b/lib/keyringer/functions @@ -284,6 +284,13 @@ function keyringer_set_env { fi fi + # Avoid viminfo, see https://keyringer.pw/trac/ticket/50 + if $EDITOR --help | grep -q -e "^VIM"; then + if ! echo $EDITOR | grep -q -- "-i NONE"; then + EDITOR="$EDITOR -i NONE" + fi + fi + if [ ! -f "$OPTIONS" ]; then echo "No option config was found" exit 1 -- cgit v1.2.3