{"id":6687,"library":"jinxed","title":"Jinxed Terminal Library","description":"Jinxed is an implementation of a subset of the Python curses library, providing pure Python implementations of terminfo functions such as `tigetstr()` and `tparm()`. It also offers convenience methods for working with Windows terminals. Initially developed to support the Blessed library on Windows, Jinxed is designed to work across all platforms.","status":"active","version":"1.4.0","language":"python","source_language":"en","source_url":"https://github.com/Rockhopper-Technologies/jinxed","tags":["terminal","curses","terminfo","windows","cross-platform","console"],"install":[{"cmd":"pip install jinxed","lang":"bash","label":"Install stable version"}],"dependencies":[],"imports":[{"wrong":"from jinxed.terminfo import tigetstr","symbol":"tigetstr","correct":"from jinxed import tigetstr"},{"wrong":"from jinxed.terminfo import tparm","symbol":"tparm","correct":"from jinxed import tparm"}],"quickstart":{"code":"import os\nfrom jinxed.terminfo import tigetstr, tparm\n\ndef main():\n    # Get the terminal type from environment, default to 'xterm'\n    term_type = os.environ.get('TERM', 'xterm')\n    print(f\"Using terminal type: {term_type}\")\n\n    # Get the 'cursor up' capability string\n    cursor_up_cap = tigetstr('cuu1')\n    if cursor_up_cap:\n        print(f\"'cursor up' capability: {cursor_up_cap!r}\")\n    else:\n        print(\"'cursor up' capability not found for this terminal.\")\n\n    # Get and apply a parameterized capability, e.g., 'cursor address' (cup)\n    # This moves the cursor to a specific row and column (0-indexed)\n    cursor_address_cap = tigetstr('cup')\n    if cursor_address_cap:\n        # Move cursor to row 5, column 10 (0-indexed)\n        # Note: tparm parameters are often 1-indexed in terminfo, but curses/jinxed often maps to 0-indexed.\n        # Actual behavior may depend on specific terminal and capability.\n        control_sequence = tparm(cursor_address_cap, 5, 10)\n        if control_sequence:\n            print(f\"Moving cursor to (5,10): {control_sequence!r}\")\n            os.write(1, control_sequence) # Write directly to stdout's file descriptor\n            os.write(1, b'Hello!\\n')\n    else:\n        print(\"'cursor address' capability not found.\")\n\nif __name__ == '__main__':\n    main()","lang":"python","description":"This quickstart demonstrates how to use `jinxed` to retrieve and apply terminfo capabilities like moving the cursor. It fetches terminal capabilities using `tigetstr` and then uses `tparm` to instantiate parameterized strings, which are then written to the console."},"warnings":[{"fix":"Review `tparm` calls and ensure they do not rely on state persistence across invocations. Parameters should be explicitly passed for each call.","message":"The behavior of `tparm` changed in version 1.2.1. It no longer persists dynamic variables between calls, aligning with `ncurses` versions >=6.3. Code relying on the prior persistence of dynamic variables will behave differently.","severity":"breaking","affected_versions":">=1.2.1"},{"fix":"Adjust code to handle an empty string return for `b'%p1%s'` with no arguments instead of Null, if this specific pattern was used.","message":"In version 1.2.1, a specific `tparm` pattern (`b'%p1%s'` with no arguments) now returns an empty string in Jinxed, whereas `ncurses` would return Null. Code expecting a Null value may encounter different behavior.","severity":"breaking","affected_versions":">=1.2.1"},{"fix":"Upgrade to Python 3.5 or newer.","message":"Support for Python 3.4 was dropped in version 1.0.0.","severity":"breaking","affected_versions":">=1.0.0"},{"fix":"If your Windows application requires `ENABLE_VIRTUAL_TERMINAL_INPUT` to be explicitly set, ensure it is configured independently or verify its state before relying on Jinxed to activate it implicitly.","message":"In version 1.3.0, `jinxed.win32.get_term()` was updated to check if `ENABLE_VIRTUAL_TERMINAL_INPUT` is already enabled in the console before setting it. Previously, it would unconditionally enable it. This can affect Windows applications that relied on Jinxed always setting this mode.","severity":"gotcha","affected_versions":">=1.3.0"},{"fix":"Test existing applications with `jinxed` 1.4.0 to ensure consistent behavior with the faster event loop. Consider leveraging the new mouse and resize event capabilities.","message":"Version 1.4.0 introduced approximately 100x improved response time for keyboard events and added support for mouse and resize events. While this is a significant performance and feature enhancement, applications sensitive to precise timing of keyboard events or that previously worked around the lack of mouse/resize support might need re-evaluation or could inadvertently expose new interaction possibilities.","severity":"gotcha","affected_versions":">=1.4.0"}],"env_vars":null,"search_vec":"'across':52 'also':29 'bless':43 'consol':62 'conveni':31 'cross':60 'cross-platform':59 'curs':14,56 'design':49 'develop':39 'function':22 'implement':7,19 'initi':38 'jinx':1,4,47 'librari':3,15,44 'method':32 'offer':30 'platform':54,61 'provid':16 'pure':17 'python':13,18 'subset':10 'support':41 'termin':2,37,55 'terminfo':21,57 'tigetstr':25 'tparm':27 'window':36,46,58 'work':34,51","created_at":"2026-04-15T18:38:38.117241+00:00","updated_at":"2026-04-16T15:52:50.926177+00:00","problems":null,"ecosystem":"pypi","meta_description":null,"install_score":null,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":"2.0.4","cli_name":"","cli_version":null,"type":"library","homepage":null,"github":"https://github.com/Rockhopper-Technologies/jinxed","docs":null,"changelog":null,"pypi":"https://pypi.org/project/jinxed/","npm":null,"openapi_spec":null,"status_page":null,"smithery":null,"categories":["serialization","database"],"base_url":null,"auth_type":null,"provenance":{"verified_status":"passing","verified_at":"2026-06-30","last_verified":"2026-06-30","next_check":"2026-07-30","install_tag":null}}