[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Testing for UTF-8 tty mode



    From: Bruno Haible <haible@ilog.fr>

    Now, consoles need to know about UTF-8 mode, but other ttys need as well,
    for the purpose of correct functioning of the backspace and tab keys
    in line editing in ICANON mode.

    So the ioctl we are seeking is TCGETA/TCSETAF, right?

Hmm. TCGETA gives us a struct termio, with c_{i,o,c,l}flag.
Similarly, the more modern tcgetattr() gives a struct termios.
c_cflag describes hardware output control (baud rate, parity,
	number of start/stop bits)
c_oflag has bits OPOST, ..., FF1 for output control
c_iflag has bits IGNBRK, ... for input control
c_lflag has bits ICANON, ... for input control.

Maybe you would like to claim a bit in c_lflag?
A subdivision of ICANON?
And also a bit in c_oflag?

Note that things will not be very portable since
many Unix flavors have these fields unsigned short
and all 16 bits already have a meaning.

If backspace is to function correctly we need to know
(i) how many bytes should be removed in the input queue?
    and how many Unicode characters?
(ii) how should the display be changed?
Clearly, the kernel, or xterm, needs knowledge of which
Unicode characters combine.



But all this is rather independent of the starting point
of this discussion.
Right now keyboard and console know about a Unicode mode,
while general ttys do not.

Andries
-
Linux-UTF8:   i18n of Linux on all levels
Archive:      http://mail.nl.linux.org/lists/