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: Andries Brouwer
Subject: [Groff] Re: backspace and Unicode in terminals
Date: Thu, 17 Mar 2005 22:00:07 +0100
User-agent: Mutt/1.4i

On Thu, Mar 17, 2005 at 09:24:23AM +0100, Werner LEMBERG wrote:
> 
> I'm going to improve grotty, the TTY backend of groff, so that it can
> handle zero-width and double-width characters, as needed for proper
> Unicode support.
> 
> Doing so I wonder how is the backspace character (U+0008, \b) handled
> in TTYs?  Is there any documentation for it?

There are many types of TTY. A termcap/terminfo entry would tell you
what escape sequence causes the cursor to move left one position.
(In termcap the boolean bs will tell you whether it is 010, backspace.)

Such cursor movement is entirely independent of the text present
on the screen.

Andries


> 
> 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?
> 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.  Is there a distinction between a user who
> presses the `backspace' key, and a `\b' character in the data stream?

At the beginning of a line a backspace has undefined effect.

Between a user pressing a key and the terminal receiving a byte stream
there are arbitrary programs that can do whatever they want.




reply via email to

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