Bruno Haible wrote on 2004-03-01 16:59 UTC:
> There is also the problem of the TAB: Currently linux/drivers/char/n_tty.c
> also transforms a TAB to a sequences of spaces, and an erase of a TAB to
> a sequence of BACKSPACEs. If we keep it this way, the kernel must still
> learn to distinguish single-width and double-width characters, in order
> to keep a notion of "current column number".
I believe, the TAB is just another good example of why we have to move
away in terminal emulations from the notion of a matrix of glyph cells
as the fundamentally underlying state, towards a notion of a list of
lines (later even paragraphs?) of characters, each with variable width.
Since some applications have elevated the TAB to a full character of its
own right ("make" most notably), we should expect it to be preserved
properly when we cut and paste from one terminal screen into another
one. That of course can only work, if the TAB character is echoed
intact, like any other real character, back to the terminal, and is not
substituted by spaces. The state of a terminal is then much closer to a
plaintext file, where sending and echoing a character inserts a
character, and where a backspace deletes a character. The terminal
protocol's semantics would become defined in terms of edit operations on
a plain-text file.
What we really need is a successor specification for ECMA-48 and ISO
6429, which clearly distinguishes control functions that operate on
pixel coordinates from control functions that operate on character
coordinates and modify the underlying text-file notion of the screen's
current state. With luck, it may be possible to do this in a
backwards-compatible way.
[BTW: Would some company or funding organization here have a lot of
interest in terminals and "thin clients" that can be controlled
conveniently via printf? I would actually be quite happy to set up a
research project to design and flesh out a really nice and proper
son-of-ISO-6429 standard, optimized for contemporary hardware
capabilities and user requirements, along with a production-quality
reference implementation for X11. Contact me, if you are interested in a
more detailed project proposal.]
Markus
--
Markus Kuhn, Computer Lab, Univ of Cambridge, GB
http://www.cl.cam.ac.uk/~mgk25/ | __oo_O..O_oo__
--
Linux-UTF8: i18n of Linux on all levels
Archive: http://mail.nl.linux.org/linux-utf8/