[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Groff] preserve ascii escape characters from input

From: Keith Marshall
Subject: Re: [Groff] preserve ascii escape characters from input
Date: Thu, 25 Feb 2010 22:45:51 +0000
User-agent: KMail/1.9.10

On Thursday 25 February 2010 14:26:12 Leonardo Boiko wrote:
> what sort of terminal support ANSI-like attributes (color,
> bold etc.) but not the ANSI escape sequences? I.e. if I output
> ANSI directly, I'm running the risk of breaking what?

The original IBM PC, and all of its modern day derivatives spring 
immediately to mind.  (Okay, if you run any of the *nix operating 
systems on modern kit, the terminal emulators likely do support ANSI 
control codes fairly comprehensively; the same is most certainly NOT 
true of console applications running in that other prevalent OS).

When IBM first released the PC in the 1980s, with PC-DOS 1.0, (which 
was mostly MS-DOS 1.0), there was no ANSI support at all; terminal 
attributes had to be controlled either by real mode calls (there was 
no protected mode in those days anyway) to the system BIOS, or by 
directly addressing the attribute bytes within the video memory map.  
Even when some (very limited) support for a tiny subset of the ANSI 
sequences was added, in PC-DOS 2.0, it was done by means of an 
optionally loadable kernel module, (the ANSI.SYS device driver, in 
Microsoft's terminology of the day), which few applications used, 
and few users bothered to load; the use of BIOS function calls and 
direct video memory addressing continued to be the norm, throughout 
the lifetime of MS-DOS as a mainstream PC operating system.

The legacy of this persists today, in Microsoft's current operating 
systems.  From MS-Windows 2000 onwards, the old ANSI.SYS support of 
MS-DOS 2.0+ has all but disappeared.  There is no support, at all, 
for ANSI style control of the display attributes in the console 
applications API currently offered by Microsoft, and no native 
MS-Windows application can expect it.  On MS-Windows, it is only 
applications for use with POSIX emulators such as Cygwin or MSYS, 
AFAIK, that can have any expectation of ANSI terminal support; if 
you emit ANSI sequences to a native MS-Windows console, they will 
display as mostly incomprehensible hieroglyphics.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]