lynx-dev
[Top][All Lists]
Advanced

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

Re: lynx-dev displaying current page title in xterm window title


From: Duncan Simpson
Subject: Re: lynx-dev displaying current page title in xterm window title
Date: Thu, 25 May 2000 00:54:39 +0000

Actually reading a litle more termcap tells me the magic to end the status 
line is called fs, s I should write the code as

void set_title(const char *t, int w)
{
    char *ts, *fs, *tt;
    int tw;

    if (tgetent("hs") && (ts=tgetstr("ts", NULL))!=NULL
        && (fs=tgetstr("fs", NULL))!=NULL)
    {
        if ((tw=tgetnum("ws"))==-1)
            wd=w;
        tt=alloca(wd+1);
        strncpy(tt, t, wd);
        *(tt+wd)='\0';
        tputs(ts, 1, &putchar); /* RTFMP fix */
        fputs(tt, stdout);
        tputs(fs, 1, &putchar); 
    }
}

Arguably OSC 2, alais ESC ] 2 ; is the right thing. However I also
think that termcap is the right thing. xterm entries externded to inlcude
to ts use OSC 0. (OSC 0 and OSC 2 work in bog standard xterm term and
the status line is the width title, one can tell by examining the source).

None of the OSC magic is in my XFree 4.0 official xterm termcap but the code
to actually implement it is definately there, so i imagine X11R6 ffeatures it o
too (just some poeple's tercmcap and temrinof fails to mention them-).

<quote from ctlseq.ms>
OSC Ps ; Pt ST
OSC Ps ; Pt BEL
               Set Text Parameters.  For colors and font, if Pt is a
               "?", the control sequence elicits a response which con-
               sists of the control sequence which would set the corre-
               sponding value.  The dtterm control sequences allow you
               to determine the icon name and window title.
                 Ps = 0  -> Change Icon Name and Window Title to Pt
                 Ps = 1  -> Change Icon Name to Pt
                 Ps = 2  -> Change Window Title to Pt
                 Ps = 3  -> Set X property on top-level window. Pt
<end quote>

xterm will also respond to CSI 1 c and CSI > 1 c with indentity information. 
(So will various DEC terminals.)
-- 
Duncan (-:
"software industry, the: unique industry where selling substandard goods is
legal and you can charge extra for fixing the problems."



; To UNSUBSCRIBE: Send "unsubscribe lynx-dev" to address@hidden

reply via email to

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