Zach Shepherd's WordPress Blog

Just another WordPress weblog

Tuesday, April 21, 2009

Styled output (unix c/c++)

After seeing a program that had colored and styled (bold) output, I decided to look into it. There isn’t a lot of information available, so I’m not sure how widely supported it is. It seems to be compatible with gnome-terminal in a few versions of Ubuntu, but I’m not sure what else (if you try it, let me know).

After a lot of trial-and-error (the tutorials I found were all incomplete), I wrote the following program to output the “code” to style text in any one of 8 colors (with an additional 8 background colors) and 4 styles (plain, bold, underlined, and strikethrough). The output leads me to believe underline is poorly supported (only some text is underlined), but for coloring error messages, this is probably sufficient.

Update: It looks like the proper term for these are ANSI escape codes. When you use the proper term, it’s much easier to find tutorials. I’ll leave this up in case anyone stumbles across it not knowing the proper term.


posted by Zach at 7:04 pm  

Tuesday, January 20, 2009

Forcing subversion to “–no-auth-cache”

Add “store-passwords = no” and “store-auth-creds = no” to the [auth] section of ~/.subversion/config.

Results: Subversion will never cache passwords (which are stored in plain text) or credentials

More information:

posted by Zach at 10:50 am  

Tuesday, January 20, 2009

New Category: Solutions Log

After reading Kyle Smith’s post about solutions logs, I decided to create a new category for my blog just for solutions logs. If posts in this category seem to be overwhelming, I can look into removing them from the main page and the feed used on planet.cosi.

posted by Zach at 8:46 am  

Powered by WordPress