These features are supported by COMMAND.COM in all versions of DOS Plus and DR-DOS, but not in MS-DOS or PC DOS. For example, to send an alternative control sequence like ESC + (for 1Bh 2Bh as used by ASCII terminals), one could define the variable as follows: Due to the difficulties to define environment variables containing binary data COMMAND.COM also accepts a special \nnn notation for octal numbers. If the environment variable is undefined, it falls back to send the sequence ESC Specifying other sequences can be used to control various screen settings after a CLS. However, if an ANSI driver is detected by the DR-DOS COMMAND.COM, it will instead send the control sequence defined in the reserved environment variable $CLS to the attached console device. Several companies made third-party replacements that interface directly with the video memory, in a similar way to most DOS programs that have a full-screen user interface.īy default, the internal DOS command CLS works by directly calling the corresponding BIOS function to clear the screen, thereby prominently violating the hardware abstraction model otherwise maintained. The standard ANSI.SYS is relatively slow as it maps escape sequences to the equivalent BIOS calls.
It also allows for the changing of the video mode from standard 80×25 text mode to a number of different graphics modes (for example, 320×200 graphics mode with text drawn as pixels, though ANSI.SYS does not provide calls to turn individual pixels on and off). Using this driver, programs that write to the standard output can make use of the 16 text foreground colors and 8 background colors available in VGA-compatible text mode, make text blink, change the location of the cursor on the screen, and blank the screen.
Once loaded, ANSI.SYS enables code sequences to apply various text formatting features. /X support redefinition of extended key codes independent of standard codes./R adjust line scrolling to support screen readers./K use extended keyboard BIOS functions ( INT 16h) rather than standard ones.ANSI.SYS may also be loaded into upper memory via DEVICEHIGH/ HIDEVICE. Where drive: and path are the drive letter and path to the directory in which the file ANSI.SYS is found, and options can be a number of optional switches to control the behaviour. To use ANSI.SYS under DOS, a line is added to the CONFIG.SYS (or CONFIG.NT under Windows NT based versions of Windows) file that reads: