Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support ANSI escape codes/custom colors #16

Open
dylib opened this issue Feb 21, 2016 · 2 comments
Open

Support ANSI escape codes/custom colors #16

dylib opened this issue Feb 21, 2016 · 2 comments
Assignees

Comments

@dylib
Copy link

dylib commented Feb 21, 2016

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

@pmbarrett314
Copy link
Owner

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.

@dylib
Copy link
Author

dylib commented Feb 25, 2016

Indeed you are correct.

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

@pmbarrett314 pmbarrett314 self-assigned this May 17, 2016
Cpizarro91 added a commit to Cpizarro91/curses-menu that referenced this issue Apr 20, 2017
This is a script made by user l0b0 in which you can run from folder directory
that will allow you to display the number of colors as well as the actual
colors that are supported by your terminal.

I am adding this just a very minor side note for issue pmbarrett314#16. If, by chance, you
are unsure if or how many colors your terminal support, here's an easy way to
find out.

While in the directory of the xterm-color-count, run the command
"./xterm-color-count.sh -v" and all the supported colors will be displayed.

Note: This is not supported on Linux.
@pmbarrett314 pmbarrett314 changed the title Support ANSI escape codes Support ANSI escape codes/custom colors Aug 1, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants