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

Tabulators in text brake the menu #61

Open
mreitschuster opened this issue Aug 7, 2022 · 0 comments
Open

Tabulators in text brake the menu #61

mreitschuster opened this issue Aug 7, 2022 · 0 comments
Labels
bug Something isn't working

Comments

@mreitschuster
Copy link

mreitschuster commented Aug 7, 2022

#!/usr/bin/env python3

from simple_term_menu import TerminalMenu

def main():
    options = ["entry \t 1", "entry \t 2", "entry \t 3"]
    terminal_menu = TerminalMenu(options)
    menu_entry_index = terminal_menu.show()
    print(f"You have selected {options[menu_entry_index]}!")

if __name__ == "__main__":
    main()

A small change from the original example - adding tabs in the option list - makes the tool behave unexpectedly. Instead of being able to move the cursor, clicking an arrow button now makes the menu confusing:


python simple-term-menu.py 
  entry          1 
                                                                                                                                                                                                                                            
  entry          2 
> entry          1                                                                                                                                                                                                                          
                                                                                                                                                                                                                                            
  entry          2                                                                                                                                                                                                                          
  entry          1                                                                                                                                                                                                                          
                                                                                                                                                                                                                                            
  entry          2                                                                                                                                                                                                                          
> entry          1                                                                                                                                                                                                                          
                                                                                                                                                                                                                                            
  entry          2                                                                                                                                                                                                                          
  entry          1                                                                                                                                                                                                                          
                                                                                                                                                                                                                                            
  entry          2                                                                                                                                                                                                                          
> entry          1                                                                                                                                                                                                                          
                                                                                                                                                                                                                                            
  entry          2                                                                                                                                                                                                                          
  entry          1                                                                                                                                                                                                                          
                                                                                                                                                                                                                                            
  entry          2                                                                                                                                                                                                                          
  entry          1                                                                                                                                                                                                                          
                                                                                                                                                                                                                                            
> entry          2                                                                                                                                                                                                                          
> entry          1                                                                                                                                                                                                                          
                                                                                                                                                                                                                                            
  entry          2                                                                                                                                                                                                                          
  entry          1                                                                                                                                                                                                                          
                                                                                                                                                                                                                                            
  entry          2                                                                                                                                                                                                                          
  entry          1                                                                                                                                                                                                                          
                                                                                                                                                                                                                                            
> entry          2                                                                                                                                                                                                                          
> entry          1                                                                                                                                                                                                                          
                                                                                                                                                                                                                                            
  entry          2                                                                                                                                                                                                                          
  entry          1                                                                                                                                                                                                                          
                                                                                                                                                                                                                                            
  entry          2                                                                                                                                                                                                                          
  entry          1                                                                                                                                                                                                                          
                                                                                                                                                                                                                                            
> entry          2                                                                                                                                                                                                                          
> entry          1                                                                                                                                                                                                                          
                                                                                                                                                                                                                                            
  entry          2                                                                                                                                                                                                                          
  entry          1                                                                                                                                                                                                                          
                                                                                                                                                                                                                                            
  entry          2                                                                                                                                                                                                                          
  entry          1                                                                                                                                                                                                                          
                                                                                                                                                                                                                                            
> entry          2                                                                                                                                                                                                                          
> entry          1                                                                                                                                                                                                                          
                                                                                                                                                                                                                                            
  entry          2                                                                                                                                                                                                                          
  entry          1                                                                                                                                                                                                                          
                                                                                                                                                                                                                                            
  entry          2                                                                                                                                                                                                                          
  entry          1                                                                                                                                                                                                                          
                                                                                                                                                                                                                                            
> entry          2                                                                                                                                                                                                                          
> entry          1                                                                                                                                                                                                                          
                                                                                                                                                                                                                                            
  entry          2                                                                                                                                                                                                                          
  entry          1                                                                                                                                                                                                                          
                                                                                                                                                                                                                                            
  entry          2                                                                                                                                                                                                                          
  entry          1                                                                                                                                                                                                                          
                                                                                                                                                                                                                                            
> entry          2
@IngoMeyer441 IngoMeyer441 added the bug Something isn't working label Jan 4, 2023
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

2 participants