Metadata-Version: 2.4
Name: notepad-search
Version: 0.2.1
Summary: Search the text of every open Windows 11 Notepad window and tab, and jump to the match.
Author-email: Dustin Darcy <6962246+djdarcy@users.noreply.github.com>
License-Expression: GPL-3.0-or-later
Project-URL: Homepage, https://github.com/DazzleTools/notepad-search
Project-URL: Repository, https://github.com/DazzleTools/notepad-search
Project-URL: Issues, https://github.com/DazzleTools/notepad-search/issues
Keywords: windows,notepad,search,cli,windows-11
Classifier: Development Status :: 2 - Pre-Alpha
Classifier: Environment :: Console
Classifier: Intended Audience :: End Users/Desktop
Classifier: Operating System :: Microsoft :: Windows
Classifier: Operating System :: Microsoft :: Windows :: Windows 11
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Topic :: Utilities
Requires-Python: >=3.11
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: dazzle-lib>=0.8.2
Requires-Dist: dazzle-filekit>=0.5.3
Requires-Dist: pywin32>=306; sys_platform == "win32"
Requires-Dist: psutil>=5.9.0
Requires-Dist: pywinauto>=0.6.9; sys_platform == "win32"
Provides-Extra: dev
Requires-Dist: pytest>=7.0.0; extra == "dev"
Requires-Dist: pytest-cov>=4.0.0; extra == "dev"
Dynamic: license-file

# notepad-search

[![PyPI](https://img.shields.io/pypi/v/notepad-search?color=green)](https://pypi.org/project/notepad-search/)
[![Release Date](https://img.shields.io/github/release-date/DazzleTools/notepad-search?color=green)](https://github.com/DazzleTools/notepad-search/releases)
[![PyPI Downloads](https://static.pepy.tech/personalized-badge/notepad-search?period=total&units=international_system&left_color=black&right_color=green&left_text=downloads)](https://pypistats.org/packages/notepad-search)
[![CI](https://github.com/DazzleTools/notepad-search/actions/workflows/ci-python.yml/badge.svg)](https://github.com/DazzleTools/notepad-search/actions/workflows/ci-python.yml)
[![Python 3.11+](https://img.shields.io/badge/python-3.11+-blue.svg)](https://www.python.org/downloads/)
[![License: GPL v3](https://img.shields.io/badge/license-GPL%20v3-green.svg)](https://www.gnu.org/licenses/gpl-3.0.html)
[![GitHub Discussions](https://img.shields.io/github/discussions/DazzleTools/notepad-search)](https://github.com/DazzleTools/notepad-search/discussions)
[![Installs](https://img.shields.io/endpoint?url=https://gist.githubusercontent.com/djdarcy/177f8d8e7505a0fa63bf672035e2dedb/raw/installs.json)](https://dazzletools.github.io/notepad-search/stats/#installs)
[![Platform](https://img.shields.io/badge/platform-Windows%2011-lightgrey.svg)](docs/platform-support.md)

Search the text of every open Windows 11 Notepad window and tab, and jump to the match.

`notepad-search` is for people who keep dozens of Notepad windows open as working memory. Type a few words, see which tabs contain them with the surrounding text, and bring the right window to the front. It is a plain, deterministic search in the spirit of grep. No AI is used or needed. It is a companion to [notepad-cleanup](https://github.com/DazzleTools/notepad-cleanup), which saves open tabs to disk. Each tool installs and works on its own.

> **Status: alpha.** Searching, jumping, loading unloaded tabs and minimising work on Windows 11 Notepad; see the [roadmap](ROADMAP.md) for what comes next.

## Installation

```bash
pip install notepad-search
```

From source:

```bash
git clone https://github.com/DazzleTools/notepad-search.git
cd notepad-search
pip install -e ".[dev]"
```

## Usage

```bash
notepad-search raining cats dogs     # tabs containing all three words
notepad-search "cats and dogs"       # a phrase
notepad-search -E 'inv-\d{4}' --any  # regular expressions; --any for any of them
notepad-search -C 2 plumber          # two lines either side instead of the paragraph
notepad-search go 2                  # bring result 2's window to the front
notepad-search --go plumber tuesday  # print the results, and jump if exactly one tab matched
notepad-search show 2                # print result 2's whole tab
notepad-search list                  # every Notepad window and its loaded tabs
notepad-search minimize --except-results   # minimise every Notepad window but the matches
notepad-search --help                # everything else
```

Each result names the window and the tab's first line, shows the matching paragraph with the words highlighted, and the last line says how many tabs were searched and how many were not.

### Tabs Notepad has not loaded

Windows 11 Notepad does not create a tab's text until the tab has been shown, so some tabs cannot be read until each is clicked once. notepad-search can do that for you: `notepad-search --load WORD`, or `notepad-search load` on its own. It always prints a notice and counts down first, because each window comes to the front for a moment and takes the keyboard focus. Choose your default with `notepad-search config load never|ask|always`; `--load` and `--no-load` override it for one run. Once loaded, tabs stay loaded until Notepad restarts.

If Notepad taskbar buttons are left red afterwards, `notepad-search unflash` clears them (again with a notice: each window comes forward for half a second).

Exit codes follow grep: 0 when something matched, 1 when nothing did, 2 on an error.

### Privacy

notepad-search keeps as little as it can between runs, in `%LOCALAPPDATA%\notepad-search\`:

- `last-search.json` -- so `go N` and `show N` work: each result's window handle, the handle of its tab's text area, and the tab's length. **No search words, no window titles, no tab text, and no hash of the text.**
- `last-load.json` -- the windows the last loading pass clicked through, for `unflash`.
- `history.json` -- past search words, **only if you turn it on**: `notepad-search config history 20` keeps the last 20; the default, 0, keeps none. `--no-history` leaves one search out.

`notepad-search forget` deletes all of them (it asks first; `--yes` skips the question). Your settings in `%APPDATA%\notepad-search\config.toml` are kept.

Your shell keeps its own record of the commands you type, including search words: PowerShell in its history file (`(Get-PSReadLineOption).HistorySavePath`), cmd for the life of the window. notepad-search cannot clear that for you.

## Development

Prerequisites:

- Windows 11
- Python 3.11+
- Git

Setup:

```bash
git clone https://github.com/DazzleTools/notepad-search.git
cd notepad-search
python -m venv .venv
source .venv/bin/activate        # Windows: .venv\Scripts\activate
pip install -e ".[dev]"
bash scripts/repokit-common/install-hooks.sh
```

Tests:

```bash
python -m pytest tests/ -v
```

## Contributing

Contributions welcome! Please open an issue or submit a pull request.

See **[CONTRIBUTING.md](CONTRIBUTING.md)** for:
- Development setup
- Running the tests
- Version management with `sync-versions.py`
- Pull request checklist

Like the project?

[!["Buy Me A Coffee"](https://www.buymeacoffee.com/assets/img/custom_images/orange_img.png)](https://www.buymeacoffee.com/djdarcy)

## License

notepad-search, Copyright (C) 2026 Dustin Darcy

Licensed under the GNU General Public License v3.0 or later (GPL-3.0-or-later) -- see [LICENSE](LICENSE).
