groff
[Top][All Lists]
Advanced

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

[Groff] Re: backspace and Unicode in terminals


From: Michael Schroeder
Subject: [Groff] Re: backspace and Unicode in terminals
Date: Thu, 17 Mar 2005 12:00:50 +0100
User-agent: Mutt/1.5.6i

On Thu, Mar 17, 2005 at 09:24:23AM +0100, Werner LEMBERG wrote:
> Most importantly: If I have a wide character at position p which is
> followed by `\b' (at position p+2), is the final position p again?

No, \b moves the cursor one cell to the left, regardless of the
width of the previous character. To backspace over a double width
character you need two \bs. It's undefined what happens if you
write a new character in the middle of a double width one, some
implementations will clear the other half, some others will leave
it on-screen.

> With other words, is the width of `\b' dependent on the width of the
> previous character?  What happens if I have a sequence of `\b'
> characters?  I'm thinking especially of the interaction at the
> beginning of a new line.

The behaviour at the beginning of the line is undefined. Xterm lets
you turn on/off "Auto Wraparound" in the middle button menu.

> Is there a distinction between a user who
> presses the `backspace' key, and a `\b' character in the data stream?

Uh, now you're mixing terminal input and output. The key labled
"backspace" will produce either ^H or ^? on most terminals.
If the tty driver is in canon mode, it'll check if the character
is equal to the "stty erase" setting, if yes, it will erase the
character in the internal buffer and write "\b \b" to the
terminal to erase it onscreen.

Cheers,
  Michael.

-- 
Michael Schroeder                                   address@hidden
main(_){while(_=~getchar())putchar(~_-1/(~(_|32)/13*2-11)*13);}




reply via email to

[Prev in Thread] Current Thread [Next in Thread]