From bd3ebdff6cb18d09c4bdbb72e28e07841c5076eb Mon Sep 17 00:00:00 2001 From: James McCoy Date: Thu, 20 Nov 2014 23:18:59 -0500 Subject: [PATCH] Force Vim to re-setup the terminal after running a command After Vim runs certain commands (e.g., pinentry-curses), the terminal is not returned to its previous state. This causes some escape sequences, like arrow keys, to stop being recognized properly by Vim. Re-setting &term to itself causes Vim to go through its normal terminal initialization steps which gets things back in working order. Closes jamessan/vim-gnupg#17 Signed-off-by: James McCoy --- plugin/gnupg.vim | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/plugin/gnupg.vim b/plugin/gnupg.vim index 9934a0b..17284a5 100644 --- a/plugin/gnupg.vim +++ b/plugin/gnupg.vim @@ -1,5 +1,5 @@ " Name: gnupg.vim -" Last Change: 2014 Aug 10 +" Last Change: 2014 Nov 20 " Maintainer: James McCoy " Original Author: Markus Braun " Summary: Vim plugin for transparent editing of gpg encrypted files. @@ -1255,6 +1255,10 @@ function s:GPGPostCmd() let &shellredir = s:shellredirsave let &shell = s:shellsave let &shelltemp = s:shelltempsave + " Workaround a bug in the interaction between console vim and + " pinentry-curses by forcing Vim to re-detect and setup its terminal + " settings + let &term = &term endfunction " Function: s:GPGSystem(dict) {{{2