bug-ncurses
[Top][All Lists]
Advanced

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

Re: ANSI terminal issues


From: Thomas E. Dickey
Subject: Re: ANSI terminal issues
Date: Fri, 28 Jun 2002 15:05:00 -0400 (EDT)

On Fri, 28 Jun 2002, Pradeep Padala wrote:

> Hi,
>    A user who read my howto wrote to me about this. I don't know the
> answer to this question. If you know, please answer. His mail follows..

The 'ansi' terminfo entry contains a string for 'rep' (repeat), which is
not recognized by VT100 emulators.  ncurses sees the repeat capability
and renders the leading blanks using that.  Here's the output filtered
with unmap:

Script started on Fri Jun 28 15:00:51 2002
\n~ (1) setenv TERM ansi\r\r
\n~ (2) ./foo\r\r
\n
\E[0;10m
\E[H
\E[JHello World !!! (0
\E[6b1) (0
\E[6b1)\r
\E[45;1H\r~ (3) quit\r\r
\nquit: Command not found.\r
\n~ (4) q\r\r
\nexit\r
\n
\nScript done on Fri Jun 28 15:01:05 2002
\n

The \E[6b happens to be shorter than writing "0" 8 times, though the
capability string may appear long:

        rep=%p1%c\E[%p2%{1}%-%db,

> ------
> I just found your ncurses howto on the web, so I though you must be
> familiar in it.
> I wanted to compile a really small program, then I've got a problem.
> Perhaps you could use my experiences.... so
>
> #include <ncurses.h>
>
> int main()
> {
>         initscr();                      /* Start curses mode */
>
>         printw("Hello World !!! (%08x) (%8s)",1,"00000001");
>         refresh();                      /* Print it on to the realscreen */
>         getch();                        /* Wait for user input */
>         endwin();                       /* End curses mode */
>
>         return 0;
> }
>
> step #1. export TERM=ansi
> I set the terminal to ansi,  and the result is:
>
> Hello World !!! (01) (01)
>
> Seems the leading zeros just vanished. Do you have any idea, why?
>
> step #2. export TERM=vt100
> With the vt100 works fine:
>
> Hello World !!! (00000001) (00000001)
>
> step #3. export TERM=xterm-color
> Same, works:
>
> Hello World !!! (00000001) (00000001)
>
>
> I realy do not know why this is. But interesting.
>
> Regards,
>   Jozsef Laszlo
>   PSINet ETC,
>   Switzerland
>
> -------
>
>
> _______________________________________________
> Bug-ncurses mailing list
> address@hidden
> http://mail.gnu.org/mailman/listinfo/bug-ncurses
>

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




reply via email to

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