curses-menu icon indicating copy to clipboard operation
curses-menu copied to clipboard

Support ANSI escape codes/custom colors

Open dylib opened this issue 9 years ago • 2 comments

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...

dylib avatar Feb 21 '16 04:02 dylib

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.

pmbarrett314 avatar Feb 23 '16 22:02 pmbarrett314

Indeed you are correct.

Implementing the color abilities would be a very nice addition to curses-menu! (info: ncurses colors). Thanks for considering this...

dylib avatar Feb 25 '16 06:02 dylib