Skip to content

Feature Request: Support "direct" (24bit) escape sequences #17

@nevans

Description

@nevans

24-bit color RGB escape sequences are also sometimes referred to as "TrueColor"

Example use case: Sometimes logfiles use 24bit RGB color escape sequences to make it easy to identify different entities at a glance e.g. assign different email addresses to different RGB values using a checksum.

...or sometimes people just like to do crazy terminal hacks, e.g:

convert -thumbnail "$(tput cols)" "$image" txt:- |
  awk -F '[)(,:]' '/white/{$9=$10=$11=255}!/^#/{if($2%2){printf"\033[48;2;"pR[$1]";"pG[$1]";"pB[$1]";38;2;"$9";"$10";"$11"m▄"}else{pR[$1]=$9;pG[$1]=$10;pB[$1]=$11}}'
tput sgr0

Either way, supporting the entire RGB color space would be useful. 🙁

The escape sequences used by almost all terminals with 24-bit RGB support are:

ESC[38;2;⟨r⟩;⟨g⟩;⟨b⟩m => Select RGB foreground color
ESC[48;2;⟨r⟩;⟨g⟩;⟨b⟩m => Select RGB background color

E.g. see infocmp tmux-direct | grep seta

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions