English Deutsch Français Italiano Español Português 繁體中文 Bahasa Indonesia Tiếng Việt ภาษาไทย
All categories

I'm having a devil of a time trying to get the WIndows XP cmd.exe (not command.com) to accept standard ANSI color sequences, such as ^[[32mGreen.

From everything I have gathered, cmd.exe does not support ANSI colors? It's difficult to wrap my head around this mistake if Microsoft truly made it, its just difficult to believe they would have ignored ANSI support.

Any help would be *greatly* appreciated.

2007-04-02 17:02:30 · 3 answers · asked by Clint P 2 in Computers & Internet Other - Computers

3 answers

cmd.exe does not support it natively after win 98

but...

according to wikipedia:

Support is built in on Linux. Windows 95, Windows 98 and DOS systems need a device driver for the ANSI codes - the de facto standard being ANSI.SYS, but others are used as well. Console windows in Windows versions based on NT (NT4, 2000 Professional, 2000 Server, XP, Server 2003, Vista, Server "Longhorn") do not natively support ANSI Escape sequences, though some support is possible. By adding the following line to the CONFIG.NT file located in the Windows System32 directory, ANSI output from 16-bit legacy programs executing under the NTVDM will be interpreted:

DEVICE=ANSI.SYS

Some support is also offered through alternate command processors such as JP Software's 4NT.

In other words, 32-bit character-mode windows applications can not write ANSI escape sequences to the console, but must interpret their actions and call the native Console API intrinsic to accomplish the proper result. Note that the window's Console API does have some restrictions regarding blink, underline and reverse VGA attributes. In exchange for blink, the screen allows for bright background colors. No access from user-mode is given to set the underline registers.

2007-04-02 18:08:39 · answer #1 · answered by Dan A 2 · 0 0

Ansi Escape Sequences

2016-09-29 04:55:13 · answer #2 · answered by ? 4 · 0 0

Ansi Colors

2016-12-17 07:37:03 · answer #3 · answered by ? 4 · 0 0

fedest.com, questions and answers