Blinking cursor fix for Python prompt_toolkit apps
Project description
ptk-blinkfix
Blinking cursor fix for Python prompt_toolkit apps
Enables and preserves cursor blinking in PromptSession and full‑screen apps (TextArea, etc.) across Linux, macOS, and Windows Terminal — without modifying or recompiling prompt_toolkit.
✨ Features
- Works with PromptSession and full‑screen
Applicationwidgets. - Keeps your chosen cursor style even after selection, scrolling, or redraws.
- Supports runtime style switching (default hotkey:
F2). - Fully configurable startup cursor style.
- No fork or rebuild — just import and patch.
🚀 Installation
pip install ptk-blinkfix
📦 Usage
import ptk_blinkfix as blinkfix
# Optional: set startup style and hotkey
blinkfix.CURSOR_STYLE = "blinking_block" # or blinking_underline, blinking_beam, steady_block, etc.
blinkfix.CURSOR_SWITCH_KEY = "f2"
from prompt_toolkit import PromptSession
session = PromptSession()
while True:
try:
text = session.prompt(">>> ")
print(f"You typed: {text}")
except (EOFError, KeyboardInterrupt):
break
🎯 Supported Cursor Styles
blinking_blockblinking_underlineblinking_beamsteady_blocksteady_underlinesteady_beam
📜 License
This project is licensed under the BSD‑3‑Clause License.
It interacts with prompt_toolkit, which is also licensed under BSD‑3‑Clause.
See LICENSE for details.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file ptk_blinkfix-1.0.1.tar.gz.
File metadata
- Download URL: ptk_blinkfix-1.0.1.tar.gz
- Upload date:
- Size: 5.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.10.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
614bbb1edfd07fdccf1874c510cb456a6c24724fe4ab860a1254f48cd391c395
|
|
| MD5 |
8b50154587ce9c22829408dd526db622
|
|
| BLAKE2b-256 |
997515c2816d7bc6c80ad6b72ad2bad507d0654ed0d8b829821420d9b2dfca97
|
File details
Details for the file ptk_blinkfix-1.0.1-py3-none-any.whl.
File metadata
- Download URL: ptk_blinkfix-1.0.1-py3-none-any.whl
- Upload date:
- Size: 5.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.10.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a7ac54d8df71ba4a3f9a74726799b34507de781aca2f3b47c6dc48cfba86c41a
|
|
| MD5 |
d4bcfce414bad88b10de39572c60b4d9
|
|
| BLAKE2b-256 |
9bc9b953fb087a61da3c5929f6f633ec455d222ab125f10d7e32f462c71fd108
|