Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I love the Linux console, but due to many reasons have to work under Windows XP. So now I decided to make it look better but couldn't find any documentation/posts about it. Is it possible at all?

share|improve this question

6 Answers 6

up vote 8 down vote accepted

You can't do that because the way the Windows console works is fundamentally different from the Linux terminal. On Linux the coloring is done using ANSI escape sequences. From Wikipedia:

ANSI escape sequences are characters embedded in the text used to control formatting, color, and other output options on video text terminals. Almost all terminal emulators designed to show text output from a remote computer, and (except for Windows) to show text output from local software, interpret at least some of the ANSI escape sequences.

This pretty much means that coloring (and formatting in general) can be controlled by the user, even when the original program had no provision for that, by simply using strings which contain ANSI escapes.

On Windows, the console formatting has to be done explicitly by the program. Each character cell is comprised of two 16-bit codes: a Unicode character and a style word (mainly color information). The program has to use the low-level API output functions to set the style information, otherwise all characters use the default style (gray on black).

The moral of the story I guess is that Windows and Linux are two completely different operating systems. It is therefore better to get used to their idiosyncrasies, than to fight to fit either one to the mindset of the other. That way madness lies.

share|improve this answer
2  
There's a way to get ANSI escape sequences to work on the Windows Command Prompt: The freeware ANSICON –  afrazier Feb 24 '11 at 15:50
    
@afrazier, I installed ANSICON and understood how to make nice output from mine programs(e.g. blog.mmediasys.com/2010/11/24/we-all-love-colors), but how can I use it to customize commands such as dir to make output more user-friendly? –  whn Feb 25 '11 at 13:06
    
@whn: It doesn't customize the built-in commands. You'd need to use something else that would output colorized information using ANSI escape sequences. That really only makes sense if you're writing cross-platform software where other platforms would interpret the sequences correctly. For win32-only console programs, it'd make more sense to use the Console APIs. –  afrazier Feb 25 '11 at 16:22
    
ok. now I should study windows commands and make some .bat files to improve basic commands =) thank you $afrazier! –  whn Feb 25 '11 at 21:04
    
Run the utility mentioned by @afrazier as ANSICON -i - it will install the cmd autorun entry. After this I got ls --color=always working properly in cmd.exe. –  ccpizza Jan 26 '12 at 13:50

Open Command Prompt, right click on the header bar at the top, select Properties, customize it in there:

Selecting Properties

Changing the colours

share|improve this answer
    
Thank you, but I meant something like this: osmaster.org.ua/wp-content/uploads/2011/02/… –  whn Feb 22 '11 at 22:38
    
@whn - that screen shot is from an application not a plain command prompt. –  ChrisF Feb 22 '11 at 22:54
    
@ Hello71, thanks. –  Moab Feb 22 '11 at 23:33
    
@ whn, No, you cannot customize windows cmd prompt like terminal. –  Moab Feb 22 '11 at 23:36
3  
@Hello71 why? PNG is a better format, but rather than just downvoting, why not edit it to include better screenshots like @Gareth did? It's still a good answer. –  nhinkle Apr 16 '11 at 6:58

Running cmd.exe /t:12 will create a command prompt window with a blue background and green text.

You can find a list of available colors here.

share|improve this answer

You could always install Cygwin

share|improve this answer
    
Yeah. I tried. But it really slow. –  whn Feb 22 '11 at 22:58
1  
Also similar to Cygwin is MinGW MSYS, and it may be faster than it-- see here –  Abbafei Feb 23 '11 at 21:06

You can use PowerShell on windows XP and up, and it comes with the newer versions of Windows. See Costumizing the Windows PowerShell Console, Display Output in Color Using Windows PowerShell, and Windows PowerShell Tip: Modifying Message Colors from Microsoft Technet, for information on different some ways of customization.

share|improve this answer

I don't think you can customise CMD the way you describe in your comment to Moab's answer.

If it's relevant, there are alternatives to Windows' CMD.
You can try console which is a nice small freeware that does a great job.

share|improve this answer
    
yes. I'm currently using it. But it crashes often –  whn Feb 22 '11 at 22:58
    
@whn: What about PowerShell? –  Dennis Williamson Feb 23 '11 at 0:42
1  
Console is wonderful, I've never had it crash, but I use it with TCCLE instead of the default windows interpreter. –  MaQleod Feb 23 '11 at 6:56
    
Console is not an alternative to CMD, it's just a wrapper for it (and other shells). –  paradroid Feb 23 '11 at 21:56

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.