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

Wide Unicode characters in menu_entries breaks display #73

Open
ghost opened this issue Nov 29, 2022 · 7 comments
Open

Wide Unicode characters in menu_entries breaks display #73

ghost opened this issue Nov 29, 2022 · 7 comments
Labels
bug Something isn't working

Comments

@ghost
Copy link

ghost commented Nov 29, 2022

Using strings with emojis or other wide characters in the menu_entries strings causes draw errors where the highlight does not match the cursor and duplicate lines get drawn above the menu every time a navigation key is pressed.

Environment is Mac OSX 12.4, iTerm2 terminal emulator.

    options = [
        "🔥  !NOW",
        "⏰  !Pending Tasks",
        "🧩  !Pending Tasks :: Consolidate",
    ]

    menu = TerminalMenu(options, title="select tag")
    menu.show()

First Render:

image

One Keypress down:

image

After several key presses:

image

Note that if there are many options for menu_entries, then not just the title line is repeated, but so are the first few lines of the option list:

image

@IngoMeyer441
Copy link
Owner

Thanks for your report. Which version of simple_term_menu do you use? Since version 0.10.3, unicode characters are (or should be) fully supported. You can check with:

python -c 'import simple_tem_menu; print(simple_term_menu.__version__)'

Which OS do you use?

@IngoMeyer441 IngoMeyer441 added the bug Something isn't working label Dec 2, 2022
@ghost
Copy link
Author

ghost commented Dec 2, 2022

Version of simple_term_menu is 1.5.2.

OS is OSX 12.4 (Monterey).

Terminal is iTerm2 3.4.18.

@IngoMeyer441
Copy link
Owner

I cannot reproduce this on Manjaro Linux with Kitty terminal. 😞 Maybe this is an Apple related problem. I will run some more tests on macOS.

@IngoMeyer441
Copy link
Owner

I can reproduce this issue on macOS Catalina with the default Apple Terminal.app. If you remove the menu item

"🧩  !Pending Tasks :: Consolidate",

simple-term-menu works as usual. Somehow the 🧩 character seems to be interpreted as terminal escape sequence and moves the cursor down by one line. But I don't quite understand why this happens...

@dammaer
Copy link

dammaer commented Mar 20, 2023

Hello! Unfortunately, control sequences also create problems.

main_menu_title = "\033[36mMain Menu.\nPress Q or Esc to quit.\033[0m\n"

menu

OS Ubuntu 22.04

@IngoMeyer441
Copy link
Owner

@dammaer This is probably related to #14.

@deivshon
Copy link

Hi, I just wanted to report that I'm getting this same bug on Arch Linux but only using the terminal foot (v1.15.1-1)

Both on alacritty (v0.12.2-1) and on my st build the bug does not seem to show up

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants