Metadata-Version: 2.4
Name: ptk-blinkfix
Version: 1.0.1
Summary: Blinking cursor fix for Python prompt_toolkit apps
Home-page: https://github.com/ahmetaltin/ptk-blinkfix
Author: Ahmet Altin
Author-email: Ahmet Altin <me@ahmetaltin.com>
Maintainer-email: Ahmet Altin <me@ahmetaltin.com>
License: BSD 3-Clause License
        
        Copyright (c) 2026, Ahmet ALTIN
        
        This work is based on the original prompt_toolkit project.
        Modifications include updates, bug fixes, and additional features
        to support modern Python versions and extended functionality.
        Licensed under the BSD 3-Clause License.
        
        Copyright (c) 2014, Jonathan Slenders
        All rights reserved.
        
        Redistribution and use in source and binary forms, with or without
        modification, are permitted provided that the following conditions are met:
        
        1. Redistributions of source code must retain the above copyright notice, this
           list of conditions and the following disclaimer.
        
        2. Redistributions in binary form must reproduce the above copyright notice,
           this list of conditions and the following disclaimer in the documentation
           and/or other materials provided with the distribution.
        
        3. Neither the name of the copyright holder nor the names of its
           contributors may be used to endorse or promote products derived from
           this software without specific prior written permission.
        
        THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
        AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
        IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
        DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
        FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
        DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
        SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
        CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
        OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
        OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
        
Project-URL: Homepage, https://github.com/ahmetaltin/ptk-blinkfix
Project-URL: Repository, https://github.com/ahmetaltin/ptk-blinkfix
Project-URL: Issues, https://github.com/ahmetaltin/ptk-blinkfix/issues
Keywords: prompt_toolkit,cursor,blinking,terminal,cli
Classifier: License :: OSI Approved :: BSD License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Operating System :: OS Independent
Requires-Python: >=3.7
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: prompt_toolkit>=3.0.0
Dynamic: author
Dynamic: home-page
Dynamic: license-file
Dynamic: requires-python

# ptk-blinkfix

**Blinking cursor fix for Python [`prompt_toolkit`](https://github.com/prompt-toolkit/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 `Application`** widgets.
- 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
```bash
pip install ptk-blinkfix
```

## 📦 Usage
```python
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_block`
- `blinking_underline`
- `blinking_beam`
- `steady_block`
- `steady_underline`
- `steady_beam`

## 📜 License
This project is licensed under the BSD‑3‑Clause License.  
It interacts with [`prompt_toolkit`](https://github.com/prompt-toolkit/python-prompt-toolkit), which is also licensed under BSD‑3‑Clause.  
See [LICENSE](LICENSE) for details.
