Comments (15)
I've been able to confirm the behavior with Vim 7.4.273. Using xterm, I've been able to determine that the root cause is the terminal switching away from the alternate screen (which disables Application Cursor Keys (and Application Keypad)) and not switching back after the password prompt has completed.
- Run
vim
in an xterm - Ctrl+MiddleClick and
Show Alternate Screen
will be checked :e foo.gpg
and proceed through password dialog- Ctrl+MiddleClick and
Show Alternate Screen
will be unchecked
Now to determine if this is a Vim bug or if it's something related to how the plugin loads the encrypted file.
from vim-gnupg.
Actually, this looks like a bug in pinentry-curses. That doesn't seem to have been forwarded upstream. I'll see if I can get them to take a look at it.
I have a possible workaround that I can commit if that doesn't go anywhere soon.
from vim-gnupg.
I'm not too keen on the workaround I had, and in talking to some other people more familiar with terminal programming, they seem to think this is Vim's fault for not restoring typical terminal settings before running the external command. I'll poke around with that idea some.
from vim-gnupg.
Just for info:
On Linux Mint 17 (Ubuntu 14.04), the pb seems to be fixed:
$ dpkg --list | grep curses
ii libncurses5:amd64 5.9+20140118-1ubuntu1 amd64 shared libraries for terminal handling
ii libncurses5:i386 5.9+20140118-1ubuntu1 i386 shared libraries for terminal handling
ii libncursesw5:amd64 5.9+20140118-1ubuntu1 amd64 shared libraries for terminal handling (wide character support)
ii libncursesw5:i386 5.9+20140118-1ubuntu1 i386 shared libraries for terminal handling (wide character support)
ii mtr-tiny 0.85-2 amd64 Full screen ncurses traceroute tool
ii ncurses-base 5.9+20140118-1ubuntu1 all basic terminal type definitions
ii ncurses-bin 5.9+20140118-1ubuntu1 amd64 terminal-related programs and man pages
On CentOS 7, the pb is still here:
$ rpm -qa | grep curses
ncurses-base-5.9-13.20130511.el7.noarch
ncurses-libs-5.9-13.20130511.el7.x86_64
ncurses-5.9-13.20130511.el7.x86_64
from vim-gnupg.
Is there any difference in Vim version on those systems?
from vim-gnupg.
On Linux Mint 17 (Ubuntu 14.04):
$ vim --version
VIM - Vi IMproved 7.4 (2013 Aug 10, compiled Jan 2 2014 19:39:47)
Included patches: 1-52
Modified by [email protected]
Compiled by buildd@
Huge version with GTK2-GNOME GUI. Features included (+) or not (-):
+acl +farsi +mouse_netterm +syntax
+arabic +file_in_path +mouse_sgr +tag_binary
+autocmd +find_in_path -mouse_sysmouse +tag_old_static
+balloon_eval +float +mouse_urxvt -tag_any_white
+browse +folding +mouse_xterm +tcl
++builtin_terms -footer +multi_byte +terminfo
+byte_offset +fork() +multi_lang +termresponse
+cindent +gettext -mzscheme +textobjects
+clientserver -hangul_input +netbeans_intg +title
+clipboard +iconv +path_extra +toolbar
+cmdline_compl +insert_expand +perl +user_commands
+cmdline_hist +jumplist +persistent_undo +vertsplit
+cmdline_info +keymap +postscript +virtualedit
+comments +langmap +printer +visual
+conceal +libcall +profile +visualextra
+cryptv +linebreak +python +viminfo
+cscope +lispindent -python3 +vreplace
+cursorbind +listcmds +quickfix +wildignore
+cursorshape +localmap +reltime +wildmenu
+dialog_con_gui +lua +rightleft +windows
+diff +menu +ruby +writebackup
+digraphs +mksession +scrollbind +X11
+dnd +modify_fname +signs -xfontset
-ebcdic +mouse +smartindent +xim
+emacs_tags +mouseshape -sniff +xsmp_interact
+eval +mouse_dec +startuptime +xterm_clipboard
+ex_extra +mouse_gpm +statusline -xterm_save
+extra_search -mouse_jsbterm -sun_workshop +xpm
system vimrc file: "$VIM/vimrc"
user vimrc file: "$HOME/.vimrc"
2nd user vimrc file: "~/.vim/vimrc"
user exrc file: "$HOME/.exrc"
system gvimrc file: "$VIM/gvimrc"
user gvimrc file: "$HOME/.gvimrc"
2nd user gvimrc file: "~/.vim/gvimrc"
system menu file: "$VIMRUNTIME/menu.vim"
fall-back for $VIM: "/usr/share/vim"
Compilation: gcc -c -I. -Iproto -DHAVE_CONFIG_H -DFEAT_GUI_GTK -pthread -I/usr/include/gtk-2.0 -I/usr/lib/x86_64-linux-gnu/gtk-2.0/include -I/usr/include/atk-1.0 -I/usr/include/cairo -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/pango-1.0 -I/usr/include/gio-unix-2.0/ -I/usr/include/freetype2 -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -I/usr/include/pixman-1 -I/usr/include/libpng12 -I/usr/include/harfbuzz -pthread -DORBIT2=1 -D_REENTRANT -I/usr/include/libgnomeui-2.0 -I/usr/include/libart-2.0 -I/usr/include/gconf/2 -I/usr/include/gnome-keyring-1 -I/usr/include/libgnome-2.0 -I/usr/include/libbonoboui-2.0 -I/usr/include/libgnomecanvas-2.0 -I/usr/include/gtk-2.0 -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/gnome-vfs-2.0 -I/usr/lib/x86_64-linux-gnu/gnome-vfs-2.0/include -I/usr/include/dbus-1.0 -I/usr/lib/x86_64-linux-gnu/dbus-1.0/include -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -I/usr/include/orbit-2.0 -I/usr/include/libbonobo-2.0 -I/usr/include/bonobo-activation-2.0 -I/usr/include/libxml2 -I/usr/include/pango-1.0 -I/usr/include/gail-1.0 -I/usr/include/harfbuzz -I/usr/include/freetype2 -I/usr/include/atk-1.0 -I/usr/lib/x86_64-linux-gnu/gtk-2.0/include -I/usr/include/cairo -I/usr/include/gio-unix-2.0/ -I/usr/include/pixman-1 -I/usr/include/libpng12 -g -O2 -fstack-protector --param=ssp-buffer-size=4 -Wformat -Werror=format-security -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=1 -I/usr/include/tcl8.6 -D_REENTRANT=1 -D_THREAD_SAFE=1 -D_LARGEFILE64_SOURCE=1
Linking: gcc -L. -Wl,-Bsymbolic-functions -Wl,-z,relro -rdynamic -Wl,-export-dynamic -Wl,-E -Wl,-Bsymbolic-functions -Wl,-z,relro -Wl,--as-needed -o vim -lgtk-x11-2.0 -lgdk-x11-2.0 -latk-1.0 -lgio-2.0 -lpangoft2-1.0 -lpangocairo-1.0 -lgdk_pixbuf-2.0 -lcairo -lpango-1.0 -lfontconfig -lgobject-2.0 -lglib-2.0 -lfreetype -lgnomeui-2 -lSM -lICE -lbonoboui-2 -lgnomevfs-2 -lgnomecanvas-2 -lgnome-2 -lpopt -lbonobo-2 -lbonobo-activation -lORBit-2 -lart_lgpl_2 -lgtk-x11-2.0 -lgdk-x11-2.0 -latk-1.0 -lgio-2.0 -lpangoft2-1.0 -lpangocairo-1.0 -lgdk_pixbuf-2.0 -lcairo -lpango-1.0 -lfontconfig -lfreetype -lgconf-2 -lgthread-2.0 -lgmodule-2.0 -lgobject-2.0 -lglib-2.0 -lSM -lICE -lXpm -lXt -lX11 -lXdmcp -lSM -lICE -lm -ltinfo -lnsl -lselinux -lacl -lattr -lgpm -ldl -L/usr/lib -llua5.2 -Wl,-E -fstack-protector -L/usr/local/lib -L/usr/lib/perl/5.18/CORE -lperl -ldl -lm -lpthread -lcrypt -L/usr/lib/python2.7/config-x86_64-linux-gnu -lpython2.7 -lpthread -ldl -lutil -lm -Xlinker -export-dynamic -Wl,-O1 -Wl,-Bsymbolic-functions -L/usr/lib/x86_64-linux-gnu -ltcl8.6 -ldl -lz -lpthread -lieee -lm -lruby-1.9.1 -lpthread -lrt -ldl -lcrypt -lm -L/usr/lib
On CentOS 7:
$ vim --version
VIM - Vi IMproved 7.4 (2013 Aug 10, compiled Jun 10 2014 06:55:55)
Included patches: 1-160
Modified by <[email protected]>
Compiled by <[email protected]>
Huge version without GUI. Features included (+) or not (-):
+acl +farsi +mouse_netterm +syntax
+arabic +file_in_path +mouse_sgr +tag_binary
+autocmd +find_in_path -mouse_sysmouse +tag_old_static
-balloon_eval +float +mouse_urxvt -tag_any_white
-browse +folding +mouse_xterm -tcl
++builtin_terms -footer +multi_byte +terminfo
+byte_offset +fork() +multi_lang +termresponse
+cindent +gettext -mzscheme +textobjects
-clientserver -hangul_input +netbeans_intg +title
-clipboard +iconv +path_extra -toolbar
+cmdline_compl +insert_expand +perl +user_commands
+cmdline_hist +jumplist +persistent_undo +vertsplit
+cmdline_info +keymap +postscript +virtualedit
+comments +langmap +printer +visual
+conceal +libcall +profile +visualextra
+cryptv +linebreak +python/dyn +viminfo
+cscope +lispindent -python3 +vreplace
+cursorbind +listcmds +quickfix +wildignore
+cursorshape +localmap +reltime +wildmenu
+dialog_con -lua +rightleft +windows
+diff +menu +ruby/dyn +writebackup
+digraphs +mksession +scrollbind -X11
-dnd +modify_fname +signs -xfontset
-ebcdic +mouse +smartindent -xim
+emacs_tags -mouseshape -sniff -xsmp
+eval +mouse_dec +startuptime -xterm_clipboard
+ex_extra +mouse_gpm +statusline -xterm_save
+extra_search -mouse_jsbterm -sun_workshop -xpm
system vimrc file: "/etc/vimrc"
user vimrc file: "$HOME/.vimrc"
2nd user vimrc file: "~/.vim/vimrc"
user exrc file: "$HOME/.exrc"
fall-back for $VIM: "/etc"
f-b for $VIMRUNTIME: "/usr/share/vim/vim74"
Compilation: gcc -c -I. -Iproto -DHAVE_CONFIG_H -O2 -g -pipe -Wall -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=generic -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=1
Linking: gcc -L. -Wl,-z,relro -fstack-protector -rdynamic -Wl,-export-dynamic -Wl,--enable-new-dtags -Wl,-rpath,/usr/lib64/perl5/CORE -Wl,-z,relro -L/usr/local/lib -Wl,--as-needed -o vim -lm -lnsl -lselinux -lncurses -lacl -lattr -lgpm -ldl -Wl,--enable-new-dtags -Wl,-rpath,/usr/lib64/perl5/CORE -fstack-protector -L/usr/lib64/perl5/CORE -lperl -lresolv -lnsl -ldl -lm -lcrypt -lutil -lpthread -lc
from vim-gnupg.
What about :set t_ti?
in both?
from vim-gnupg.
I don't understand what is the t_ti
. Where should I put it ? In my .vimrc
?
Anyway, I've tried to put it in my .vimrc
:
set t_ti
or to type it after the GPG passphrase prompt, it doesn't fix the bug on CentOS7 (I didn't test on Mint, since the issue seems to be fixed).
from vim-gnupg.
Just run the command :set t_ti?
from within Vim on both systems and post the output.
from vim-gnupg.
On Linux Mint (in graphic mode, thus graphical passphrase prompt):
t_ti=^[[?1049h
In full console mode (Ctrl+Alt+F1), the t_ti
is empty:
t_ti=
On CentOS 7 (connection to the VM via SSH):
t_ti=^[[?1049h
from vim-gnupg.
On Linux Mint (in graphic mode, thus graphical passphrase prompt):
Gvim will never have the problem being discussed here because it's purely a terminal issue.
In full console mode (Ctrl+Alt+F1), the t_ti is empty:
...
On CentOS 7 (connection to the VM via SSH):
Do either of these work properly?
from vim-gnupg.
On Linux Mint 17, in full console mode (Ctrl+Alt+F1), the t_ti
is empty and it works: I can move the cursor and save.
t_ti=
On Linux Mint 17, through an SSH connection without X11 forwarding (-x
), thus having a ncurses passphrase prompt, it works as well : I can move the cursor and save.
t_ti=^[[?1049h
On CentOS 7, in full console mode, the t_ti
is empty and it doesn't work.
t_ti=
I can move the cursor, but I can't save. When I enter :w
, nothing happens, VIM seems not to respond anymore (eg when I press ESC
, it prints ^[
, etc.). I have to Ctrl+C to stop it, and exit by :q!
. The reason seems to come from an unresponsive process /usr/bin/pinentry-curses
that I cannot kill (SIGTERM
). I need to kill it with a SIGKILL
.
It is precisely when I try to save :w
that the pinentry-curses
spawns. If I open the file, enter the passphrase and quit right away, there is no pinentry-curses
process, and I have no bug.
from vim-gnupg.
Just ran into this as well. :(
My vim starts with term=screen256-color when opening both normal files and encrypted files. With encrypted files, when I set term=xterm, my arrow keys work properly.
t_ti=^[[?1049h
VIM - Vi IMproved 7.4 (2013 Aug 10, compiled Nov 3 2013 16:53:31)
from vim-gnupg.
If I had a fix, I would have committed it. :) It looks like the simplest thing may be to just commit the workaround for now and try to figure out the bigger problem later.
from vim-gnupg.
For reference:
setting &term=&term
triggers a bug in Vim, which breaks the X clipboard handling: https://groups.google.com/d/topic/vim_dev/flxuSDNp14I/discussion
from vim-gnupg.
Related Issues (20)
- Implement g:GPGReplaceKeys to automatically replace keys HOT 2
- contents of main buffer are parsed as recipients HOT 2
- gpg#init doesn't exist HOT 3
- 'tty' is not recognized as an internal or external command
- Already encrypted file "File is not encrypted, all GPG functions disabled!" HOT 2
- Missing first 2 symbols on line 2 after opening file HOT 3
- Error when doing ':wq' with newer vim version HOT 2
- Please add /doc/tags to .gitignore
- Decryption failures in nvim HOT 1
- The cipher AES.CFB is not known by the local gpg command. Using default! HOT 4
- Need to type passphrase on every :w ? HOT 4
- Docs: Include warning that other processes can read plaintext with default config HOT 2
- Start vim without to create a buffer to edit recipients (GPGEditRecipients) HOT 1
- Not decrypting after upgrade to GnuPG 2.3.4 HOT 12
- Add the ability to use age? HOT 2
- Unable to write to encrypted file. Error: Message could not be encrypted! (Press ENTER) HOT 4
- [Bug] Neovim compatability of vim-gnupg with pinentry-mac - only get encrypted file HOT 5
- Recipients lost after opening file. HOT 7
- Error detected while processing BufReadCmd Autocommands for "*.{gpg,asc,pgp}" HOT 2
- Is there a way to force prompt for password?
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from vim-gnupg.