Red Hat Bugzilla – Bug 187192
VIM editor leaves remnants on scroll with :set noruler on Gnome Terminal
Last modified: 2007-11-30 17:11:28 EST
Description of problem:
Text remnants of long lines remain using vim with :set noruler
only on Gnome Terminal. Does not occur with xterm or text
Version-Release number of selected component (if applicable):
[khoa@nile ~]$ gnome-terminal --version
Gnome gnome-terminal 2.14.0
[khoa@nile ~]$ /usr/bin/vim --version
VIM - Vi IMproved 6.4 (2005 Oct 15, compiled Mar 9 2006 09:43:24)
Included patches: 2-7
Modified by <email@example.com>
Compiled by <firstname.lastname@example.org>
Huge version without GUI. Features included (+) or not (-):
+arabic +autocmd -balloon_eval -browse ++builtin_terms +byte_offset
-clientserver -clipboard +cmdline_compl +cmdline_hist +cmdline_info
+cryptv +cscope +dialog_con +diff +digraphs -dnd -ebcdic +emacs_tags
+ex_extra +extra_search +farsi +file_in_path +find_in_path +folding
+fork() +gettext -hangul_input +iconv +insert_expand +jumplist +keymap
+libcall +linebreak +lispindent +listcmds +localmap +menu +mksession
+modify_fname +mouse -mouseshape +mouse_dec +mouse_gpm -mouse_jsbterm
+mouse_netterm +mouse_xterm +multi_byte +multi_lang -netbeans_intg
+path_extra +perl +postscript +printer +python +quickfix +rightleft
+scrollbind +signs +smartindent -sniff +statusline -sun_workshop +syntax
+tag_binary +tag_old_static -tag_any_white -tcl +terminfo +termresponse
+textobjects +title -toolbar +user_commands +vertsplit +virtualedit
+visualextra +viminfo +vreplace +wildignore +wildmenu +windows
-X11 -xfontset -xim -xsmp -xterm_clipboard -xterm_save
system vimrc file: "/etc/vimrc"
user vimrc file: "$HOME/.vimrc"
user exrc file: "$HOME/.exrc"
fall-back for $VIM: "/usr/share/vim"
Compilation: i386-redhat-linux-gcc -c -I. -Iproto -DHAVE_CONFIG_H
-O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions
-fstack-protector --param=ssp-buffer-size=4 -m32 -march=i386
-mtune=generic -fasynchronous-unwind-tables -D_GNU_SOURCE
-D_FILE_OFFSET_BITS=64 -D_FORTIFY_SOURCE=2 -D_REENTRANT -D_GNU_SOURCE
-pipe -Wdeclaration-after-statement -I/usr/local/include
-D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -I/usr/include/gdbm
Linking: i386-redhat-linux-gcc -Wl,-E
-L/usr/local/lib -o vim -lncurses -lselinux -lacl -lgpm -Wl,-E
-L/usr/lib/perl5/5.8.8/i386-linux-thread-multi/CORE -lperl -lresolv -lutil -lc
-L/usr/lib/python2.4/config -lpython2.4 -lutil -lm -Xlinker -export-dynamic
Steps to Reproduce:
1. Log into Gnome Desktop as normal user, open Gnome Terminal.
2. Text remnants on last line is seen in Gnome Terminal running:
[khoa@nile ~] /bin/vi /etc/passwd
[khoa@nile ~] /bin/vi -U NONE -u NONE /etc/passwd
[khoa@nile ~] /usr/bin/vim -U NONE -u NONE /etc/passwd
(or any large text file), then scroll downwards. The problem is
that when scrolling down, the last line displays let's say line 30,
then line 31, then line 32, etc... If line 30 has more text than
line 31 and 32, parts of line 30 remains on the last line when the
last line is displaying line 32.
Text remain on last line of vim, corrupting display.
No spurious text on last line of vim.
Seems that vim does something with respect to screen redraw that
doesn't work properly with Gnome Terminal 2.14.0, and that
this is masked by the :set ruler feature. Drawing the ruler
with vim's :set ruler eliminates this remnants on scrolling problem.
This problem is affecting users of /bin/vi (namely root user)
since /bin/vi is /usr/bin/vim without potential security issues,
and specifically without ability to turn ":set ruler" on.
Workaround is for the root user to use /usr/bin/vim and ":set ruler",
negating the security features of /bin/vi, if Gnome Terminal is used.
I tried the following:
# TERM=gnome /bin/vi /etc/passwd
and the problem of text remnants on scroll still existed.
However, the following setting:
# TERM=ansi /bin/vi /etc/passwd
eliminated the text remnants on scroll problem!
So, based on this last piece of information:
1) Gnome Teminal does seem to be exhibiting bug on redraw, since
even setting TERM=gnome exhibited this issue with vim.
2) The workaround to use /bin/vi (secure version of /usr/bin/vim)
as root would be something like:
# alias vi="vi -T ansi"
This would be safer than aliasing root's vi to /usr/bin/vim to
bypass the redraw problem.
Might this then be an issue with the gnome-terminal termcap entries?
Does running TERM=gnome from within an xterm exhibit the problem? What about
TERM=xterm within gnome-terminal?
[wrt. your above tests, were they both run under gnome-terminal?]
(In reply to comment #3)
> Might this then be an issue with the gnome-terminal termcap entries?
> Does running TERM=gnome from within an xterm exhibit the problem? What about
> TERM=xterm within gnome-terminal?
> [wrt. your above tests, were they both run under gnome-terminal?]
Yes, all above tests were done within Gnome Terminal 2.14.0 unless specifically
Following are the tests as per your request:
Command: TERM=$TERM /usr/bin/vim -U NONE -u NONE /etc/passwd
and: /usr/bin/vim -T $TERM -U NONE -u NONE /etc/passwd
Terminal program tested
Gnome Terminal xterm
TERM=ansi good good
TERM=gnome BUG good
TERM=xterm BUG good
Doesn't look like an issue with termcap entries.
The recent update to vte (vte-0.12.1-1.fc5.1) seems to have fixed this.
Updated to vte-0.12.1-1.fc5.1 as suggested and the problem went away after a
reboot (maybe just restarting Gnome would have been sufficient). I'll leave
this bug request as NEW since I don't know the protocol for closing/duplicate,
Seems like this bug should be filed under VTE and closed?
Thanks guys, closing.