Ienup Sung writes:
> - Display cell erase mode:
> ...
> In this erase mode, no matter how many characters are in a display cell,
> the display cell will be erase and thus all characters in the display cell
> will also be erased from the line buffer. For instance,
> if we have A, a combinging diacritical mark accute, and a combining
> diacritical mark breve in a single column display cell and also in
> a line buffer, a backspace operation will erase all the characters in
> the display cell from the screen and also the line buffer.
>
> - Character/character element erase mode:
> In this erase mode, the last character in the current display cell will be
> erased and depending on the context, the display cell could be erased (if
> the character erased is the last remaining one in the display cell) or
> that particular character only will be erased while the other characters in
> the display cell still show up in the display cell. For instance,
> if we have A, a combinging diacritical mark accute, and a combining
> diacritical mark breve in a single column display cell and also in
> a line buffer, a backspace operation will erase only the combining
> diacritical mark breve and thus the display cell will be re-displayed with
> the A with the combining diacritical mark accute only.
You mention a "line buffer". A terminal emulator has no line buffer.
It has only a screen contents and a cursor position. Therefore I think
you are talking about line editing facilities, not about terminal
emulators.
I agree with you that a line editing facility, e.g. readline, could
provide both modes.
How about a third mode, let me call it "emacs erase mode":
- If, since the last character was input, no other keystroke has
been entered and the cursor has not been moved, the last character
element is erased. Otherwise, the entire last display cell is
erased.
This is what the user sees. However, the primitive cursor positioning
operation (echo '\b') must be "move left by one column". The line
editor's three erase modes can be implemented on top of that (assuming
a consistent wcwidth()). OTOH, if the terminal would be doing more
complicated things than simple cursor positioning, it would be very
hard or impossible to implement a reliable ncurses library.
Bruno
-
Linux-UTF8: i18n of Linux on all levels
Archive: http://mail.nl.linux.org/lists/