3 ms·
> The terminal is now extensively (but efficiently) queried on startup. Some properties are derived from the results. > Eventually, this will be expanded to e
by yjftsjthsd-h 5y ago
> 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?)
- p_l 5y agoSimple 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.
- setpatchaddress 5y agoFrom the change log: > Numerous patches were submitted to upstream terminals to support this functionality.
- yjftsjthsd-h 5y agoThat's still going to lose the long tail
- lathiat 5y agoIt’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.
- kjs3 5y agoThey won't support that many terminal types. This is what has been done in this situation for decades.
- dankamongmen 5y agoThe 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/lib/termdesc.c#L281-L410 https://github.com/dankamongmen/notcurses/blob/master/src/li... and https://github.com/dankamongmen/notcurses/blob/master/src/lib/input.c#L1157-L1808 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 https://github.com/dankamongmen/notcurses/issues/1469 hack on!