Cursor/tab character display problem

Gunnar Ritter Gunnar.Ritter at pluto.uni-freiburg.de
Mon Nov 29 19:20:09 CET 2004


<pcg( Marc)@goof(A.).(Lehmann )com> wrote:

> > > Hmm.. and your point being?
> > The cursor should occupy one single character cell as usual.
> And why? The tab character is wider than a single character cell.

Maybe, but it does not work consistently even then. First, the cursor
only occupies the whole tab if TAB3 is not set in c_oflag of the terminal
configuration. Otherwise, the terminal never sees a tab at all. I don't
think a terminal cursor should behave that different depending on TAB3.

As another example, if you try vi from
<http://prdownloads.sourceforge.net/ex-vi/ex-040605.tar.gz?download> on
the following data

void
foo(void)
{
	call();
}

and use 'j' at the first column four times to go down to the line with
the tab, the cursor will be large. But if you type 'lh' then to get one
character right and back again, it will become small at the same position.
This is because vi prints a space for the 'l' to get one column right, and
a backspace for the 'h'. So the cursor is positioned over a space after
'lh' and is small then. The whole sequence printed is something like
'\tcall();\r\t\b \b', as it can be reproduced with stty -icanon -echoctl
-icrnl. But for the user, it should look the same before and after because
the space is just a method of terminal control and would not appear in the
actual output file. (I came across these issues because I'm just writing
multibyte support for vi.)

So making the cursor large might be acceptable if the terminal could do
it consistently, but it seems it cannot.

> > another point of view, the cursor should look the same after erasing
> > a tab as it was looking before the tab was typed.
> If the tab gets erases, rxvt-unicode will not display a wide cursor (or
> you hit a bug). Are you sure the tab character got erases?

Yes, of course. Just invoke 'cat', type a few tabs, erase them again and
watch the fun.

	Gunnar




More information about the rxvt-unicode mailing list