img2xterm had been combining multiple 256color rendition changes in the
same SGR sequence, e.g., ESC [ 48;5;179; 38;5;100 m to change both the
background and foreground color.
The xterm-256color terminfo entry requires (and mosh enforces) that
these be in separate escapes. This commit makes the img2xterm output
render correctly in mosh.
Example: echo -e "setab 179\nsetaf 100" | tput -S | od -c generates
ESC [ 48;5;179 m ESC [ 38;5;100 m.
img2xterm had been combining multiple 256color rendition changes in the same SGR sequence, e.g.,
ESC [ 48;5;179; 38;5;100 m
to change both the background and foreground color.The xterm-256color terminfo entry requires (and mosh enforces) that these be in separate escapes. This commit makes the img2xterm output render correctly in mosh.
Example:
echo -e "setab 179\nsetaf 100" | tput -S | od -c
generatesESC [ 48;5;179 m ESC [ 38;5;100 m
.