Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make color escape sequences conform to terminfo entry #5

Merged
merged 1 commit into from May 12, 2014

Conversation

keithw
Copy link
Contributor

@keithw keithw commented May 11, 2014

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` generates
`ESC [ 48;5;179 m ESC [ 38;5;100 m`.

* Olivia5k/doge#48
* mobile-shell/mosh#519
* mobile-shell/mosh#110 (comment)
@rossy
Copy link
Owner

rossy commented May 12, 2014

Looks good. Merging those sequences definitely isn't worth it if it causes incompatibility with mosh. Thanks for the patch.

rossy added a commit that referenced this pull request May 12, 2014
Make color escape sequences conform to terminfo entry
@rossy rossy merged commit e24d136 into rossy:master May 12, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants