But this isn't true. console_codes is only what the Linux VT console supports.For an example of what it omits: Alternate Screen Buffer support (DECSET 1049). This is common used by full screen apps (e.g. vi, less) to save/restore the contents of the command line screen. xterm supports it; most popular terminal emulators support it; the console_codes man page does not mention it. The Linux VT console did not support it until Linux 7.1 (see https://github.com/torvalds/linux/commit/23743ba64709a9c137c...) and the console_codes man page still hasn't been updated to mention the kernel now supports it.
> And none of them will have documented the OS-specific escapes,
These aren't really "OS-specific". The Linux console defines private sequences of the form CSI Ps ; Ps ] – those aren't specific to Linux, they are specific to the Linux console – you can't assume most Linux terminal emulators support them. They also aren't technically valid per ECMA-48 – the ] terminator was already reserved for the "START DIRECTED STRING" (SDS), which was intended for use with Bidi (e.g. Arabic, Hebrew), although I'm not sure if any terminal supported it; and also, when preceded by a space, the "SELECT ALTERNATIVE PRESENTATION VARIANTS" (SAPV) function, which also relates to Bidi, but also to Indic scripts; few vendors ever implemented either function, but IBM aixterm does partially implement SAPV.
Most terminal emulators (including xterm) instead use OSC (Operating System Command) to implement custom functionality, which would have been a more defensible choice from a standards-compliance perspective, but this feature was added in the 1990s, by developers who likely didn't have a good understanding of ECMA-48. Despite OSC's name, on almost all platforms it isn't implemented by the operating system, it is implemented by the terminal emulator, and so different terminal emulators on the same OS will implement different OSC sequences. (The only exception I am personally aware of is RMX, which uses OSC to do the moral equivalent of the termios IOCTLs under Unix-like systems, and so on RMX an OSC sent by an application is actually interpreted by the tty driver as a command to change its config.)