curses-menu
curses-menu copied to clipboard
Support ANSI escape codes/custom colors
Trying to use escape codes doesn't work as I would have hoped:
color_on = '\033[32m'
color_off = '\033[39m'
menu_item = MenuItem("{0}Menu Item{1}".format(color_on, color_off))
Result:
1 - ^[[32mMenu Item^[[39m
Thanks...
From what I've read on the subject, the base ncurses library doesn't support ANSI escapes. It has its own methods of coloring text, which I should be able to expose through the MenuItem class pretty easily.
Indeed you are correct.
Implementing the color abilities would be a very nice addition to curses-menu! (info: ncurses colors). Thanks for considering this...