[Top][All Lists]

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

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

From: Klaus Weide
Subject: Re: lynx-dev displaying current page title in xterm window title
Date: Wed, 24 May 2000 14:51:41 -0500 (CDT)

On Tue, 23 May 2000, Duncan Simpson wrote:

> A little termcap reading shows that some older hadrware also has a set title 
> feature (with moderately different control sequences from xterm). lynx 
> couldtest hs to test for support and use ts fro instructions on how to do it.
> From the termcap man page
>        hs   Has a status line
>        ds   Disable status line
>        ts   Move cursor to column %1 of status line

What makes you assume that "status line" == "window title"?

Several terminal emulators, for X Windows or not, provide a "status line"
that has nothing to do with the window title.  Normally that status line
is shown after the last "normal" line of text, at the bottom.
That's the original meaning of hs (has_status_line), using xterm's
window title for it arguably is a non-standard reinterpretation.

Examples: "kon" and "kterm" (both used for Japanese; kterm is derived
from xterm, kon isn't and X application at all) provide for a status line
at the bottom and (on my system) have hs in their descriptions.

> in xterm, and presumably others, sending <ts>Ritle<BEL> sets the staus line 
> (aka xterm title). You could cut ts off the beginning of ds and take the rest 
> as the end of the title string if you felt the need. Title setting code could 
> be as simple as
> void set_title(const char *t)
> {
>     char *ts;
>     if (tgetent("hs") && (td=tgetstr("ts", NULL))!=NULL)
>     {
>       tputs(ts);
>       fputs(t, stdout);
>       fputc('\007', stdout);
>     }
> }

Does your terminfo description for "xterm" actually define hs, ts, ds?
Mine doesn't.  I expect that's much more common.

Well, I find theses special xterm variants in my terminfo.src:

# These entries allow access to the X titlebar and icon name as a status line.
# Note that twm (and possibly window managers descended from it such as tvtwm,
# ctwm, and vtwm) track windows by icon-name; thus, you don't want to mess
# with it.
xterm+sl|access X title line and icon name,
        dsl=\E]0;\007, fsl=^G, tsl=\E]0;,
xterm+sl-twm|access X title line (pacify twm-descended window managers),
        dsl=\E]2;\007, fsl=^G, tsl=\E]2;,
as well as
# From: David J. MacKenzie <address@hidden> 20 Apr 1995
# Here's a termcap entry I've been using for xterm_color, which comes
# with BSD/OS 2.0, and the X11R6 contrib tape too I think.  Besides the
# color stuff, I also have a status line defined as the window manager
# title bar. [I have translated it to terminfo -- ESR]
xterm-pcolor|xterm with color used for highlights and status line,
        bold=\E[1m\E[43m, rev=\E[7m\E[34m, smso=\E[7m\E[31m,
        use=xterm+sl, use=xterm-r6,

But that's not "xterm".   So your code would only kick in if I set
TERM="xterm-pcolor" (and who knows what else that breaks...) or make
a customised description.

Why do you hardwire the '\007' while using the description-provided
string for ts[l]?  That's certainly inconsistent, and will break for
terminals that don't use this xterm peculiarity.

Anyway, I understand that for MS Windows there already is equivalent
functionality in the code (may need *_EX defined).  See set_ws_title()
in LYMainLoop.c.  If you really want to implement something like this
for xterm etc., I really hope we won't end up having two completely
different ways of doing basically the same thing that hook into
completely different places in the existing code.


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

reply via email to

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