Khoa Ton wrote:
I'm using vi in the xterm Terminal console in FC5 Gnome Desktop. When I'm scrolling down in a large file (/etc/passwd for example), the last line doesn't properly clear, remnant text of the previous line is left on the last line.
I'm seeing similar behaviour, but with gnome-terminal. I've only had a quick look using an xterm but that seems to be OK.
Ron
On Sun, 2006-03-26 at 12:43 +0100, Ron Yorston wrote:
Khoa Ton wrote:
I'm using vi in the xterm Terminal console in FC5 Gnome Desktop. When I'm scrolling down in a large file (/etc/passwd for example), the last line doesn't properly clear, remnant text of the previous line is left on the last line.
I'm seeing similar behaviour, but with gnome-terminal. I've only had a quick look using an xterm but that seems to be OK.
Ron
Yes, Ron is right. My mistake thinking that Gnome Terminal (2.14.0) was xterm. Xterm does not exhibit this problem.
Curiously, trying this again today with Gnome Terminal, I did not see the problem. When the problem DOES NOT occur on Gnome Terminal, I see the lower right cursor location numbers. When I don't see these numbers is when the remnants remain.
I'll keep trying to track down this problem's cause.
Khoa
On Mon, 2006-03-27 at 00:27 -0800, Khoa Ton wrote:
On Sun, 2006-03-26 at 12:43 +0100, Ron Yorston wrote:
Khoa Ton wrote:
I'm using vi in the xterm Terminal console in FC5 Gnome Desktop. When I'm scrolling down in a large file (/etc/passwd for example), the last line doesn't properly clear, remnant text of the previous line is left on the last line.
I'm seeing similar behaviour, but with gnome-terminal. I've only had a quick look using an xterm but that seems to be OK.
Yes, Ron is right. My mistake thinking that Gnome Terminal (2.14.0) was xterm. Xterm does not exhibit this problem.
Curiously, trying this again today with Gnome Terminal, I did not see the problem. When the problem DOES NOT occur on Gnome Terminal, I see the lower right cursor location numbers. When I don't see these numbers is when the remnants remain.
Okay, here's the quick recap and workaround to the problem of "VI editor in Gnome Terminal leaves text remnants on scroll"
/bin/vi exhibits the problem with Gnome Terminal, but not xterm or the console window (ALT-F1 etc...).
/usr/bin/vim does not exhibit this problem.
The file /etc/profile.d/vim.sh runs on login and sets the alias vi=vim for normal users, but NOT for root.
Hence, when the root user uses vi, he gets /bin/vi, which has the text remnant problem with Gnome Terminal. When a normal user uses vi, he gets /usr/bin/vim, which has no problems with Gnome Terminal.
The workaround here would be to set an alias in root's .bashrc file to use /usr/bin/vim when vi is called. As far as I know, vim is more secure than vi and should be safer to run as root.
Khoa
Around about 27/03/06 12:36, Khoa Ton typed ...
The workaround here would be to set an alias in root's .bashrc file to use /usr/bin/vim when vi is called. As far as I know, vim is more secure than vi and should be safer to run as root.
Actually, /bin/vi *is* vim, just compiled up without lots of stuff (mouse, plugins, etc.) that might cause problems/security issues when run as root, esp. in recovery mode.
It's highly unlikely (although not impossible!) that vim is the issue.
Neil Bird wrote:
Around about 27/03/06 12:36, Khoa Ton typed ...
The workaround here would be to set an alias in root's .bashrc file to use /usr/bin/vim when vi is called. As far as I know, vim is more secure than vi and should be safer to run as root.
Actually, /bin/vi *is* vim, just compiled up without lots of stuff (mouse, plugins, etc.) that might cause problems/security issues when run as root, esp. in recovery mode.
It's highly unlikely (although not impossible!) that vim is the issue.
Thanks Neil, it's good to know that /bin/vi is a more secure /usr/bin/vim.
That being the case /bin/vi is the more appropriate editor to use as root. Any hints as to how to workaround the text remnant problem with /bin/vi as root on Gnome Terminal?
Here's how I can reproduce the problem all the time: 1) Login in to Gnome Desktop (as root or anyone else) 2) Open Gnome Terminal 3) If not root: # su - 3) Edit a large text file in vi and scroll down. Some text at end of line should remain on the last line.
Khoa
Around about 28/03/06 04:28, Khoa Ton typed ...
That being the case /bin/vi is the more appropriate editor to use as root. Any hints as to how to workaround the text remnant problem with /bin/vi as root on Gnome Terminal?
OK, firstly which versions of gnome-terminal and vim?
Does this fail only for root, or is it for all users?
Please try:
vi -U NONE -u NONE thefileinquestion
.. and see if it still occurs. This runs vim with no config. files which, if it works, might indicate a funny setting somewhere as opposed to a code bug.
FWIW, it doesn't fail for me as a normal user on FC3 with vim 6.4.
On Tue, 2006-03-28 at 09:05 +0100, Neil Bird wrote:
Around about 28/03/06 04:28, Khoa Ton typed ...
That being the case /bin/vi is the more appropriate editor to use as root. Any hints as to how to workaround the text remnant problem with /bin/vi as root on Gnome Terminal?
OK, firstly which versions of gnome-terminal and vim?
Does this fail only for root, or is it for all users?
Please try:
vi -U NONE -u NONE thefileinquestion
.. and see if it still occurs. This runs vim with no config. files which, if it works, might indicate a funny setting somewhere as opposed to a code bug.
FWIW, it doesn't fail for me as a normal user on FC3 with vim 6.4.
From your leads, I've narrowed the problem down the whether or not
:set ruler is enabled.
Problem reproduction: Log into Gnome Desktop as normal user, open Gnome Terminal.
Text remnants on last line is seen for BOTH root AND normal user 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.
Problem never occurs when run in text console window (ALT-F1) or xterm.
The command: [khoa@nile ~] /usr/bin/vim /etc/passwd does NOT exhibit this problem, UNTIL :set noruler is entered while editing the file. With :set noruler, the problem shows up.
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 eliminates this remnants on scrolling problem.
The issue with root or normal user was an unfortunate coincidence, and has no direct bearing on the problem except that root normally calls /bin/vi, which always has :set noruler.
This happens on a brand new Fedora FC5 installation, with latest yum update as of 3/28/06.
Thanks Khoa Ton
------------- Included Version Information
[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 bugzilla@redhat.com Compiled by bugzilla@redhat.com Huge version without GUI. Features included (+) or not (-): +arabic +autocmd -balloon_eval -browse ++builtin_terms +byte_offset +cindent -clientserver -clipboard +cmdline_compl +cmdline_hist +cmdline_info +comments +cryptv +cscope +dialog_con +diff +digraphs -dnd -ebcdic +emacs_tags +eval +ex_extra +extra_search +farsi +file_in_path +find_in_path +folding -footer +fork() +gettext -hangul_input +iconv +insert_expand +jumplist +keymap +langmap +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 -osfiletype +path_extra +perl +postscript +printer +python +quickfix +rightleft -ruby +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 +visual +visualextra +viminfo +vreplace +wildignore +wildmenu +windows +writebackup -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 -I/usr/lib/perl5/5.8.8/i386-linux-thread-multi/CORE -I/usr/include/python2.4 -pthread Linking: i386-redhat-linux-gcc -Wl,-E -Wl,-rpath,/usr/lib/perl5/5.8.8/i386-linux-thread-multi/CORE -L/usr/local/lib -o vim -lncurses -lselinux -lacl -lgpm -Wl,-E -Wl,-rpath,/usr/lib/perl5/5.8.8/i386-linux-thread-multi/CORE -L/usr/local/lib /usr/lib/perl5/5.8.8/i386-linux-thread-multi/auto/DynaLoader/DynaLoader.a -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
[khoa@nile ~]$ /bin/vi --version VIM - Vi IMproved 6.4 (2005 Oct 15, compiled Mar 9 2006 09:44:11) Included patches: 2-7 Compiled by bugzilla@redhat.com Tiny version without GUI. Features included (+) or not (-): -arabic -autocmd -balloon_eval -browse +builtin_terms -byte_offset -cindent -clientserver -clipboard -cmdline_compl -cmdline_hist -cmdline_info -comments -cryptv -cscope -dialog -diff -digraphs -dnd -ebcdic -emacs_tags -eval -ex_extra -extra_search -farsi -file_in_path -find_in_path -folding -footer +fork() -gettext -hangul_input +iconv -insert_expand -jumplist -keymap -langmap -libcall -linebreak -lispindent -listcmds -localmap -menu -mksession -modify_fname -mouse -mouse_dec -mouse_gpm -mouse_jsbterm -mouse_netterm -mouse_xterm +multi_byte -multi_lang -netbeans_intg -osfiletype -path_extra -perl -printer -python -quickfix -rightleft -ruby -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 -visual -viminfo -vreplace +wildignore -wildmenu -windows +writebackup -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 Linking: i386-redhat-linux-gcc -L/usr/local/lib -o vim -lselinux -ltermcap -lacl
Around about 28/03/06 11:09, Khoa Ton typed ...
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 eliminates this remnants on scrolling problem.
I'm unable to reproduce this with vim 6.4 and my older gnome-terminal, and I don't have an FC5 box yet. It therefore sounds like a gnome-terminal bug, esp. since gnome's been doing loads of font rendering optimisations [not that these may be relevant]. Esp. as it's OK in an xterm of the same size [assumption].
I recommend raising a report in redhat's bugzilla.
On Tue, 2006-03-28 at 13:06 +0100, Neil Bird wrote:
Around about 28/03/06 11:09, Khoa Ton typed ...
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 eliminates this remnants on scrolling problem.
I'm unable to reproduce this with vim 6.4 and my older gnome-terminal, and I don't have an FC5 box yet. It therefore sounds like a gnome-terminal bug, esp. since gnome's been doing loads of font rendering optimisations [not that these may be relevant]. Esp. as it's OK in an xterm of the same size [assumption].
I recommend raising a report in redhat's bugzilla.
I agree that this sounds like it might be a Gnome Terminal bug. I've filed a Bugzilla report at: https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=187192
Thanks for your help in tracking down this issue, Neil.
Khoa
Khoa Ton khoa@puresynergy.com writes:
I agree that this sounds like it might be a Gnome Terminal bug.
It is long-standing that gnome terminal is not xterm, yet people and distros keep setting the TERM variable to xterm. Any apps (any that use ncurses) that make use of xterms irregularities in screen control will corrupt the screen.
Donald Arseneau wrote:
Khoa Ton khoa@puresynergy.com writes:
I agree that this sounds like it might be a Gnome Terminal bug.
It is long-standing that gnome terminal is not xterm, yet people and distros keep setting the TERM variable to xterm. Any apps (any that use ncurses) that make use of xterms irregularities in screen control will corrupt the screen.
Good point, Donald.
Taking your suggestion, 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"
I've updated to Bugzilla report with this information: https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=187192
Thanks, Khoa