diff -ur mlterm-2.9.4/mlterm/ml_char.c mlterm-2.9.4_256/mlterm/ml_char.c
--- mlterm-2.9.4/mlterm/ml_char.c	2005-10-13 13:54:35.000000000 +0900
+++ mlterm-2.9.4_256/mlterm/ml_char.c	2008-03-12 23:10:46.000000000 +0900
@@ -34,22 +34,30 @@
  * ML_BLACK - ML_WHITE: as they are
  * ML_FG_COLOR        : 0x8
  * ML_BG_COLOR        : 0x9
+ * 256 color          : 0xa
  */
 #define  INTERN_COLOR(color) \
 	((color) = ((color) == ML_FG_COLOR ? 0x8 : \
-		(color) == ML_BG_COLOR ? 0x9 : (color) & ~ML_BOLD_COLOR_MASK))
+		(color) == ML_BG_COLOR ? 0x9 : \
+				(color) >= MIN_CUBE_COLORS ? 0xa :	\
+				(color) & ~ML_BOLD_COLOR_MASK))
 
-#define  IS_VALID_INTERN_COLOR(color) ((ML_BLACK <=color) && (color <=0x9))
+#define  IS_VALID_INTERN_COLOR(color) ((ML_BLACK <=color) && (color <=0xa))
 
 #define  EXTERN_COLOR(color) \
 	((color) = ((color) == 0x8 ? ML_FG_COLOR : \
 		(color) == 0x9 ? ML_BG_COLOR : (color)))
 
-#define  FG_COLOR(attr)  (((attr) >> 11) & 0xf)
+#define  FG_INTERN_COLOR(comb)  (((comb->u.ch.attr) >> 11) & 0xf)
+
+#define  FG_COLOR(comb) \
+	FG_INTERN_COLOR(comb) == 0xa ? comb->u.ch.fg_color : FG_INTERN_COLOR(comb)
 
 #define  SET_FG_COLOR(attr,color)  ((attr) = (((attr) & 0xffff87ff) | ((color) << 11)))
 
-#define  BG_COLOR(attr)  (((attr) >> 7) & 0xf)
+#define  BG_INTERN_COLOR(comb)  (((comb->u.ch.attr) >> 7) & 0xf)
+#define  BG_COLOR(comb) \
+	BG_INTERN_COLOR(comb) == 0xa ? comb->u.ch.bg_color : BG_INTERN_COLOR(comb)
 
 #define  SET_BG_COLOR(attr,color)  ((attr) = (((attr) & 0xfffff87f) | ((color) << 7)))
 
@@ -172,8 +180,15 @@
 
 	memcpy( ch->u.ch.bytes , bytes , size) ;
 	memset( ch->u.ch.bytes + size , 0 , MAX_CHAR_SIZE - size) ;
-
+	if ( fg_color >= MIN_CUBE_COLORS)
+	{
+		ch->u.ch.fg_color = fg_color;
+	}
 	INTERN_COLOR(fg_color) ;
+	if ( bg_color >= MIN_CUBE_COLORS)
+	{
+		ch->u.ch.bg_color = bg_color;
+	}
 	INTERN_COLOR(bg_color) ;
 
 #ifdef  DEBUG
@@ -318,7 +333,7 @@
 	return  ml_char_combine( ch , ml_char_bytes( comb) , SIZE(comb->u.ch.attr) ,
 			CHARSET(comb->u.ch.attr) ,
 			IS_BIWIDTH(comb->u.ch.attr) , IS_COMB(comb->u.ch.attr) ,
-			FG_COLOR(comb->u.ch.attr) , BG_COLOR(comb->u.ch.attr) ,
+			FG_COLOR(comb) , BG_COLOR(comb) ,
 			IS_BOLD(comb->u.ch.attr) , IS_UNDERLINED(comb->u.ch.attr)) ;
 }
 
@@ -571,11 +586,11 @@
 
 		if( IS_REVERSED(ch->u.ch.attr))
 		{
-			color = BG_COLOR(ch->u.ch.attr) ;
+			color = BG_COLOR(ch) ;
 		}
 		else
 		{
-			color = FG_COLOR(ch->u.ch.attr) ;
+			color = FG_COLOR(ch) ;
 		}
 
 		EXTERN_COLOR(color) ;
@@ -601,6 +616,10 @@
 {
 	if( IS_SINGLE_CH(ch->u.ch.attr))
 	{
+		if ( color >= MIN_CUBE_COLORS)
+		{
+			ch->u.ch.fg_color = color;
+		}
 		INTERN_COLOR(color) ;
 
 		SET_FG_COLOR(ch->u.ch.attr,color) ;
@@ -631,11 +650,11 @@
 
 		if( IS_REVERSED(ch->u.ch.attr))
 		{
-			color = FG_COLOR(ch->u.ch.attr) ;
+			color = FG_COLOR(ch) ;
 		}
 		else
 		{
-			color = BG_COLOR(ch->u.ch.attr) ;
+			color = BG_COLOR(ch) ;
 		}
 
 		EXTERN_COLOR(color) ;
@@ -656,6 +675,10 @@
 {
 	if( IS_SINGLE_CH(ch->u.ch.attr))
 	{
+		if ( color >= MIN_CUBE_COLORS)
+		{
+			ch->u.ch.bg_color = color;
+		}
 		INTERN_COLOR(color) ;
 
 		SET_BG_COLOR(ch->u.ch.attr,color) ;
diff -ur mlterm-2.9.4/mlterm/ml_char.h mlterm-2.9.4_256/mlterm/ml_char.h
--- mlterm-2.9.4/mlterm/ml_char.h	2005-02-05 02:51:23.000000000 +0900
+++ mlterm-2.9.4_256/mlterm/ml_char.h	2008-03-12 23:52:00.000000000 +0900
@@ -37,6 +37,8 @@
 		struct
 		{
 		#ifdef  WORDS_BIGENDIAN
+			u_char fg_color;
+			u_char bg_color;
 			/* 32 bit */
 			u_char  bytes[MAX_CHAR_SIZE] ;
 			
@@ -60,6 +62,8 @@
 		#else
 			u_int32_t  attr ;
 			u_char  bytes[MAX_CHAR_SIZE] ;
+			u_char bg_color;
+			u_char fg_color;
 		#endif
 		} ch ;
 
diff -ur mlterm-2.9.4/mlterm/ml_color.c mlterm-2.9.4_256/mlterm/ml_color.c
--- mlterm-2.9.4/mlterm/ml_color.c	2002-05-30 21:51:53.000000000 +0900
+++ mlterm-2.9.4_256/mlterm/ml_color.c	2008-03-12 23:06:28.000000000 +0900
@@ -38,3 +38,278 @@
 		return  NULL ;
 	}
 }
+
+static u_short ml_256_colors[][3] = {
+	{ 0x00, 0x00, 0x00 },
+	{ 0x00, 0x00, 0x5f },
+	{ 0x00, 0x00, 0x87 },
+	{ 0x00, 0x00, 0xaf },
+	{ 0x00, 0x00, 0xd7 },
+	{ 0x00, 0x00, 0xff },
+	{ 0x00, 0x5f, 0x00 },
+	{ 0x00, 0x5f, 0x5f },
+	{ 0x00, 0x5f, 0x87 },
+	{ 0x00, 0x5f, 0xaf },
+	{ 0x00, 0x5f, 0xd7 },
+	{ 0x00, 0x5f, 0xff },
+	{ 0x00, 0x87, 0x00 },
+	{ 0x00, 0x87, 0x5f },
+	{ 0x00, 0x87, 0x87 },
+	{ 0x00, 0x87, 0xaf },
+	{ 0x00,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, 0x87 },
+	{ 0x5f, 0xd7, 0xaf },
+	{ 0x5f, 0xd7, 0xd7 },
+	{ 0x5f, 0xd7, 0xff },
+	{ 0x5f, 0xff, 0x00 },
+	{ 0x5f, 0xff, 0x5f },
+	{ 0x5f, 0xff, 0x87 },
+	{ 0x5f, 0xff, 0xaf },
+	{ 0x5f, 0xff, 0xd7 },
+	{ 0x5f, 0xff, 0xff },
+	{ 0x87, 0x00, 0x00 },
+	{ 0x87, 0x00, 0x5f },
+	{ 0x87, 0x00, 0x87 },
+	{ 0x87, 0x00, 0xaf },
+	{ 0x87, 0x00, 0xd7 },
+	{ 0x87, 0x00, 0xff },
+	{ 0x87, 0x5f, 0x00 },
+	{ 0x87, 0x5f, 0x5f },
+	{ 0x87, 0x5f, 0x87 },
+	{ 0x87, 0x5f, 0xaf },
+	{ 0x87, 0x5f, 0xd7 },
+	{ 0x87, 0x5f, 0xff },
+	{ 0x87, 0x87, 0x00 },
+	{ 0x87, 0x87, 0x5f },
+	{ 0x87, 0x87, 0x87 },
+	{ 0x87, 0x87, 0xaf },
+	{ 0x87, 0x87, 0xd7 },
+	{ 0x87, 0x87, 0xff },
+	{ 0x87, 0xaf, 0x00 },
+	{ 0x87, 0xaf, 0x5f },
+	{ 0x87, 0xaf, 0x87 },
+	{ 0x87, 0xaf, 0xaf },
+	{ 0x87, 0xaf, 0xd7 },
+	{ 0x87, 0xaf, 0xff },
+	{ 0x87, 0xd7, 0x00 },
+	{ 0x87, 0xd7, 0x5f },
+	{ 0x87, 0xd7, 0x87 },
+	{ 0x87, 0xd7, 0xaf },
+	{ 0x87, 0xd7, 0xd7 },
+	{ 0x87, 0xd7, 0xff },
+	{ 0x87, 0xff, 0x00 },
+	{ 0x87, 0xff, 0x5f },
+	{ 0x87, 0xff, 0x87 },
+	{ 0x87, 0xff, 0xaf },
+	{ 0x87, 0xff, 0xd7 },
+	{ 0x87, 0xff, 0xff },
+	{ 0xaf, 0x00, 0x00 },
+	{ 0xaf, 0x00, 0x5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f },
+	{ 0xff, 0xaf, 0xd7 },
+	{ 0xff, 0xaf, 0xff },
+	{ 0xff, 0xd7, 0x00 },
+	{ 0xff, 0xd7, 0x5f },
+	{ 0xff, 0xd7, 0x87 },
+	{ 0xff, 0xd7, 0xaf },
+	{ 0xff, 0xd7, 0xd7 },
+	{ 0xff, 0xd7, 0xff },
+	{ 0xff, 0xff, 0x00 },
+	{ 0xff, 0xff, 0x5f },
+	{ 0xff, 0xff, 0x87 },
+	{ 0xff, 0xff, 0xaf },
+	{ 0xff, 0xff, 0xd7 },
+	{ 0xff, 0xff, 0xff },
+	{ 0x08, 0x08, 0x08 },
+	{ 0x12, 0x12, 0x12 },
+	{ 0x1c, 0x1c, 0x1c },
+	{ 0x26, 0x26, 0x26 },
+	{ 0x30, 0x30, 0x30 },
+	{ 0x3a, 0x3a, 0x3a },
+	{ 0x44, 0x44, 0x44 },
+	{ 0x4e, 0x4e, 0x4e },
+	{ 0x58, 0x58, 0x58 },
+	{ 0x62, 0x62, 0x62 },
+	{ 0x6c, 0x6c, 0x6c },
+	{ 0x76, 0x76, 0x76 },
+	{ 0x80, 0x80, 0x80 },
+	{ 0x8a, 0x8a, 0x8a },
+	{ 0x94, 0x94, 0x94 },
+	{ 0x9e, 0x9e, 0x9e },
+	{ 0xa8, 0xa8, 0xa8 },
+	{ 0xb2, 0xb2, 0xb2 },
+	{ 0xbc, 0xbc, 0xbc },
+	{ 0xc6, 0xc6, 0xc6 },
+	{ 0xd0, 0xd0, 0xd0 },
+	{ 0xda, 0xda, 0xda },
+	{ 0xe4, 0xe4, 0xe4 },
+	{ 0xee, 0xee, 0xee },
+};
+
+int  ml_get_256_color(
+	ml_color_t  color,
+	u_short *  red,
+	u_short *  green,
+	u_short *  blue)
+{
+	if ( color < MIN_CUBE_COLORS || color >= MAX_VT_COLORS)
+	{
+		return 0;
+	}
+	*red = ml_256_colors[color - MIN_CUBE_COLORS][0];
+	*green = ml_256_colors[color - MIN_CUBE_COLORS][1];
+	*blue = ml_256_colors[color - MIN_CUBE_COLORS][2];
+	return 1;
+}
+
+int  ml_change_256_color(
+	ml_color_t  color,
+	u_short  red,
+	u_short  green,
+	u_short  blue)
+{
+	if ( color < MIN_CUBE_COLORS || color >= MAX_VT_COLORS)
+	{
+		return 0;
+	}
+	ml_256_colors[color - MIN_CUBE_COLORS][0] = red;
+	ml_256_colors[color - MIN_CUBE_COLORS][1] = green;
+	ml_256_colors[color - MIN_CUBE_COLORS][2] = blue;
+	return 1;
+}
diff -ur mlterm-2.9.4/mlterm/ml_color.h mlterm-2.9.4_256/mlterm/ml_color.h
--- mlterm-2.9.4/mlterm/ml_color.h	2004-12-07 12:37:00.000000000 +0900
+++ mlterm-2.9.4_256/mlterm/ml_color.h	2008-03-12 22:43:48.000000000 +0900
@@ -6,9 +6,14 @@
 #define  __ML_COLOR_H__
 
 
-#define  MAX_COLORS     18
-#define  MAX_VT_COLORS  16
+#include  <kiklib/kik_types.h>		/* u_short */
+
+
+#define  MAX_COLORS     0x102
+#define  MAX_VT_COLORS  0x100
 #define  MAX_BASIC_VT_COLORS  8
+#define  MIN_CUBE_COLORS 0x10
+#define  MIN_GRAY_COLORS 0xe8
 
 
 typedef enum  ml_color
@@ -25,14 +30,18 @@
 	ML_WHITE = 0x7 ,
 
 	ML_BOLD_COLOR_MASK = 0x8 ,
-	
-	ML_FG_COLOR = 0x10 ,
-	ML_BG_COLOR = 0x11
+
+	ML_FG_COLOR = 0x100 ,
+	ML_BG_COLOR = 0x101
 
 } ml_color_t ;
 
 
 char *  ml_get_color_name( ml_color_t  color) ;
 
+int  ml_get_256_color( ml_color_t  color, u_short *  red, u_short *  green, u_short *  blue);
+
+int  ml_change_256_color( ml_color_t  color, u_short  red, u_short  green, u_short  blue);
+
 
 #endif
diff -ur mlterm-2.9.4/mlterm/ml_vt100_parser.c mlterm-2.9.4_256/mlterm/ml_vt100_parser.c
--- mlterm-2.9.4/mlterm/ml_vt100_parser.c	2006-10-24 19:11:04.000000000 +0900
+++ mlterm-2.9.4_256/mlterm/ml_vt100_parser.c	2008-03-12 23:05:00.000000000 +0900
@@ -535,6 +535,24 @@
  */
 
 static void
+change_char_attr_fg_color(
+	ml_vt100_parser_t *  vt100_parser ,
+	int  fg_color
+	)
+{
+	vt100_parser->fg_color = fg_color ;
+}
+
+static void
+change_char_attr_bg_color(
+	ml_vt100_parser_t *  vt100_parser ,
+	int  bg_color
+	)
+{
+	vt100_parser->bg_color = bg_color ;
+}
+
+static void
 change_char_attr(
 	ml_vt100_parser_t *  vt100_parser ,
 	int  flag
@@ -956,6 +974,22 @@
 }
 
 static int
+parse_vt100_change_color(
+	ml_vt100_parser_t *  vt100_parser,
+	u_char *  pt)
+{
+	int color;
+	int red, green, blue;
+	if( sscanf( (char *)pt , "%d;rgb:%x/%x/%x" , &color , &red , &green , &blue))
+	{
+		//printf("change color %d %d %d %d\n", red, green, blue);
+		//return ml_change_256_color( color , red , green , blue) ;
+		return 1;
+	}
+	return 0;
+}
+
+static int
 parse_vt100_escape_sequence(
 	ml_vt100_parser_t *  vt100_parser
 	)
@@ -1904,10 +1938,30 @@
 							ps[0] = 0 ;
 							num = 1 ;
 						}
-
-						for( count = 0 ; count < num ; count ++)
+						if (ps[0] == 38 && ps[1] == 5)
 						{
-							change_char_attr( vt100_parser , ps[count]) ;
+							if (num >= 3) {
+								for (count = 2; count < num; count ++)
+								{
+									change_char_attr_fg_color( vt100_parser , ps[count] );
+								}
+							}
+						}
+						else if (ps[0] == 48 && ps[1] == 5)
+						{
+							if (num >= 3) {
+								for (count = 2; count < num; count ++)
+								{
+									change_char_attr_bg_color( vt100_parser , ps[count] );
+								}
+							}
+						}
+						else
+						{
+							for( count = 0 ; count < num ; count ++)
+							{
+								change_char_attr( vt100_parser , ps[count]) ;
+							}
 						}
 					}
 					else if( *str_p == 'n')
@@ -1991,6 +2045,7 @@
 				int  count ;
 				int  ps ;
 				u_char *  pt ;
+				u_char  prev_ch = 0;
 
 				if( inc_str_in_esc_seq( vt100_parser->screen , &str_p , &left , 0) == 0)
 				{
@@ -2023,8 +2078,11 @@
 					}
 					
 					pt = str_p ;
-					while( *str_p != CTLKEY_BEL)
+					/* OSC is terminated by BEL or ST (ESC \) */
+					while( *str_p != CTLKEY_BEL &&
+						   ( prev_ch != CTLKEY_ESC || *str_p != '\\'))
 					{
+						prev_ch = *str_p;
 						if( *str_p == CTLKEY_LF)
 						{
 							/* stop to parse as escape seq. */
@@ -2038,6 +2096,10 @@
 						}
 					}
 
+					if ( *str_p == '\\')
+					{
+						*(str_p - 1) = '\0';
+					}
 					*str_p = '\0' ;
 
 					if( ps == 0)
@@ -2084,6 +2146,16 @@
 							start_vt100_cmd( vt100_parser) ;
 						}
 					}
+					else if( ps == 4)
+					{
+						/* change color */
+						if( !parse_vt100_change_color( vt100_parser, pt))
+						{
+						#ifdef DEBUG
+							kik_warn_printf( KIK_DEBUG_TAG " change color failed.\n");
+						#endif
+						}
+					}
 					else if( ps == 20)
 					{
 						if( HAS_CONFIG_LISTENER(vt100_parser,set))
diff -ur mlterm-2.9.4/xwindow/x_color_manager.c mlterm-2.9.4_256/xwindow/x_color_manager.c
--- mlterm-2.9.4/xwindow/x_color_manager.c	2005-01-23 01:34:16.000000000 +0900
+++ mlterm-2.9.4_256/xwindow/x_color_manager.c	2008-03-12 23:51:45.000000000 +0900
@@ -305,6 +305,21 @@
 	{
 		name = color_man->bg_color ;
 	}
+	else if( color >= MIN_CUBE_COLORS)
+	{
+		if( ml_get_256_color( color , &red , &green , &blue))
+		{
+			red *= 256;
+			green *= 256;
+			blue *= 256;
+			if( x_load_rgb_xcolor( color_man->display , color_man->screen ,
+				&color_man->xcolors[color] , red , green , blue))
+			{
+				goto  found ;
+			}
+		}
+		goto  not_found ;
+	}
 	else if( ( name = ml_get_color_name( color)) == NULL)
 	{
 		goto  not_found ;
