Merge changes from Fonzoterm :

- Report the terminal as xterm-color instead of just xterm, since we handle that fine.
 - Tweak the SGR handler a bit to use bright rather than bold in some cases
 - Change the color palette so the result is still readable (white on white doesn't work so well) with the default colorscheme.
This commit is contained in:
Adrien Destugues
2013-01-09 19:56:26 +01:00
parent 713f1b8c05
commit 2b67e9a3a7
3 changed files with 18 additions and 11 deletions
+1 -1
View File
@@ -539,7 +539,7 @@ Shell::_Spawn(int row, int col, const ShellParameters& parameters)
/* /*
* setenv TERM and TTY. * setenv TERM and TTY.
*/ */
setenv("TERM", "xterm", true); setenv("TERM", "xterm-color", true);
setenv("TTY", ttyName, true); setenv("TTY", ttyName, true);
setenv("TTYPE", parameters.Encoding(), true); setenv("TTYPE", parameters.Encoding(), true);
+15 -8
View File
@@ -833,23 +833,30 @@ TermParse::EscParse()
fAttr = FORECOLORED(7); fAttr = FORECOLORED(7);
break; break;
case 1: /* Bold */ case 1: /* Bright / Bold */
case 5: fAttr |= FORECOLORED(8);
fAttr |= BOLD; fAttr |= FORESET;
break; break;
case 4: /* Underline */ case 4: /* Underline */
fAttr |= UNDERLINE; fAttr |= UNDERLINE;
break; break;
case 5:
fAttr |= BOLD;
break;
case 7: /* Inverse */ case 7: /* Inverse */
fAttr |= INVERSE; fAttr |= INVERSE;
break; break;
case 22: /* Not Bold */ case 2: /* Faint: decreased intensity */
fAttr &= ~BOLD; case 21: /* Bright/Bold: off or Underline: Double */
case 22: /* Not Bold, not bright, not faint */
fAttr &= ~(FORECOLORED(8) | BOLD);
fAttr |= FORESET;
break; break;
case 24: /* Not Underline */ case 24: /* Not Underline */
fAttr &= ~UNDERLINE; fAttr &= ~UNDERLINE;
break; break;
@@ -866,7 +873,7 @@ TermParse::EscParse()
case 35: case 35:
case 36: case 36:
case 37: case 37:
fAttr &= ~FORECOLOR; fAttr &= ~FORECOLORED(7);
fAttr |= FORECOLORED(param[row] - 30); fAttr |= FORECOLORED(param[row] - 30);
fAttr |= FORESET; fAttr |= FORESET;
break; break;
@@ -875,7 +882,7 @@ TermParse::EscParse()
{ {
if (nparam != 3 || param[1] != 5) if (nparam != 3 || param[1] != 5)
break; break;
fAttr &= ~FORECOLOR; fAttr &= ~FORECOLORED(255 - 8);
fAttr |= FORECOLORED(param[2]); fAttr |= FORECOLORED(param[2]);
fAttr |= FORESET; fAttr |= FORESET;
+2 -2
View File
@@ -79,14 +79,14 @@ static rgb_color kTermColorTable[256] = {
{ 6, 152, 154, 0}, // cyan { 6, 152, 154, 0}, // cyan
{245, 245, 245, 0}, // white {245, 245, 245, 0}, // white
{128, 128, 128, 0}, // black { 64, 64, 64, 0}, // black
{255, 0, 0, 0}, // red {255, 0, 0, 0}, // red
{ 0, 255, 0, 0}, // green { 0, 255, 0, 0}, // green
{255, 255, 0, 0}, // yellow {255, 255, 0, 0}, // yellow
{ 0, 0, 255, 0}, // blue { 0, 0, 255, 0}, // blue
{255, 0, 255, 0}, // magenta {255, 0, 255, 0}, // magenta
{ 0, 255, 255, 0}, // cyan { 0, 255, 255, 0}, // cyan
{255, 255, 255, 0}, // white {128, 128, 128, 0}, // white
{ 0, 0, 0, 0}, { 0, 0, 0, 0},
{ 0, 0, 51, 0}, { 0, 0, 51, 0},