Registry / cursor

cursor

JSON →
library1.3.5pypypi✓ verified 86d ago

The `cursor` library (current version 1.3.5) is a small, cross-platform Python package designed to hide or show the terminal cursor. It provides simple functions for managing cursor visibility in command-line interfaces on both Linux and Windows, and also installs command-line utilities for quick control. Its release cadence is infrequent, indicating a stable and mature utility.

pip install cursor
INSTALL
IMPORT
SIG · CURSOR
C
cursor
pythonv1.3.5
Install
2.4s avg
Import
Disk
17MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v1.3.5 · 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.103.920 runs
installs and imports cleanly · install 0.0s · import 0.000s · 19.2MB
glibc
py 3.103.920 runs
installs and imports cleanly · install 2.4s · import 0.000s · 20MB
17MB installed
● package 17MB
Code
Verified usage

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

cursor
import cursor
from cursor import hide, show
The library exposes `hide` and `show` as top-level functions directly under the `cursor` module, not as separate classes or attributes that need direct import.

This quickstart demonstrates how to hide the terminal cursor, wait, and then show it again. It includes `atexit.register` to ensure the cursor is always made visible when the script exits, which is a crucial best practice for this library.

import cursor import time import atexit atexit.register(cursor.show) # Ensure cursor is shown on exit print("Hiding cursor in 3 seconds...") time.sleep(3) cursor.hide() print("Cursor hidden. It will reappear in 5 seconds.") time.sleep(5) cursor.show() print("Cursor shown. Script finished.")
cursor --version
Debug
Known issues
gotchaThe terminal cursor will remain hidden even after your Python script exits unless `cursor.show()` is explicitly called. This can be confusing for users.
fix
Always ensure `cursor.show()` is called when your application is done, or use `atexit.register(cursor.show)` to automatically restore the cursor on script termination.
affects: All versions
gotchaThis `cursor` library is specifically for managing the *terminal* text cursor. It does not control graphical mouse cursors (e.g., in GUI applications like Tkinter, Pygame) or database cursors (e.g., in `psycopg2`, `mysql-connector-python`).
fix
Ensure you are using the correct library for the type of cursor you intend to control. For graphical cursors, methods within the respective GUI library or OS-specific tools are needed.
affects: All versions
gotchaWhen running scripts in certain IDEs or environments (e.g., Cursor IDE itself), the terminal output and cursor control might be abstracted or handled differently, potentially leading to unexpected behavior or an inability to hide/show the cursor as expected by the native terminal.
fix
Test terminal cursor control in a standard system terminal (e.g., Bash, PowerShell, CMD) to confirm library functionality. Consult your IDE's documentation for specific terminal interaction settings or known issues.
affects: All versions, specific to IDE/environment integration
Errors
Common errors & fixes
ModuleNotFoundError: No module named 'cursor'
The `cursor` library has not been installed in the Python environment being used.
fix
pip install cursor
AttributeError: module 'cursor' has no attribute 'hide'
This error occurs if the `hide` or `show` function is not found within the `cursor` module, possibly due to a typo in the function name, an outdated library version, or if a variable named `cursor` accidentally overwrites the imported module.
fix
Verify the correct function name (e.g., `cursor.hide()`, `cursor.show()`) and ensure the library is correctly imported and not shadowed by another variable. Consider upgrading the library with `pip install --upgrade cursor` if using an old version.
TypeError: 'builtin_function_or_method' object is not callable
This error typically occurs when attempting to use `cursor.hide` or `cursor.show` without the required parentheses, treating the function object itself as a value rather than calling it.
fix
Ensure you call the functions with parentheses: `cursor.hide()` and `cursor.show()`.
Upgrade
Version history
1.3.5latest on PyPI · released Jun 15, 2022
Audit
Dependencies

No dependency data recorded yet.

Agent activity
8 hits · last 30 days
node
8
Resources
cursor — pip install cursor · libregistry