home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #18 / NN_1992_18.iso / spool / comp / unix / bsd / 4518 < prev    next >
Encoding:
Text File  |  1992-08-20  |  3.2 KB  |  82 lines

  1. Newsgroups: comp.unix.bsd
  2. Path: sparky!uunet!mcsun!sunic!ugle.unit.no!lise.unit.no!arnej
  3. From: arnej@Lise.Unit.NO (Arne Henrik Juul)
  4. Subject: Re: 386bsd: 16550, color, vt100
  5. Message-ID: <1992Aug20.222741.9968@ugle.unit.no>
  6. Sender: news@ugle.unit.no (NetNews Administrator)
  7. Reply-To: arnej@lise.unit.no
  8. Organization: Norwegian Institute of Technology
  9. References: <1992Aug19.195743.13499@engage.pko.dec.com> <sand.714341461@milton>
  10. Date: Thu, 20 Aug 92 22:27:41 GMT
  11. Lines: 69
  12.  
  13. In article <sand.714341461@milton>, sand@milton.u.washington.edu (Derek Upham) writes:
  14.  > eje@irenaeus.mlo.dec.com (Eric James Ewanco) writes:
  15.  > 
  16.  > >Second: Is there any way to change the text color to green? I hate
  17.  > >white.  Will ANSI colors work?
  18.  > 
  19.  > Check out /etc/rc.  It has escape sequences that change the color at
  20.  > boot time.  You should be able to fiddle with them and put something
  21.  > in /etc/rc.local.
  22.  
  23. You can do it from the command line. Use Cntrl-V ESC to insert a literal
  24. escape (echoed as  ^{ ).
  25.  
  26. % echo '^{[3;30x'      -> yellow foreground, blue background                
  27. % echo '^{[14;1r'        -> set standout mode to yellow foreground,
  28.                           blue background 
  29.  
  30. The sequence:   ESC [ 3 ; <number> x
  31. means: set the PC color mode to <number>, where <number> will be used
  32. in this way:
  33.  
  34. |   7   |   6   |   5   |   4   |   3   |   2   |   1   |   0   |
  35. | blink |      background       |bright |      foreground       |
  36. | (fg)  |         color         | (fg)  |         color         |
  37.  
  38.  
  39.  
  40. Colors:
  41.  
  42.  black      0       0       0               0       0       0   |    0, 0
  43.  blue       0       0       1               0       0       1   |   16, 1
  44.  green      0       1       0               0       1       0   |   32, 2
  45.  cyan       0       1       1               0       1       1   |   48, 3
  46.  red        1       0       0               1       0       0   |   64, 4
  47.  magenta    1       0       1               1       0       1   |   80, 5
  48.  brown      1       1       0               1       1       0   |   96, 6
  49.  white      1       1       1               1       1       1   |  112, 7
  50.  
  51.  gray                               1       0       0       0   |       8
  52.  light blue                         1       0       0       1   |       9
  53.  light green                        1       0       1       0   |      10
  54.  light cyan                         1       0       1       1   |      11
  55.  ligth red                          1       1       0       0   |      12
  56.  ligth magenta                      1       1       0       1   |      13
  57.  yellow                             1       1       1       0   |      14
  58.  bright white                       1       1       1       1   |      15
  59.  
  60.  
  61.  
  62. So, for example, blinking yellow foreground on brown background is:
  63. 128 (blink) + 14 (yellow foreground) + 96 (brown backgroun) = 238
  64.  
  65.  
  66. The standout mode works another way: Here, the foreground is given
  67. first (as a number from 0-15) followed by background as another number
  68. from 0-15. The same color combination would be:
  69.  
  70.  fg = 14
  71.  bg = (128 + 96) >> 4 = 14
  72.  
  73. So you would use "ESC [ 14 ; 14 r".
  74.  
  75.  
  76. OK, I hope this was understandable for everyone, it was mostly found
  77. with hit-and-miss tactics :-)
  78.  
  79.  
  80. --
  81. Arne H. Juul  --  arnej@lise.unit.no  --  University of Trondheim, Norway
  82.