XTGETTCAP is getting some momentum. Besides XTerm, it's implemented
(to varying degrees) by kitty, foot, contour and ghostty.
Specifically, I use it for checking if the terminal supports the
scroll-forward command -- the one called either of parm_index, indn
or SF. So I use something like this to query for "indn":
printf '\eP+q696e646e\e\\'
However XTerm does not support string capabilites.
Would it be reasonable to add this?
Some of the other terminals do.
Interestingly, they don't agree on the exact response format:
foot
\eP1+r696e646e=1B5B257031256453\e\\
decoded: indn="\e[%p1%dS"
kitty
\eP1+r696e646e=5c455b257031256453\e\\
decoded: indn="\\E[%p1%dS"
So far I haven't had a need to respect the string value returned.
Hence I've been ignoring it, and simply treated any successful
response as if scroll-forward is supported and assumed I can use a
hardcoded \e[%p1%dS.
Note that the foot variant requires clients to parse DCS sequences
correctly because it contains a literal escape byte, which might
be misinterpreted as start of a sequence terminator.