anthonyalmarza / chalk

Light-weight python package for terminal output in color
MIT License
67 stars 3 forks source link

fix color escape code #1

Closed livibetter closed 10 years ago

livibetter commented 10 years ago

The escape doesn't work for xterm and rxvt-unicode, both seem to render text in with normal mode as in \e[0m:

^[[31;mERROR^[[0m
^M^[[34;mHello world!!^[[0m
^M^[[33;mListen to me!!!^[[0m
^M^[[1;35;mThis is pretty cool^[[0m
^M^[[1;4;36;m...more stuff^[[0m
^M

This patch will output the following, and they does work for both xterm and rxvt-unicode:

^[[31mERROR^[[0m
^M^[[34mHello world!!^[[0m
^M^[[33mListen to me!!!^[[0m
^M^[[1;35mThis is pretty cool^[[0m
^M^[[1;4;36m...more stuff^[[0m
livibetter commented 10 years ago

By the way, @anthonyalmarza, I am curious what terminal emulator you are using that could render those escape codes.

anthonyalmarza commented 10 years ago

Hey @livibetter, thanks for this. I use iTerm for mac, which I find much nicer to use than the built-in terminal. If you're on a mac then I highly recommend it.

Thanks again.