Registry / serialization / jinxed

jinxed

JSON →
library2.0.4pypypi✓ verified 90d ago

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.

pip install jinxed
INSTALL
IMPORT
SIG · JINXED
J
jinxed
serializationpythonv2.0.4
Install
1.6s avg
Import
—
Disk
16MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.9–3.13
musl
3.9–3.13
Install & Compatibility
Where this runs
tested against v2.0.4 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.10–3.920 runs
installs and imports cleanly · install 0.0s · import 0.000s · 18.5MB
glibc
py 3.10–3.920 runs
installs and imports cleanly · install 1.6s · import 0.000s · 19MB
16MB installed
● package 16MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

tigetstr
✓ from jinxed import tigetstr
✗ from jinxed.terminfo import tigetstr
tparm
✓ from jinxed import tparm
✗ from jinxed.terminfo import tparm

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.

import os from jinxed.terminfo import tigetstr, tparm def main(): # Get the terminal type from environment, default to 'xterm' term_type = os.environ.get('TERM', 'xterm') print(f"Using terminal type: {term_type}") # Get the 'cursor up' capability string cursor_up_cap = tigetstr('cuu1') if cursor_up_cap: print(f"'cursor up' capability: {cursor_up_cap!r}") else: print("'cursor up' capability not found for this terminal.") # Get and apply a parameterized capability, e.g., 'cursor address' (cup) # This moves the cursor to a specific row and column (0-indexed) cursor_address_cap = tigetstr('cup') if cursor_address_cap: # Move cursor to row 5, column 10 (0-indexed) # Note: tparm parameters are often 1-indexed in terminfo, but curses/jinxed often maps to 0-indexed. # Actual behavior may depend on specific terminal and capability. control_sequence = tparm(cursor_address_cap, 5, 10) if control_sequence: print(f"Moving cursor to (5,10): {control_sequence!r}") os.write(1, control_sequence) # Write directly to stdout's file descriptor os.write(1, b'Hello!\n') else: print("'cursor address' capability not found.") if __name__ == '__main__': main()
Debug
Known issues
breakingThe 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.
fix
Review `tparm` calls and ensure they do not rely on state persistence across invocations. Parameters should be explicitly passed for each call.
affects: >=1.2.1
breakingIn 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.
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.
affects: >=1.2.1
breakingSupport for Python 3.4 was dropped in version 1.0.0.
fix
Upgrade to Python 3.5 or newer.
affects: >=1.0.0
gotchaIn 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.
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.
affects: >=1.3.0
gotchaVersion 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.
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.
affects: >=1.4.0
Upgrade
Version history
2.0.4latest on PyPI · released May 23, 2026
Audit
Dependencies

No dependency data recorded yet.

Agent activity
15 hits · last 30 days
node
14
Resources
jinxed — pip install jinxed · libregistry