Upstream ncurses has introduced terminfo capabilities to specify RGB
colour ("true" or "direct" colour). These consist of new entries (such
as "xterm-direct") which have a different setaf/setab implementation,
colors and pairs set to 0x1000000 and 0x10000, and a new RGB flag.

The setaf/setab definitions seem to be geared towards what ncurses (or
emacs maybe) needs, in that the new versions do only ANSI and RGB
colours (they can't be used for the 256 colour palette); they rely on
the silly ISO colon-separated version of SGR; and they use a weird
multiplication scheme so they still only need one argument. The higher
values of colors and pairs require a recent ncurses to parse.

tmux can use the RGB flag to detect RGB colour support (keeping the old
Tc extension for backwards compatibility for now). However, as we still
want to send 256 colour information unchanged when possible, the new
setaf/setab are awkward. So when RGB is present, reserve setaf/setab
only for ANSI colours and use the escape sequences directly for 256 and
RGB colours. (To my knowledge no recent terminal uses unusual escape
sequences for these in any case.)
3 files changed
tree: 8f7e6e63206554274470114f06ee0fce7615bcc4
  1. Makefile
  2. alerts.c
  3. arguments.c
  4. attributes.c
  5. cfg.c
  6. client.c
  7. cmd-attach-session.c
  8. cmd-bind-key.c
  9. cmd-break-pane.c
  10. cmd-capture-pane.c
  11. cmd-choose-tree.c
  12. cmd-command-prompt.c
  13. cmd-confirm-before.c
  14. cmd-copy-mode.c
  15. cmd-detach-client.c
  16. cmd-display-message.c
  17. cmd-display-panes.c
  18. cmd-find-window.c
  19. cmd-find.c
  20. cmd-has-session.c
  21. cmd-if-shell.c
  22. cmd-join-pane.c
  23. cmd-kill-pane.c
  24. cmd-kill-server.c
  25. cmd-kill-session.c
  26. cmd-kill-window.c
  27. cmd-list-buffers.c
  28. cmd-list-clients.c
  29. cmd-list-keys.c
  30. cmd-list-panes.c
  31. cmd-list-sessions.c
  32. cmd-list-windows.c
  33. cmd-list.c
  34. cmd-load-buffer.c
  35. cmd-lock-server.c
  36. cmd-move-window.c
  37. cmd-new-session.c
  38. cmd-new-window.c
  39. cmd-paste-buffer.c
  40. cmd-pipe-pane.c
  41. cmd-queue.c
  42. cmd-refresh-client.c
  43. cmd-rename-session.c
  44. cmd-rename-window.c
  45. cmd-resize-pane.c
  46. cmd-respawn-pane.c
  47. cmd-respawn-window.c
  48. cmd-rotate-window.c
  49. cmd-run-shell.c
  50. cmd-save-buffer.c
  51. cmd-select-layout.c
  52. cmd-select-pane.c
  53. cmd-select-window.c
  54. cmd-send-keys.c
  55. cmd-send-prefix.c
  56. cmd-set-buffer.c
  57. cmd-set-environment.c
  58. cmd-set-hook.c
  59. cmd-set-option.c
  60. cmd-show-buffer.c
  61. cmd-show-environment.c
  62. cmd-show-messages.c
  63. cmd-show-options.c
  64. cmd-source-file.c
  65. cmd-split-window.c
  66. cmd-string.c
  67. cmd-swap-pane.c
  68. cmd-swap-window.c
  69. cmd-switch-client.c
  70. cmd-unbind-key.c
  71. cmd-wait-for.c
  72. cmd.c
  73. colour.c
  74. control-notify.c
  75. control.c
  76. environ.c
  77. format.c
  78. grid-view.c
  79. grid.c
  80. hooks.c
  81. input-keys.c
  82. input.c
  83. job.c
  84. key-bindings.c
  85. key-string.c
  86. layout-custom.c
  87. layout-set.c
  88. layout.c
  89. log.c
  90. mode-key.c
  91. mode-tree.c
  92. names.c
  93. notify.c
  94. options-table.c
  95. options.c
  96. paste.c
  97. proc.c
  98. procname.c
  99. resize.c
  100. screen-redraw.c
  101. screen-write.c
  102. screen.c
  103. server-client.c
  104. server-fn.c
  105. server.c
  106. session.c
  107. status.c
  108. style.c
  109. tmux.1
  110. tmux.c
  111. tmux.h
  112. tty-acs.c
  113. tty-keys.c
  114. tty-term.c
  115. tty.c
  116. utf8.c
  117. window-buffer.c
  118. window-client.c
  119. window-clock.c
  120. window-copy.c
  121. window-tree.c
  122. window.c
  123. xmalloc.c
  124. xmalloc.h
  125. xterm-keys.c