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

colors to the title #75

Open
ali-0x11 opened this issue Jun 7, 2023 · 1 comment
Open

colors to the title #75

ali-0x11 opened this issue Jun 7, 2023 · 1 comment
Labels
enhancement New feature or request

Comments

@ali-0x11
Copy link

ali-0x11 commented Jun 7, 2023

How I can add colors to the title ?

@IngoMeyer441
Copy link
Owner

Unfortunately, this is not really possible at the moment. You could directly inject terminal escape codes into the title string, like this:

#!/usr/bin/env python3

from simple_term_menu import TerminalMenu


def main():
    terminal_menu = TerminalMenu(["Apple", "Banana", "Peach"], title="\33[32mFruits\33[m")
    terminal_menu.show()
    print(f"Your choice: {terminal_menu.chosen_menu_entry}")


if __name__ == "__main__":
    main()

But this breaks the title line length calculation routine and leads to a broken menu display on repaint. This is related to issue #14 and hopefully can be fixed soon.

@IngoMeyer441 IngoMeyer441 added the enhancement New feature or request label Jun 12, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants