Re: blinking 256-color mode

Kalle Olavi Niemitalo <[email protected]>
Newsgroups gmane.comp.web.elinks.user
Message-ID <[email protected]>
Charlie Kester <[email protected]> writes:

> When I set the terminal options to 256-color, everything on the screen
> starts blinking!
>
> I'm using iTerm 0.9.6.1201 on OS X Leopard (10.5.6) and have the
> terminal emulation set as xterm-color.

iTerm apparently requires that the command to choose one color
out of 256 is the only thing in the SGR control sequence.  Try
this untested patch to iTerm.

Index: VT100Terminal.m
===================================================================
--- VT100Terminal.m	(revision 1698)
+++ VT100Terminal.m	(working copy)
@@ -2329,15 +2329,15 @@
 						BG_COLORCODE = DEFAULT_BG_COLOR_CODE;
 						break;
 					case VT100CHARATTR_FG_256:
-						if (token.u.csi.count==3 && i==0 && token.u.csi.p[1]==5) {
-							FG_COLORCODE = token.u.csi.p[2];
-							i =2;
+						if (token.u.csi.count-i >= 3 && token.u.csi.p[i+1]==5) {
+							FG_COLORCODE = token.u.csi.p[i+2];
+							i += 2;
 						}
 						break;
 					case VT100CHARATTR_BG_256:
-						if (token.u.csi.count==3 && i==0 && token.u.csi.p[1]==5) {
-							BG_COLORCODE = token.u.csi.p[2];
-							i=2;
+						if (token.u.csi.count-i >= 3 && token.u.csi.p[i+1]==5) {
+							BG_COLORCODE = token.u.csi.p[i+2];
+							i += 2;
 						}
 						break;
 					default:

Or this untested patch to ELinks.

diff --git a/src/terminal/screen.c b/src/terminal/screen.c
index 8f838a6..eb467b9 100644
--- a/src/terminal/screen.c
+++ b/src/terminal/screen.c
@@ -756,7 +756,7 @@ add_char16(struct string *screen, struct screen_driver *driver,
 
 #if defined(CONFIG_88_COLORS) || defined(CONFIG_256_COLORS)
 static const struct string color256_seqs[] = {
-	/* foreground: */	TERM_STRING("\033[0;38;5;%dm"),
+	/* foreground: */	TERM_STRING("\033[m\033[38;5;%dm"),
 	/* background: */	TERM_STRING("\033[48;5;%dm"),
 };
 
_______________________________________________
elinks-users mailing list
[email protected]
http://linuxfromscratch.org/mailman/listinfo/elinks-users
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.