News for hackers. Stuff that matters.
Re:Notcurses 2.4 by yjftsjthsd-h on Monday September 06, 2021 @06:29PM (#28438831)
> The terminal is now extensively (but efficiently) queried on startup. Some properties are derived from the results.

> Eventually, this will be expanded to eliminate our reliance on TERM and dependence on terminfo.

So they're doing feature detection? I didn't know that was possible for terminals, but if it is then it does seem like a nice step forward. Of course, it seems like such an obvious improvement that I'm curious why it hasn't happened before (i.e. why is everyone else still depending on TERM?)

Re:Notcurses 2.4 by p_l on Monday September 06, 2021 @07:15PM (#28439154)
Simple reason - there was no way to do feature detection reliably on many a terminal, which also makes me wondering how the hell are they going to make it reliable, unless they simply decide to not support many terminals.
Re:Notcurses 2.4 by dankamongmen on Wednesday September 08, 2021 @08:06AM (#28455863)
The key is ending the device query string with DA1 aka "Primary Device Attributes", which literally every terminal i've managed to test with responds to. Guaranteed that one answer, you completely avoid nasty timeouts. This is required for even VT100 conformance, so it can be expected on even hardware terminals (though not necessarily those outside the DEC family).

I tested over 24 terminals personally, and the only one I found which didn't respond to DA1 was Terminology from EFL, which crashed forty ways to a friday anyway so who really cares?

i'm glad you asked, as i'm hella proud of this entire system. you can check the code at:

https://github.com/dankamongmen/notcurses/blob/master/src/li...

and

https://github.com/dankamongmen/notcurses/blob/master/src/li...

i mean, it's tricky, and you have to think some things out pretty carefully, but it works. everything hinges on DA1.

many props to @dknl of the "foot" terminal emulator, who just kicks ass in general and first turned me on to DA1:

you can see the history in bugs starting with https://github.com/dankamongmen/notcurses/issues/1469

hack on!

Re:Notcurses 2.4 by setpatchaddress on Monday September 06, 2021 @07:33PM (#28439289)
From the change log:

> Numerous patches were submitted to upstream terminals to support this functionality.

Re:Notcurses 2.4 by lathiat on Tuesday September 07, 2021 @12:53AM (#28441055)
It’s often so easy not to submit these kinds of changes. But 10 years later you still don’t have them.

Seems like a long wait now but is worth it later.

Re:Notcurses 2.4 by yjftsjthsd-h on Monday September 06, 2021 @08:07PM (#28439457)
That's still going to lose the long tail
Re:Notcurses 2.4 by enriquto on Tuesday September 07, 2021 @01:58AM (#28441408)
At some point, the number of people on that tail will be smaller than the number of people with an incorrectly setup $TERM, for a net gain in effective portability.
Re:Notcurses 2.4 by p1necone on Tuesday September 07, 2021 @01:58AM (#28441404)
Sure, then you just fall back to whatever best effort approach you were using before.
Re:Notcurses 2.4 by kjs3 on Monday September 06, 2021 @11:20PM (#28440570)
They won't support that many terminal types. This is what has been done in this situation for decades.