scrolled text still visible after exiting vim, any ideas?

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

scrolled text still visible after exiting vim, any ideas?

Konstantin Rozinov
Hi folks,

I've modified my .vimrc to automatically decrypt/encrypt GPG files, I have
one problem remaining and it's as follows:

I open an encrypted GPG file and decrypt it after entering my passphrase.
The unencrypted file contents is viewable in my ssh window as expected.  So
far so good.
The file contents spans more than 1 page and so you have to scroll down to
see the rest of the file.  So if I scroll down, the beginning of the file
goes off screen, as expected.  This is where the problem is.
If I then exit vim, the text that has gone off the screen is still there
and this becomes a potential security problem since the unencrypted text is
still visible.

This is the autocommand I have when VIM exits:
autocmd VimLeave *.gpg :0,$d|redraw|:!clear

This works on whatever is currently visible on the screen, but fails to
delete whatever has been scrolled off the screen.
I have :enew but that doesn't do the job either.

Anyone have any other ideas?  Or is this a problem related to clearing the
terminal window and out of vim's hands?

Please advise,
Thanks!!
Konstantin Rozinov

Reply | Threaded
Open this post in threaded view
|

Re: scrolled text still visible after exiting vim, any ideas?

Dominic Evans
Yep you need to kill the terminal scrollbuffer with the proper escape
control characters.

On 09/11/05, Konstantin Rozinov <[hidden email]> wrote:

> Hi folks,
>
> I've modified my .vimrc to automatically decrypt/encrypt GPG files, I have
> one problem remaining and it's as follows:
>
> I open an encrypted GPG file and decrypt it after entering my passphrase.
> The unencrypted file contents is viewable in my ssh window as expected.  So
> far so good.
> The file contents spans more than 1 page and so you have to scroll down to
> see the rest of the file.  So if I scroll down, the beginning of the file
> goes off screen, as expected.  This is where the problem is.
> If I then exit vim, the text that has gone off the screen is still there
> and this becomes a potential security problem since the unencrypted text is
> still visible.
>
> This is the autocommand I have when VIM exits:
> autocmd VimLeave *.gpg :0,$d|redraw|:!clear
>
> This works on whatever is currently visible on the screen, but fails to
> delete whatever has been scrolled off the screen.
> I have :enew but that doesn't do the job either.
>
> Anyone have any other ideas?  Or is this a problem related to clearing the
> terminal window and out of vim's hands?
>
> Please advise,
> Thanks!!
> Konstantin Rozinov
>
>