bug-ncurses
[Top][All Lists]
Advanced

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

Re: Termite's terminfo


From: Thomas Dickey
Subject: Re: Termite's terminfo
Date: Tue, 8 Oct 2019 18:16:55 -0400
User-agent: NeoMutt/20170113 (1.7.2)

On Tue, Oct 08, 2019 at 01:10:42PM +0300, IFo Hancroft wrote:
> Hey!
> 
> By functionality, I didn't mean color. I may be missunderstanding some
> things about how terminal functionality is specified and used so what I was
> saying may be wrong. As for $TERM, I am not sure what caused it. I am sure
> it's not hard coded check on $TERM in ncurses, I am just saying that I did
> change my $TERM var as a fast way to start using termite.terminfo as opposed
> to xterm-termite.terminfo in order to test it. The functionality in question
> I was losing during that was the dynamic titles in the terminal. I did still
> have Vim for example, change the title (as far as I can remember) but things
> like sshing into a server stopped showing the new host in the title and
> Weechat stopped changing the title. I will recompile Termite in the next
> couple of days, making it actually present itself as termite, so I don't
> have to change $TERM in .bashrc and test again.

I'm reasonably certain that you're dealing with a script which ignores
the content of the terminal description and just looks at the name.

Once you find that (it's a script...) updating it should be "easy".
I've seen scripts which ignore rxvt, for instance.

Here's what infocmp shows me for the difference between xterm-256color
and termite:

comparing xterm-256color to termite.
    comparing booleans.
        bce: T:F.
        hs: F:T.
        mc5i: T:F.
    comparing numbers.
    comparing strings.
        acsc: '``aaffggiijjkkllmmnnooppqqrrssttuuvvwwxxyyzz{{||}}~~', 
'++\,\,--..00``aaffgghhiijjkkllmmnnooppqqrrssttuuvvwwxxyyzz{{||}}~~'.
        blink: '\E[5m', NULL.
        cvvis: '\E[?12;25h', NULL.
        dim: '\E[2m', NULL.
        dsl: NULL, '\E]2;\007'.
        fsl: NULL, '^G'.
        ich1: NULL, '\E[@'.
        ka1: '\EOw', NULL.
        ka3: '\EOy', NULL.
        kb2: '\EOu', '\EOE'.
        kc1: '\EOq', NULL.
        kc3: '\EOs', NULL.
        kmous: '\E[<', '\E[M'.
        mc0: '\E[i', NULL.
        mc4: '\E[4i', NULL.
        mc5: '\E[5i', NULL.
        mgc: '\E[?69l', NULL.
        rep: '%p1%c\E[%p2%{1}%-%db', NULL.
        rmcup: '\E[?1049l\E[23;0;0t', '\E[?1049l'.
        rmm: '\E[?1034l', NULL.
        rs1: '\Ec\E]104\007', '\Ec'.
        sgr: 
'%?%p9%t\E(0%e\E(B%;\E[0%?%p6%t;1%;%?%p5%t;2%;%?%p2%t;4%;%?%p1%p3%|%t;7%;%?%p4%t;5%;%?%p7%t;8%;m',
 '%?%p9%t\E(0%e\E(B%;\E[0%?%p6%t;1%;%?%p2%t;4%;%?%p1%p3%|%t;7%;%?%p7%t;8%;m'.
        smcup: '\E[?1049h\E[22;0;0t', '\E[?1049h'.
        smglr: '\E[?69h\E[%i%p1%d;%p2%ds', NULL.
        smm: '\E[?1034h', NULL.
        tsl: NULL, '\E]2;'.

The capabilities which deal with the status-line (which is sort-of misused
in some entries to be the terminal's title) are

        dsl: NULL, '\E]2;\007'.
        fsl: NULL, '^G'.
        tsl: NULL, '\E]2;'.

It's not in xterm's terminal description because the definition of tsl
says it should have a parameter specifying the column at which the cursor
appears when moving to the status line.  Instead, I have an extension in
ncurses (XT) which says that it handles the status line like xterm.

# 2010-09-25
#       * add "XT" capability to entries for terminals that support both
#         xterm-style mouse- and title-controls, for "screen" which
#         special-cases TERM beginning with "xterm" or "rxvt" -TD
...
# 2012-04-14
#       * document all of the user-defined capabilities in one place -TD
#       * add XT to some places to improve usefulness for other applications
#         than screen, which would like to pretend that xterm's title is
#         a status-line. -TD

It's a boolean, so

        if tput XT
        then
                # xterm title stuff
        fi

would do the expected thing, preferable to something like

        case $TERM in
        xterm*|rxvt*|konsole*|mlterm*|screen*)
                # xterm title stuff
                ;;
        esac

(or even worse, just sending the title escapes under the impression that it's 
always "xterm").

> P.S. What do you think would be a good reading material so I can better

These are kind of terse, but give the available information:

        man terminfo(5)
        man infocmp(1)
        man tic(1)

The terminfo manual page is only about 45 printed pages, while terminfo.src
is more than 600 pages...

For checking (and seeing the mismatches for ich1 vs ich, etc.), I use

        tic -c -v -x terminfo.src

and see these lines for 'termite':

Starting 'termite|VTE-based terminal'
"terminfo.src", terminal 'termite': conflicting key definitions (using the last)
... KEY_SF (capability "kind") is the same as capability "kDN"
... KEY_SR (capability "kri") is the same as capability "kUP"
"terminfo.src", terminal 'termite': tsl uses 0 parameters, expected 1
"terminfo.src", terminal 'termite': expected XT to be set, given kmous
"terminfo.src", terminal 'termite': non-curses applications may be confused by 
ich1 with smir/rmir

For testing terminal descriptions, I use tack:

https://invisible-island.net/ncurses/tack.html

and the various test-programs 

https://invisible-island.net/ncurses/ncurses-examples.html

and for testing xterm compatibility, vttest (along with several dozen scripts).

https://invisible-island.net/vttest/vttest.html

> understand what different terminal capabilities are available (in general,
> not on a specific terminal), how are they determined and how is each
> described, so I can better understand creating a terminal's terminfo
> 
> On 10/8/19 1:10 AM, Thomas Dickey wrote:
> > On Mon, Oct 07, 2019 at 12:42:18PM +0300, IFo Hancroft wrote:
> > > I have just found something interesting. If I change my $TERM to termite 
> > > as
> > > opposed to xterm-termite, I lose functionality. I haven't
> > 
> > "functionality" wasn't mentioned.
> > 
> > Perhaps you're seeing this in GNU ls, which uses its own guess about
> > color based on $TERM.   On the machine I'm using at the moment,
> > "dircolors -p" asserts that these do color:
> > 
> > TERM Eterm
> > TERM ansi
> > TERM *color*
> > TERM con[0-9]*x[0-9]*
> > TERM cons25
> > TERM console
> > TERM cygwin
> > TERM dtterm
> > TERM gnome
> > TERM hurd
> > TERM jfbterm
> > TERM konsole
> > TERM kterm
> > TERM linux
> > TERM linux-c
> > TERM mlterm
> > TERM putty
> > TERM rxvt*
> > TERM screen*
> > TERM st
> > TERM terminator
> > TERM tmux*
> > TERM vt100
> > TERM xterm*
> > 
> > vt100's never did color.
> > 
> > The "gnome" entry there is derived from ncurses, but rather old.
> > I deprecated it in 2010:
> > 
> > # 2010-11-20
> > #   * make "vte" the principal entry defining "gnome", since GNOME terminal
> > #     is merely one of several terminals whose behavior is provided by this
> > #     library -TD
> > 
> > Hardcoding checks on $TERM never was a good idea, and it's not done here :-)
> > 
> > To put it into perspective, ncurses' terminal data has...
> > 
> >       305 entries with 8 colors (72%)
> >         1 entries with 15 colors (0%)
> >        37 entries with 16 colors (9%)
> >         6 entries with 52 colors (1%)
> >         9 entries with 64 colors (2%)
> >         6 entries with 88 colors (1%)
> >        47 entries with 256 colors (11%)
> >         1 entries with 512 colors (0%)
> >         1 entries with 4096 colors (0%)
> >        13 entries with 16777216 colors (3%)
> >       426 entries with colors
> > 
> > > compiled/recompiled termite to make it present itself as termite, so it 
> > > may
> > > be due to that and not the terminfo file but maybe there is no need to
> > > change the terminfo file until I test further.
> > > 
> > > On 10/7/19 7:47 AM, IFo Hancroft wrote:
> > > > I have just checked the branches and versions.
> > > > Termite does use a recent VTE version (I believe it is even up to date
> > > > with VTE's current development version, not just the latest stable),
> > > > though VTE's versions are confusing (at least for me) with being called
> > > > VTE3, while being named and installed as VTE 2.91 while the version is
> > > > actually 0.48.3 according to https://developer.gnome.org/vte/
> > > > 
> > > > Anyway, my point is, Termite's terminfo can get updated to just:
> > > > termite|VTE-based terminal,
> > > > use=vte,
> > > > 
> > > > Best Regards,
> > > > IFo Hancroft
> > > > 
> > > > _______________________________________________
> > > > Bug-ncurses mailing list
> > > > address@hidden
> > > > https://lists.gnu.org/mailman/listinfo/bug-ncurses
> > > 
> > > _______________________________________________
> > > Bug-ncurses mailing list
> > > address@hidden
> > > https://lists.gnu.org/mailman/listinfo/bug-ncurses
> > 

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

Attachment: signature.asc
Description: PGP signature


reply via email to

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