I'm responding to all the messages so far in one email to keep the volume down:
> Support for bidi reordering seems to be missing.
This is a very good suggestion. Added.
> The "emacs" column seems to be empty, is that on purpose?
The purpose of this thread is to add some checkmarks there.
> I think more that "which capabilities should be reported", I'd first focus on a standard way to enable/disable and query (both presence and activation status) capabilities.
> E.g. it should be safe to enable or disable *any* capability, supported or not.
Creating a standard set of extensions to DECSET and DECRQM is interesting, and something I'd like to explore, but it's orthogonal to the goals of this project. I really want to stay focused because there's already been a year of bikeshedding leading up to this point. I'm laser focused on shipping something useful to start mitigating the brokenness of $TERM.
> From where I stand, environment variables are the last resort since they
may get lost along the way or may be inherited unwittingly from elsewhere.
Yeah, they're not ideal. It's a useful optimization for something like a shell script. I expect a full fledged program like emacs would use a control sequence requesting a feature report. It's slower than an environment variable but at least it's accurate.
> Using an environment variable might be fine so long as it's *one* environment variable, minimizing the pain of transition. But there are zillions of scripts and daemons out there that special-case TERM. (For example, sudo often puts TERM on an environment variable preservation whitelist.) It'd probably be easier to make a new special TERM variable that means "I support introspection and also speak xtermeese".
terminfo is useful as a baseline, but it's impossible to propagate changes in a timely manner. The goal of my project is to fill in the gaps that terminfo leaves, so you can adopt this new info gradually to get wins where it's available. I expect it would be one variable. Something like TERM_FEATURES="xxx" where xxx is a compact encoding of the feature flags. Advertising that you support introspection is a chicken-and-egg problem. I expect the best option is to request a feature report and then send CSI c (or some other reporting control sequence), and see if you get one report back or two.