2

printf statements with colour codes appear very brightly on Linux.

#define DBG_YELLOW      "\033[33m"
fprintf(stderr, DBG_YELLOW"%s %s\n"DBG_NORMAL, area, msg);

However those same printf's with colour codes appear quite dull on cygwin.

any ideas what I can do to brighten them?

BeeBand
  • 10,953
  • 19
  • 61
  • 83
  • 1
    Wouldn't this have to do with the window you are using? (Native windows black box or an xterm?) – Manux Jul 04 '11 at 20:20
  • It's probably your terminal program converting the colors from what they should be to what "looks nice" where the person who defined "nice" had no business defining it. Either poke around in the terminal's settings or use a better one instead. – trutheality Jul 04 '11 at 20:25
  • "or use a better one instead" - unfortunately I think cygwin is my only option as I'm on Windows. – BeeBand Jul 04 '11 at 20:31
  • @Manux - that's exactly right. – BeeBand Jul 04 '11 at 20:32
  • There's also mintty: http://code.google.com/p/mintty/ and console2 http://sourceforge.net/projects/console/ – ninjalj Jul 04 '11 at 21:34

2 Answers2

2

The colors for MinTTY can be changed, it seems. On Cygwin, you have the Windows terminal, MinTTY and rxvt as terminals. I'd say MinTTY is by far the best of those.

Haha, good news: MinTTY now allows you to change the 16 default ANSI colors, see the section "Changing colours"!

And also see this other question to pimp your cmd.exe prompt using colors.

Community
  • 1
  • 1
Lumi
  • 14,775
  • 8
  • 59
  • 92
1

MS-DOS (ansi.sys) and a fair number of terminals dual-purpose [1m as bold or bright, and you can usually toggle this behaviour in the configuration.

You can either do \033[1m\033[33m, or the compound, \033[33;1m, to give you your bright color.

Be warned tho', ANSI codes are notoriously inconsistent. Orange could be brown on one terminal, bold can be blink on another. Rather than doing it by hand, look into one of the many tried-and-true libraries like ncurses which have done all of the work for you, should you care about portability.

TkTech
  • 4,729
  • 1
  • 24
  • 32