For Linux console specifically, there is the console_codes(4) manual page. It lists the sequences inherited from VT102, ECMA-48, DEC, and several private ones.
For example, all sequences starting with ESC [
(shorthand CSI
) are documented under "ECMA-48 CSI sequences"; they also work the same way on all terminals (or don't work at all).
On the other hand, ESC ]
(shorthand OSC
) sequences are private to each terminal, and their documentation in this manpage is scattered in various places; ESC ] P
is described as:
ESC ] OSC (Should be: Operating system command) ESC ] P nrrggbb: set palette, with parameter given in 7 hexadecimal digits after the final P :-(. Here n is the color (0-15), and rrggbb indicates the red/green/blue values (0-255). ESC ] R: reset palette
In other words, the sequence ESC ] P f 767676
makes the 15th color in the pallete to be hexadecimal #767676.