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", "xterm", true);
setenv("TERM", "xterm-color", true);
setenv("TTY", ttyName, true);
setenv("TTYPE", parameters.Encoding(), true);
+15 -8
View File
@@ -833,23 +833,30 @@ TermParse::EscParse()
fAttr = FORECOLORED(7);
break;
case 1: /* Bold */
case 5:
fAttr |= BOLD;
case 1: /* Bright / Bold */
fAttr |= FORECOLORED(8);
fAttr |= FORESET;
break;
case 4: /* Underline */
fAttr |= UNDERLINE;
break;
case 5:
fAttr |= BOLD;
break;
case 7: /* Inverse */
fAttr |= INVERSE;
break;
case 22: /* Not Bold */
fAttr &= ~BOLD;
case 2: /* Faint: decreased intensity */
case 21: /* Bright/Bold: off or Underline: Double */
case 22: /* Not Bold, not bright, not faint */
fAttr &= ~(FORECOLORED(8) | BOLD);
fAttr |= FORESET;
break;
case 24: /* Not Underline */
fAttr &= ~UNDERLINE;
break;
@@ -866,7 +873,7 @@ TermParse::EscParse()
case 35:
case 36:
case 37:
fAttr &= ~FORECOLOR;
fAttr &= ~FORECOLORED(7);
fAttr |= FORECOLORED(param[row] - 30);
fAttr |= FORESET;
break;
@@ -875,7 +882,7 @@ TermParse::EscParse()
{
if (nparam != 3 || param[1] != 5)
break;
fAttr &= ~FORECOLOR;
fAttr &= ~FORECOLORED(255 - 8);
fAttr |= FORECOLORED(param[2]);
fAttr |= FORESET;
+2 -2
View File
@@ -79,14 +79,14 @@ static rgb_color kTermColorTable[256] = {
{ 6, 152, 154, 0}, // cyan
{245, 245, 245, 0}, // white
{128, 128, 128, 0}, // black
{ 64, 64, 64, 0}, // black
{255, 0, 0, 0}, // red
{ 0, 255, 0, 0}, // green
{255, 255, 0, 0}, // yellow
{ 0, 0, 255, 0}, // blue
{255, 0, 255, 0}, // magenta
{ 0, 255, 255, 0}, // cyan
{255, 255, 255, 0}, // white
{128, 128, 128, 0}, // white
{ 0, 0, 0, 0},
{ 0, 0, 51, 0},