Skip to content

Instantly share code, notes, and snippets.

@saitoha
Created September 19, 2012 13:45
Show Gist options
  • Select an option

  • Save saitoha/3749765 to your computer and use it in GitHub Desktop.

Select an option

Save saitoha/3749765 to your computer and use it in GitHub Desktop.
vim 256 color rendition in TERM=xterm
diff -r 91c52d4cb1be src/term.c
--- a/src/term.c Tue Sep 18 22:00:08 2012 +0200
+++ b/src/term.c Wed Sep 19 22:33:18 2012 +0900
@@ -2712,7 +2712,7 @@
/* Special handling of 16 colors, because termcap can't handle it */
/* Also accept "\e[3%dm" for TERMINFO, it is sometimes used */
/* Also accept CSI instead of <Esc>[ */
- if (n >= 8 && t_colors >= 16
+ if (n >= 8
&& ((s[0] == ESC && s[1] == '[') || (s[0] == CSI && (i = 1) == 1))
&& s[i] != NUL
&& (STRCMP(s + i + 1, "%p1%dm") == 0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment