pragatir / shellinabox

Automatically exported from code.google.com/p/shellinabox
Other
0 stars 0 forks source link

unwanted color changes in VT100.js #46

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
The following code in VT100.prototype.updateStyle() doesn't play nicely
with the white-on-black color scheme:

  // Make some readability enhancements. Most notably, disallow identical
  // background and foreground colors.
  if (bg == fg) {
    if ((fg   ^= 8) == 7) {
      fg       = 8;
    }
  }
  // And disallow bright colors on a light-grey background.
  if (bg == 7 && fg >= 8) {
    if ((fg   -= 8) == 7) {
      fg       = 8;
    }
  }

echo "^[[37;1mtest" ends up being displayed with .ansi8 instead of .ansi15
(which is grey instead of white).
Commenting that code out of the function fixes color display.

Original issue reported on code.google.com by dion...@gmail.com on 10 Jan 2010 at 3:34

GoogleCodeExporter commented 9 years ago
In fact this isn't using the default white-on-black.css but the following which
exactly mimics colors used in the default xterm under debian:

#vt100 #scrollable          { color:            #ffffff;
                              background-color: #000000; }
#vt100 #scrollable.inverted { color:            #000000;
                              background-color: #ffffff; }

#vt100 .ansi0               {                 }
#vt100 .ansi1               { color: #cd0000; }
#vt100 .ansi2               { color: #00cd00; }
#vt100 .ansi3               { color: #cdcd00; }
#vt100 .ansi4               { color: #0000ee; }
#vt100 .ansi5               { color: #cd00cd; }
#vt100 .ansi6               { color: #00cdcd; }
#vt100 .ansi7               { color: #e5e5e5; }
#vt100 .ansi8               { color: #7f7f7f; font-weight: bold; }
#vt100 .ansi9               { color: #ff0000; font-weight: bold; }
#vt100 .ansi10              { color: #00ff00; font-weight: bold; }
#vt100 .ansi11              { color: #e8e800; font-weight: bold; }
#vt100 .ansi12              { color: #5c5cff; font-weight: bold; }
#vt100 .ansi13              { color: #ff00ff; font-weight: bold; }
#vt100 .ansi14              { color: #00ffff; font-weight: bold; }
#vt100 .ansi15              { color: #ffffff; font-weight: bold; }

#vt100 .bgAnsi0             { background-color: #000000; }
#vt100 .bgAnsi1             { background-color: #cd0000; }
#vt100 .bgAnsi2             { background-color: #00cd00; }
#vt100 .bgAnsi3             { background-color: #cdcd00; }
#vt100 .bgAnsi4             { background-color: #0000ee; }
#vt100 .bgAnsi5             { background-color: #cd00cd; }
#vt100 .bgAnsi6             { background-color: #00cdcd; }
#vt100 .bgAnsi7             { background-color: #e5e5e5; }
#vt100 .bgAnsi8             { background-color: #7f7f7f; }
#vt100 .bgAnsi9             { background-color: #ff0000; }
#vt100 .bgAnsi10            { background-color: #00ff00; }
#vt100 .bgAnsi11            { background-color: #e8e800; }
#vt100 .bgAnsi12            { background-color: #5c5cff; }
#vt100 .bgAnsi13            { background-color: #ff00ff; }
#vt100 .bgAnsi14            { background-color: #00ffff; }
#vt100 .bgAnsi15            {                            }

Original comment by dion...@gmail.com on 10 Jan 2010 at 3:37