{"id":4764,"library":"simple-term-menu","title":"Simple Terminal Menu","description":"simple-term-menu is a Python package that facilitates the creation of interactive command-line menus. It enables users to select options using arrow keys, j/k (Vim motions), or emacs keys. The library intelligently adapts to terminal capabilities by leveraging the terminfo database, disabling unavailable styles. It is actively maintained, with frequent minor releases, and primarily supports Linux and macOS environments.","status":"active","version":"1.6.6","language":"en","source_language":"en","source_url":"https://github.com/IngoMeyer441/simple-term-menu","tags":["cli","terminal","menu","interactive","console","tui"],"install":[{"cmd":"pip install simple-term-menu","lang":"bash","label":"Install with pip"}],"dependencies":[],"imports":[{"symbol":"TerminalMenu","correct":"from simple_term_menu import TerminalMenu"}],"quickstart":{"code":"from simple_term_menu import TerminalMenu\n\ndef main():\n    options = [\"entry 1\", \"entry 2\", \"entry 3\"]\n    terminal_menu = TerminalMenu(options)\n    menu_entry_index = terminal_menu.show()\n    if menu_entry_index is not None:\n        print(f\"You have selected {options[menu_entry_index]}!\")\n    else:\n        print(\"Menu cancelled.\")\n\nif __name__ == \"__main__\":\n    main()","lang":"python","description":"This quickstart demonstrates how to create a basic terminal menu with a list of options. The `TerminalMenu` class is instantiated with the options, and the `show()` method displays the menu and returns the index of the selected item or `None` if cancelled."},"warnings":[{"fix":"Update `TerminalMenu` constructor calls to use keyword arguments for all parameters except the initial list of options.","message":"When upgrading from version 0.x to 1.x, the `TerminalMenu` constructor arguments (except the first parameter for menu entries) became keyword-only. This change was implemented to improve maintainability and allow for easier addition of new parameters.","severity":"breaking","affected_versions":"0.x -> 1.x"},{"fix":"Rename `multi_select_key` to `multi_select_keys` and pass an iterable. Rename `shortcut_parentheses_highlight_style` to `shortcut_brackets_highlight_style`.","message":"Between versions 1.1 and 1.2, the `multi_select_key` parameter was renamed to `multi_select_keys` and now expects an iterable of keys. Additionally, `shortcut_parentheses_highlight_style` was renamed to `shortcut_brackets_highlight_style` for consistency.","severity":"breaking","affected_versions":"1.1 -> 1.2"},{"fix":"Consider alternative libraries for Windows-specific CLI menus or ensure a compatible terminal environment (e.g., WSL) is used.","message":"simple-term-menu is primarily designed for Unix-like systems (Linux, macOS) and relies on the `terminfo` database. It may not function correctly or provide a consistent experience on Windows due to fundamental differences in terminal capabilities.","severity":"gotcha","affected_versions":"All versions on Windows"},{"fix":"Refactor menu handling by using classes, dictionaries mapping options to functions, or other structured approaches to keep the code DRY and maintainable.","message":"Embedding extensive logic directly within conditional statements for each menu selection can lead to verbose and difficult-to-manage code, especially with many menu options or submenus.","severity":"gotcha","affected_versions":"All versions"}],"env_vars":null,"last_verified":"2026-04-12T00:00:00.000Z","next_check":"2026-07-11T00:00:00.000Z"}