Changeset 2864


Ignore:
Timestamp:
Feb 15, 2012, 1:27:00 AM (3 years ago)
Author:
quozl
Message:

Terminal Emulator - reset colour on <ESC>[m, adopt ECMA-48 SGR semantics, as used by VT100, Linux console, xterm, and other emulators.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • ofw/termemu/fwritstr.fth

    r1 r2864  
    256256headerless
    257257
    258 \ Boldness applies retroactively only to the foreground color; the
    259 \ current background color is unaffected.  However, setting the
    260 \ background color applies the current boldness state of the foreground
    261 \ color to the background color.  This gives a client program complete
    262 \ and independent control over the boldness of both the foreground and
    263 \ background colors (by judiciously sequencing the setting of colors
    264 \ and boldness), and preserves as much as practical the semi-IBM-PC
    265 \ semantics that ARC clients assume.  The semantics are not exactly the
    266 \ same as the PC, because the PC (actually ANSI.SYS) zaps the colors
    267 \ to dim white on black in response to CSI 0 m, and to black on dim
    268 \ white in response to CSI 7 m, while some ARC clients (in particular
    269 \ ARCINST.EXE) assume that CSI 0 m preserves the fundamental color scheme
    270 \ that is currently in effect.  Convoluted?  You bet!
    271 \
    272 \ The fact that this implementation of CSI 7 m and CSI 0 m do not force
    273 \ the colors back to black and white is also advantageous for programs
    274 \ that use these sequences for "standout-start ... standout-end", for
    275 \ which it is nice not to wantonly change the current color scheme.  It
    276 \ is also important that CSI 0 m does not immediately alter the boldness
    277 \ of the background color, because in the common case of a bright white
    278 \ background, that prevents CSI 7 m ... CSI 0 m from changing the background
    279 \ to dim white.
    280 
    281258: bold  ( -- mask )  foreground-color 8 and  ;
    282259: bold-on  ( -- )
     
    286263   foreground-color 8 invert and  to foreground-color
    287264;
    288 : default-attributes  ( -- )  false to inverse?  bold-off  ;
     265: default-attributes  ( -- )  false to inverse?  0 to foreground-color  ;
    289266: >color#  ( ansi-color-code -- palette# )
    290267   10 mod  " "(00 04 02 06 01 05 03 07)" drop + c@
Note: See TracChangeset for help on using the changeset viewer.