Commit 261c571a authored by Committed by Craig Small
watch: Don't process additional numbers in unknown ANSI color escapes
process_ansi assumed all numbers in a color control sequence correspond to colors or attributes, which breaks badly if it encounters a ISO-8613-3 escape sequence (such as for truecolor RGB). For instance, the sequence "\x1b[38;2;10;20;30m" sets the foreground color to rgb(10,20,30), but watch will interpret all five numbers in the sequence as colors or attributes themselves. Stop processing the entire escape sequence if watch encounters any number it doesn't understand, as that number may change the meaning of the rest of the sequence.
Showing with 6 additions and 2 deletions