bug-ncurses
[Top][All Lists]
Advanced

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

Re: ACS and repeating characters


From: Thomas Dickey
Subject: Re: ACS and repeating characters
Date: Sat, 22 Jul 2017 16:12:02 -0400
User-agent: Mutt/1.5.21 (2010-09-15)

On Sat, Jul 15, 2017 at 08:44:07PM -0400, Thomas Dickey wrote:
> On Fri, Jul 14, 2017 at 03:17:58AM +0200, Dick Wesseling wrote:
> > 
> > When emitting a range of repeated characters from the Alternate
> > Characer Set, EmitRange() supplies CharOf(ntext0) as the first parameter
> > of 'repeat_char' without translation. For example, ACS_HLINE is
> > printed as 'q' instead of \304.
> > 
> > This can be reproduced with "TERM=ansi ./demo_forms".
> 
> I see (by running this in Linux console, disabling UTF-8 and using
> the ncurses test-program menu f or F, if the number of graphic characters
> in a row is more than 4-5, the first character becomes "q", etc).
> 
> The test wouldn't work for xterm :-)

I took a close look today, and see that it is not a bug in ncurses.

If I turn on the debugging trace, I can see that the expected
escape sequence for enabling alternate character-set is sent.

Linux console does not implement the "rep" (repeat) control found in
the "ansi" terminal description.  If you do "infocmp linux ansi",
you will see that it is not listed:

comparing linux to ansi.
    comparing booleans.
    ...
    comparing strings.
    ...
        rep: NULL, '%p1%c\E[%p2%{1}%-%db'.

The output shows that this would be an escape sequence ending with "b".
Referring to the kernel source, that would be handled in the case
statement indicated

https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/drivers/tty/vt/vt.c#n1956

                switch(c) {
                case 'G': case '`':
                        if (vc->vc_par[0])
                                vc->vc_par[0]--;
                        gotoxy(vc, vc->vc_par[0], vc->vc_y);
                        return;
                ...

But there is no case for 'b'.

Nothwithstanding the paragraph in console_codes

       The   Linux  console  implements  a  large  subset  of  the  VT102  and
       ECMA-48/ISO 6429/ANSI X3.64 terminal controls,  plus  certain  private-
       mode  sequences  for changing the color palette, character-set mapping,
       and so on.  In the tabular descriptions below, the second column  gives
       ECMA-48  or  DEC  mnemonics  (the  latter if prefixed with DEC) for the
       given function.  Sequences without a mnemonic are neither  ECMA-48  nor
       VT102.

the Linux console does not implement all of the control sequences listed
in ECMA-48.  I would't use the phrasing "large subset", since in fact
it implements less than half of ECMA-48:

        + in a quick count, with the individual SGR codes and modes counted
          separately, I see 120 items for Linux.

        + Counting ECMA-48, there's 162 non-SGR, plus 61 SGR, plus 22 modes,
          giving 245 total.

That's 48%.

While I'm thinking about it, GNU screen also is frequently cited in a similar
way  A quick count gives me 112 items.  Call it 45%.

In both cases, the count includes several non-standard escape sequences.

Those percentages would go down if I limited the comparison to
VT100 and/or ECMA-48.

-- 
Thomas E. Dickey <address@hidden>
http://invisible-island.net
ftp://invisible-island.net

Attachment: signature.asc
Description: Digital signature


reply via email to

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