Paul "LeoNerd" Evans leonerd at leonerd.org.uk
Thu Mar 6 01:24:11 UTC 2014

Jilles Tjoelker wrote
> I think it is worth it to simplify terminals. Instead of having people
> choose how they want their terminal to work improperly, provide one way
> and concentrate on making that work as well as possible (no visual
> artifacts, 256 colours, Unicode, key combinations like Ctrl+Home, etc.)

I agree here too. I'm sure overall, application writers waste more time
trying to accommodate every possible variation in terminals, than terminal
authors would just getting to a place where they all agree. I for one have
wasted far too long getting my libraries to properly understand that bce is
default-off in screen, and how to work around it.

Lets not forget; the original reason we're in this state has to do with DEC
vs Wyse vs IBM vs everyone else, trying to build glass teletypes. We're past
that age now.

Jilles Tjoelker wrote
> I also like the idea of some applications sending control sequences
> directly, without using curses or even termcap/terminfo.

libtickit does exactly this. If $TERM implies a recent enough terminal (i.e.
TERM=xterm or variations) then it switches to an active probing mode where
it just asks the terminal whether it supports 256 colours, and so on. It
then uses an entirely built-in set of sequences, not looked up from
termcap/terminfo. In fact, more or less the only reason libtickit links
against unibilium or tinfo of ncurses is so that it can look up the
afore-mentioned bce flag, in order to work out if it should print spaces or
use ECH.

I've always felt this a far better way to write terminal applications. Which
of these is the best way to know if a terminal supports a given feature:

 a) use a possibly-wrong local environment variable as a key into a disk
database on the local machine (where the terminal may not be running; e.g.
consider ssh) to find a fixed set of capabilities that were current about
the terminal when those files were written, or
 b) ask it

I vote "b" :)

For anyone who still thinks "a" I will leave you to consider how your
termcap file knows whether I compiled my terminal using
  ./configure --with-256colours --with-italics --without-underline

Paul "LeoNerd" Evans

leonerd at leonerd.org.uk

View this message in context: http://freebsd.1045724.n5.nabble.com/terminfo-tp5887280p5892023.html
Sent from the freebsd-arch mailing list archive at Nabble.com.

More information about the freebsd-arch mailing list