[Top][All Lists]

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

Re: Ncurses & PuTTY/xterm

From: Thomas Dickey
Subject: Re: Ncurses & PuTTY/xterm
Date: Mon, 23 Sep 2002 16:41:31 -0400
User-agent: Mutt/1.3.27i

On Sun, Sep 22, 2002 at 09:48:33PM +0200, Martin Hinner wrote:
> Hello,
>   sorry for bothering you, but I have this problem with ncurses library.
> Imagine source code containing these lines:
>  ...
>  init_pair(1,COLOR_RED,COLOR_BLUE);
>  ...
>  attrset(COLOR_PAIR(1));
>  for (i=0;i<LINES;i++)
>     for(j=0;j<COLS;j++)
>        mvaddch(i, j, 0x20);

perhaps this

curs_bkgd(3X)                                       curs_bkgd(3X)

       bkgdset,  wbkgdset,  bkgd,  wbkgd, getbkgd - curses window
       background manipulation routines

       #include <curses.h>

       void bkgdset(chtype ch);
       void wbkgdset(WINDOW *win, chtype ch);
       int bkgd(chtype ch);
       int wbkgd(WINDOW *win, chtype ch);
       chtype getbkgd(WINDOW *win);
>  mvaddch(10,10,'x');
>  refresh();
> It should clear background with blue spaces and type 'x' at (10,10). It
> works fine under Linux (TERM=linux,xterm) on terminal or telnet/ssh
> connection. But when connected via PuTTY from Windows machine or in xterm,
> it shows only blue 'x' and the rest of screen is black. Turning on 'Use
> background color to erase screen' in PuTTY configuration solves my problem.
> Anyway, if you could hint me what am I doing wrong, I would very appreciate
> it.

but also this: PuTTY normally doesn't use background color erase (bce).
You're probably running on one of the Linux distributions that equates
"xterm" to one of the flavors of color xterm's, and most of those have
bce in their terminfo descriptions.

This is what I used for PuTTY, however, based on its default settings:

comparing putty to xterm-r6.
    comparing booleans.
        bw: T:F.
        ccc: T:F.
    comparing numbers.
        colors: 8, NULL.
        pairs: 64, NULL.
    comparing strings.
        blink: '\E[5m', NULL.
        civis: '\E[?25l', NULL.
        cnorm: '\E[?25h', NULL.
        ech: '\E[%p1%dX', NULL.
        hpa: '\E[%i%p1%dG', NULL.
        kbs: '\177', '^H'.
        kcbt: '\E[Z', NULL.
        oc: '\E]R', NULL.
        op: '\E[39;49m', NULL.
        rmam: '\E[?7l', NULL.
        rmso: '\E[27m', '\E[m'.
        rmul: '\E[24m', '\E[m'.
        setab: '\E[4%p1%dm', NULL.
        setaf: '\E[3%p1%dm', NULL.
        smam: '\E[?7h', NULL.
        vpa: '\E[%i%p1%dd', NULL.

#       Reconstructed via infocmp from file: 
putty|xterm clone (win32), 
        am, bw, ccc, km, mir, msgr, xenl, 
        colors#8, cols#80, it#8, lines#24, pairs#64, 
        bel=^G, blink=\E[5m, bold=\E[1m, civis=\E[?25l, 
        clear=\E[H\E[2J, cnorm=\E[?25h, cr=^M, 
        csr=\E[%i%p1%d;%p2%dr, cub=\E[%p1%dD, cub1=^H, 
        cud=\E[%p1%dB, cud1=^J, cuf=\E[%p1%dC, cuf1=\E[C, 
        cup=\E[%i%p1%d;%p2%dH, cuu=\E[%p1%dA, cuu1=\E[A, 
        dch=\E[%p1%dP, dch1=\E[P, dl=\E[%p1%dM, dl1=\E[M, 
        ech=\E[%p1%dX, ed=\E[J, el=\E[K, enacs=\E)0, home=\E[H, 
        hpa=\E[%i%p1%dG, ht=^I, hts=\EH, il=\E[%p1%dL, il1=\E[L, 
        kbs=\177, kcbt=\E[Z, kcub1=\EOD, kcud1=\EOB, kcuf1=\EOC, 
        kcuu1=\EOA, kdch1=\E[3~, kf1=\E[11~, kf10=\E[21~, 
        kf11=\E[23~, kf12=\E[24~, kf13=\E[25~, kf14=\E[26~, 
        kf15=\E[28~, kf16=\E[29~, kf17=\E[31~, kf18=\E[32~, 
        kf19=\E[33~, kf2=\E[12~, kf20=\E[34~, kf3=\E[13~, 
        kf4=\E[14~, kf5=\E[15~, kf6=\E[17~, kf7=\E[18~, kf8=\E[19~, 
        kf9=\E[20~, kfnd=\E[1~, kich1=\E[2~, kmous=\E[M, knp=\E[6~, 
        kpp=\E[5~, kslt=\E[4~, oc=\E]R, op=\E[39;49m, rc=\E8, 
        rev=\E[7m, ri=\EM, rmacs=^O, rmam=\E[?7l, 
        rmcup=\E[2J\E[?47l\E8, rmir=\E[4l, rmkx=\E[?1l\E>, 
        rmso=\E[27m, rmul=\E[24m, 
        rs2=\E7\E[r\E8\E[m\E[?7h\E[?1;3;4;6l\E[4l\E>, sc=\E7, 
        setab=\E[4%p1%dm, setaf=\E[3%p1%dm, 
        sgr0=\E[m, smacs=^N, smam=\E[?7h, smcup=\E7\E[?47h, 
        smir=\E[4h, smkx=\E[?1h\E=, smso=\E[7m, smul=\E[4m, 
        tbc=\E[3g, u6=\E[%i%d;%dR, u7=\E[6n, u8=\E[?1;2c, u9=\E[c, 

Thomas E. Dickey <address@hidden>

reply via email to

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