{"library":"blessed","title":"Blessed","description":"Blessed is an easy, practical Python library for making terminal applications, offering an elegant interface to handle colors, keyboard input, and screen positioning. It is currently at version 1.38.0 and maintains an active development and release cadence, with frequent updates improving compatibility and adding features.","status":"active","version":"1.38.0","language":"en","source_language":"en","source_url":"https://github.com/jquast/blessed","tags":["terminal","console","TUI","colors","keyboard input","cursor positioning","curses","cross-platform"],"install":[{"cmd":"pip install blessed","lang":"bash","label":"Install stable version"}],"dependencies":[{"reason":"Required Python version.","package":"python","version":">=3.8"},{"reason":"Used for determining the printable width of unicode characters in the terminal, essential for correct layout and text wrapping.","package":"wcwidth","version":">=0.1.4"},{"reason":"Provides a curses-like interface for Windows, enabling Blessed's full functionality on that platform.","package":"jinxed","optional":true,"platform":"Windows"}],"imports":[{"note":"The `Terminal` class is the primary entry point for all Blessed functionality.","symbol":"Terminal","correct":"from blessed import Terminal"}],"quickstart":{"code":"from blessed import Terminal\nimport os\n\nterm = Terminal()\nprint(term.home + term.clear + term.move_y(term.height // 2))\nprint(term.black_on_darkkhaki(term.center('press any key to continue.')))\n\nwith term.cbreak(), term.hidden_cursor():\n    # Use os.environ.get for auth keys in real applications if needed\n    inp = term.inkey(timeout=os.environ.get('BLESSED_INKEY_TIMEOUT', 3))\n\nprint(term.move_down(2) + 'You pressed ' + term.bold(repr(inp)))\nprint(term.normal + 'Exiting.')","lang":"python","description":"This example initializes the terminal, clears the screen, centers a styled message, waits for a single key press using a context manager for `cbreak` mode and a hidden cursor, then prints the pressed key before exiting. The `timeout` for `inkey` uses an environment variable fallback for robustness."},"warnings":[{"fix":"Upgrade your Python environment to 3.8 or newer. For projects requiring older Python versions, use Blessed < 1.28.","message":"Python 3.7 and earlier versions are no longer supported since Blessed version 1.28. Attempting to use Blessed 1.28+ with Python 3.7 or older will result in an ImportError.","severity":"breaking","affected_versions":">=1.28"},{"fix":"Use `term.move_xy(x, y)` for explicit cursor positioning. For text styles like subscript/superscript, consider using Unicode characters or 256/24-bit color codes directly if supported by the terminal, rather than relying on deprecated compound attributes.","message":"The `Terminal.move()` method is deprecated in favor of `Terminal.move_xy(x, y)`. Also, compoundable attributes like `superscript`, `subscript`, `shadow`, and `dim` with colors (e.g., `term.blue_subscript('a')`) are deprecated as they are rarely supported by terminals.","severity":"deprecated","affected_versions":">=1.33"},{"fix":"Ensure that `with term.location(...)` blocks are not nested. Complete one `location` context before entering another.","message":"The `Terminal.location()` context manager cannot be nested. Entering a new `location` context while another is active may lead to unexpected cursor behavior.","severity":"gotcha","affected_versions":"All versions"},{"fix":"If you explicitly require styling even when output is redirected, initialize the `Terminal` with `force_styling=True`, e.g., `term = Terminal(force_styling=True)`.","message":"Blessed automatically omits terminal styling sequences if output is redirected to a non-terminal (e.g., a file or pipe). This is a feature, but can be a gotcha if styling is expected in piped output.","severity":"gotcha","affected_versions":"All versions"},{"fix":"For optimal Windows compatibility and performance, ensure you are using Blessed version 1.34 or newer. These versions include significant improvements for console responsiveness and feature support on Windows.","message":"Earlier versions of Blessed had less robust Windows support, particularly concerning `async_inkey()`, mouse events, and resize notifications. `async_inkey()` raised `NotImplementedError` on Windows prior to 1.33, and general performance for keyboard input was much slower.","severity":"gotcha","affected_versions":"<1.34"},{"fix":"If using a Kitty terminal and experiencing issues with key input, upgrade Blessed to version 1.36 or higher to benefit from improved protocol detection and key name synthesis.","message":"Fixes for Kitty keyboard protocol (correct key identification for CSI, alphanumeric keys, etc.) were applied in versions 1.30 and 1.36. Users of Kitty terminal emulators on older Blessed versions might experience incorrect key detection.","severity":"gotcha","affected_versions":"<1.36"}],"env_vars":null,"last_verified":"2026-04-06T00:00:00.000Z","next_check":"2026-07-05T00:00:00.000Z"}