{"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":"python","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,"search_vec":"'activ':54 'adapt':40 'arrow':29 'capabl':43 'cli':67 'command':19 'command-lin':18 'consol':71 'creation':15 'databas':48 'disabl':49 'emac':35 'enabl':23 'environ':66 'facilit':13 'frequent':57 'intellig':39 'interact':17,70 'j/k':31 'key':30,36 'leverag':45 'librari':38 'line':20 'linux':63 'maco':65 'maintain':55 'menu':3,7,69 'menus':21 'minor':58 'motion':33 'option':27 'packag':11 'primarili':61 'python':10 'releas':59 'select':26 'simpl':1,5 'simple-term-menu':4 'style':51 'support':62 'term':6 'termin':2,42,68 'terminfo':47 'tui':72 'unavail':50 'use':28 'user':24 'vim':32","created_at":"2026-04-12T14:06:36.655401+00:00","updated_at":"2026-04-17T14:11:37.548166+00:00","problems":[{"fix":"pip install simple-term-menu","cause":"The 'simple-term-menu' package is not installed or not available in the current Python environment.","error":"ModuleNotFoundError: No module named 'simple_term_menu'"},{"fix":"Ensure your TERM environment variable is set correctly (e.g., `xterm`, `screen`), or run the script in a more feature-rich terminal emulator. For Windows, consider using WSL or a compatible terminal.","cause":"The library could not determine the capabilities of the current terminal, often due to an unset TERM environment variable, a minimal terminal, or an unsupported environment like some Windows console setups.","error":"simple_term_menu.exceptions.UnsupportedTerminal: Failed to retrieve terminal capabilities."},{"fix":"Wrap the single string (or multiple strings) in a list: `SimpleTermMenu(menu_entries=['Option 1', 'Option 2'])`","cause":"The `menu_entries` parameter of `SimpleTermMenu` expects an iterable (like a list or tuple) of strings, but a single string was provided directly.","error":"TypeError: 'str' object is not iterable"},{"fix":"Use the correct method name `show()`: `selected_entry = menu.show()`","cause":"Attempting to call a non-existent method on the `SimpleTermMenu` object; the correct method to show the menu is `show()`.","error":"AttributeError: 'SimpleTermMenu' object has no attribute 'display'"},{"fix":"Use the correct parameter names as specified in the library's documentation, such as `title`, `menu_cursor`, or `cycle_cursor`.","cause":"An incorrect or misspelled keyword argument (e.g., 'menu_title' instead of 'title') was passed to the TerminalMenu constructor.","error":"TypeError: TerminalMenu.__init__() got an unexpected keyword argument 'menu_title'"}],"ecosystem":"pypi","meta_description":null,"install_score":null,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":"1.6.6","cli_name":"","cli_version":null,"type":"library","homepage":null,"github":"https://github.com/IngoMeyer441/simple-term-menu","docs":null,"changelog":null,"pypi":"https://pypi.org/project/simple-term-menu/","npm":null,"openapi_spec":null,"status_page":null,"smithery":null,"categories":["devops","testing"],"base_url":null,"auth_type":null,"provenance":{"verified_status":"passing","verified_at":"2026-06-28","last_verified":"2026-08-30","next_check":"2026-07-28","install_tag":null}}