VI editor in Gnome Terminal leaves text remnants on scroll

Khoa Ton khoa at puresynergy.com
Mon Mar 27 11:36:02 UTC 2006


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








More information about the fedora-list mailing list