+# Emacs 26.1 and later support direct color mode in terminals, using a
+# combination of user-defined capabilities and ncurses-dependent function
+# calls. We will not include that here.
+#
+# Here is a first revision, which (disregarding the reuse of colors 1-7 which
+# is of interest only to the numerically illiterate), is compatible with other
+# terminal descriptions written for curses. It relies upon the extended range
+# for numeric capabilities provided in ncurses 6.1:
+xterm+direct2|xterm with direct-color indexing,
+ RGB,
+ colors#0x1000000, pairs#0x10000,
+ initc@, op=\E[39;49m,
+ setab=\E[%?%p1%{8}%<%t4%p1%d%e48\:2\:%p1%{65536}%/%d\:%p1
+ %{256}%/%{255}%&%d\:%p1%{255}%&%d%;m,
+ setaf=\E[%?%p1%{8}%<%t3%p1%d%e38\:2\:%p1%{65536}%/%d\:%p1
+ %{256}%/%{255}%&%d\:%p1%{255}%&%d%;m,
+ setb@, setf@,
+xterm-direct2|xterm with direct-color indexing (old),
+ use=xterm+direct2, use=xterm+titlestack, use=xterm,
+
+# That in turn had a problem: in the original patch submitted for KDE konsole
+# in 2006, the submitter and the developer alike overlooked a "color space
+# identifier" parameter. This version provides for that parameter:
+xterm+direct|xterm with direct-color indexing,
+ RGB,
+ colors#0x1000000, pairs#0x10000,
+ initc@, op=\E[39;49m,
+ setab=\E[%?%p1%{8}%<%t4%p1%d%e48\:2\:\:%p1%{65536}%/%d\:%p1
+ %{256}%/%{255}%&%d\:%p1%{255}%&%d%;m,
+ setaf=\E[%?%p1%{8}%<%t3%p1%d%e38\:2\:\:%p1%{65536}%/%d\:%p1
+ %{256}%/%{255}%&%d\:%p1%{255}%&%d%;m,
+ setb@, setf@,
+xterm-direct|xterm with direct-color indexing,
+ use=xterm+direct, use=xterm,
+
+# Here are corresponding flavors for terminals which could use the feature:
+iterm2-direct|iTerm2 with direct-color indexing,
+ use=xterm+direct, use=iterm2,
+mlterm-direct|mlterm with direct-color indexing,
+ use=xterm+direct, use=mlterm,
+
+# Meanwhile, in KDE #107487, the patch submitter and the developer both saw
+# that xterm's original implementation should have used colons for the
+# subparameter separators, but chose not to correct this in konsole. As of
+# late 2017, konsole still accepts only the nonstandard semicolon delimiters.
+xterm+indirect|xterm with direct-color indexing (old),
+ RGB,
+ colors#0x1000000, pairs#0x10000,
+ initc@, op=\E[39;49m,
+ setab=\E[%?%p1%{8}%<%t4%p1%d%e48;2;%p1%{65536}%/%d;%p1%{256}
+ %/%{255}%&%d;%p1%{255}%&%d%;m,
+ setaf=\E[%?%p1%{8}%<%t3%p1%d%e38;2;%p1%{65536}%/%d;%p1%{256}
+ %/%{255}%&%d;%p1%{255}%&%d%;m,
+ setb@, setf@,
+konsole-direct|konsole with direct-color indexing,
+ use=xterm+indirect, use=konsole,
+st-direct|st with direct-color indexing,
+ use=xterm+indirect, use=st,
+vte-direct|vte with direct-color indexing,
+ use=xterm+indirect, use=vte,
+
+# As for others:
+# + Apple's Terminal.app does not recognize either form of the direct-color
+# sequences.
+# + Cygwin's mintty recognizes xterm's original implementation, does okay with
+# the colors. Like vte, it is a subset of xterm, although different
+# omissions/reservations of modified-keys are seen in testing.
+# + PuTTY 0.70 seems to recognize xterm's original implementation but does
+# nothing useful with the colors.
+# + Teraterm 4.97, like PuTTY (no good).
+# + terminology 0.91 recognizes xterm's original implementation, but does
+# nothing useful with it.
+
+#### XTERM Features
+