]> gitweb.fluxo.info Git - keyringer.git/commitdiff
Avoid viminfo if VIM is set as $EDITOR (#50)
authorrhatto <rhatto@ratatosk.fluxo.info>
Fri, 28 Mar 2014 01:03:39 +0000 (22:03 -0300)
committerrhatto <rhatto@ratatosk.fluxo.info>
Fri, 28 Mar 2014 01:03:39 +0000 (22:03 -0300)
ChangeLog
lib/keyringer/actions/edit
lib/keyringer/functions

index 5b1c53e7ce554fda8a321cef332fc90920916749..736bff543c13e02ec948f51bb2c8f7025578669a 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2014-03-27 - Silvio Rhatto <rhatto@riseup.net>
+
+       Avoid viminfo if VIM is set as $EDITOR (#50)
+
 2014-03-22 - 0.3.3 - Silvio Rhatto  <rhatto@riseup.net>
 
        Use --recv-keys instead of --refresh-keys
index 03ccdab0315d1d8e708b6a84e4a616a8efd5d8e7..ff220a194f233e033d63a0bd74ccee2a3bd4a3ac 100755 (executable)
@@ -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"
 
index f1af9515761ee4ec3001baceccf288a8a3663db6..af300ef9bb639bbd0c17d61a6f2b5c59d21b7a0a 100755 (executable)
@@ -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