Skip to content

Commit

Permalink
Force Vim to re-setup the terminal after running a command
Browse files Browse the repository at this point in the history
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#17
Signed-off-by: James McCoy <vega.james@gmail.com>
  • Loading branch information
jamessan committed Nov 21, 2014
1 parent 40cec46 commit bd3ebdf
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion plugin/gnupg.vim
@@ -1,5 +1,5 @@
" Name: gnupg.vim
" Last Change: 2014 Aug 10
" Last Change: 2014 Nov 20
" Maintainer: James McCoy <vega.james@gmail.com>
" Original Author: Markus Braun <markus.braun@krawel.de>
" Summary: Vim plugin for transparent editing of gpg encrypted files.
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit bd3ebdf

Please sign in to comment.