main 940af53fa443 cached
342 files
1.9 MB
495.8k tokens
2418 symbols
1 requests
Download .txt
Showing preview only (2,067K chars total). Download the full file or copy to clipboard to get everything.
Repository: prompt-toolkit/python-prompt-toolkit
Branch: main
Commit: 940af53fa443
Files: 342
Total size: 1.9 MB

Directory structure:
gitextract_htk8glhs/

├── .codecov.yml
├── .github/
│   └── workflows/
│       └── test.yaml
├── .gitignore
├── .pre-commit-config.yaml
├── .readthedocs.yml
├── AUTHORS.rst
├── CHANGELOG
├── LICENSE
├── MANIFEST.in
├── PROJECTS.rst
├── README.rst
├── appveyor.yml
├── docs/
│   ├── conf.py
│   ├── index.rst
│   ├── make.bat
│   ├── pages/
│   │   ├── advanced_topics/
│   │   │   ├── architecture.rst
│   │   │   ├── asyncio.rst
│   │   │   ├── filters.rst
│   │   │   ├── index.rst
│   │   │   ├── input_hooks.rst
│   │   │   ├── key_bindings.rst
│   │   │   ├── rendering_flow.rst
│   │   │   ├── rendering_pipeline.rst
│   │   │   ├── styling.rst
│   │   │   └── unit_testing.rst
│   │   ├── asking_for_a_choice.rst
│   │   ├── asking_for_input.rst
│   │   ├── dialogs.rst
│   │   ├── full_screen_apps.rst
│   │   ├── gallery.rst
│   │   ├── getting_started.rst
│   │   ├── printing_text.rst
│   │   ├── progress_bars.rst
│   │   ├── reference.rst
│   │   ├── related_projects.rst
│   │   ├── tutorials/
│   │   │   ├── index.rst
│   │   │   └── repl.rst
│   │   └── upgrading/
│   │       ├── 2.0.rst
│   │       ├── 3.0.rst
│   │       └── index.rst
│   └── requirements.txt
├── examples/
│   ├── choices/
│   │   ├── color.py
│   │   ├── default.py
│   │   ├── frame-and-bottom-toolbar.py
│   │   ├── gray-frame-on-accept.py
│   │   ├── many-choices.py
│   │   ├── mouse-support.py
│   │   ├── simple-selection.py
│   │   └── with-frame.py
│   ├── dialogs/
│   │   ├── button_dialog.py
│   │   ├── checkbox_dialog.py
│   │   ├── input_dialog.py
│   │   ├── messagebox.py
│   │   ├── password_dialog.py
│   │   ├── progress_dialog.py
│   │   ├── radio_dialog.py
│   │   ├── styled_messagebox.py
│   │   └── yes_no_dialog.py
│   ├── full-screen/
│   │   ├── ansi-art-and-textarea.py
│   │   ├── buttons.py
│   │   ├── calculator.py
│   │   ├── dummy-app.py
│   │   ├── full-screen-demo.py
│   │   ├── hello-world.py
│   │   ├── no-layout.py
│   │   ├── pager.py
│   │   ├── scrollable-panes/
│   │   │   ├── simple-example.py
│   │   │   └── with-completion-menu.py
│   │   ├── simple-demos/
│   │   │   ├── alignment.py
│   │   │   ├── autocompletion.py
│   │   │   ├── colorcolumn.py
│   │   │   ├── cursorcolumn-cursorline.py
│   │   │   ├── float-transparency.py
│   │   │   ├── floats.py
│   │   │   ├── focus.py
│   │   │   ├── horizontal-align.py
│   │   │   ├── horizontal-split.py
│   │   │   ├── line-prefixes.py
│   │   │   ├── margins.py
│   │   │   ├── vertical-align.py
│   │   │   └── vertical-split.py
│   │   ├── split-screen.py
│   │   └── text-editor.py
│   ├── gevent-get-input.py
│   ├── print-text/
│   │   ├── ansi-colors.py
│   │   ├── ansi.py
│   │   ├── html.py
│   │   ├── named-colors.py
│   │   ├── print-formatted-text.py
│   │   ├── print-frame.py
│   │   ├── prompt-toolkit-logo-ansi-art.py
│   │   ├── pygments-tokens.py
│   │   └── true-color-demo.py
│   ├── progress-bar/
│   │   ├── a-lot-of-parallel-tasks.py
│   │   ├── colored-title-and-label.py
│   │   ├── custom-key-bindings.py
│   │   ├── many-parallel-tasks.py
│   │   ├── nested-progress-bars.py
│   │   ├── scrolling-task-name.py
│   │   ├── simple-progress-bar.py
│   │   ├── styled-1.py
│   │   ├── styled-2.py
│   │   ├── styled-apt-get-install.py
│   │   ├── styled-rainbow.py
│   │   ├── styled-tqdm-1.py
│   │   ├── styled-tqdm-2.py
│   │   ├── two-tasks.py
│   │   └── unknown-length.py
│   ├── prompts/
│   │   ├── accept-default.py
│   │   ├── asyncio-prompt.py
│   │   ├── auto-completion/
│   │   │   ├── autocomplete-with-control-space.py
│   │   │   ├── autocompletion-like-readline.py
│   │   │   ├── autocompletion.py
│   │   │   ├── colored-completions-with-formatted-text.py
│   │   │   ├── colored-completions.py
│   │   │   ├── combine-multiple-completers.py
│   │   │   ├── fuzzy-custom-completer.py
│   │   │   ├── fuzzy-word-completer.py
│   │   │   ├── multi-column-autocompletion-with-meta.py
│   │   │   ├── multi-column-autocompletion.py
│   │   │   ├── nested-autocompletion.py
│   │   │   └── slow-completions.py
│   │   ├── auto-suggestion.py
│   │   ├── autocorrection.py
│   │   ├── bottom-toolbar.py
│   │   ├── clock-input.py
│   │   ├── colored-prompt.py
│   │   ├── confirmation-prompt.py
│   │   ├── cursor-shapes.py
│   │   ├── custom-key-binding.py
│   │   ├── custom-lexer.py
│   │   ├── custom-vi-operator-and-text-object.py
│   │   ├── enforce-tty-input-output.py
│   │   ├── fancy-zsh-prompt.py
│   │   ├── finalterm-shell-integration.py
│   │   ├── get-input-vi-mode.py
│   │   ├── get-input-with-default.py
│   │   ├── get-input.py
│   │   ├── get-multiline-input.py
│   │   ├── get-password-with-toggle-display-shortcut.py
│   │   ├── get-password.py
│   │   ├── history/
│   │   │   ├── persistent-history.py
│   │   │   └── slow-history.py
│   │   ├── html-input.py
│   │   ├── input-validation.py
│   │   ├── inputhook.py
│   │   ├── mouse-support.py
│   │   ├── multiline-autosuggest.py
│   │   ├── multiline-prompt.py
│   │   ├── no-wrapping.py
│   │   ├── operate-and-get-next.py
│   │   ├── patch-stdout.py
│   │   ├── placeholder-text.py
│   │   ├── regular-language.py
│   │   ├── rprompt.py
│   │   ├── swap-light-and-dark-colors.py
│   │   ├── switch-between-vi-emacs.py
│   │   ├── system-clipboard-integration.py
│   │   ├── system-prompt.py
│   │   ├── terminal-title.py
│   │   ├── up-arrow-partial-string-matching.py
│   │   └── with-frames/
│   │       ├── frame-and-autocompletion.py
│   │       ├── gray-frame-on-accept.py
│   │       └── with-frame.py
│   ├── ssh/
│   │   └── asyncssh-server.py
│   ├── telnet/
│   │   ├── chat-app.py
│   │   ├── dialog.py
│   │   ├── hello-world.py
│   │   └── toolbar.py
│   └── tutorial/
│       ├── README.md
│       └── sqlite-cli.py
├── pyproject.toml
├── src/
│   └── prompt_toolkit/
│       ├── __init__.py
│       ├── application/
│       │   ├── __init__.py
│       │   ├── application.py
│       │   ├── current.py
│       │   ├── dummy.py
│       │   └── run_in_terminal.py
│       ├── auto_suggest.py
│       ├── buffer.py
│       ├── cache.py
│       ├── clipboard/
│       │   ├── __init__.py
│       │   ├── base.py
│       │   ├── in_memory.py
│       │   └── pyperclip.py
│       ├── completion/
│       │   ├── __init__.py
│       │   ├── base.py
│       │   ├── deduplicate.py
│       │   ├── filesystem.py
│       │   ├── fuzzy_completer.py
│       │   ├── nested.py
│       │   └── word_completer.py
│       ├── contrib/
│       │   ├── __init__.py
│       │   ├── completers/
│       │   │   ├── __init__.py
│       │   │   └── system.py
│       │   ├── regular_languages/
│       │   │   ├── __init__.py
│       │   │   ├── compiler.py
│       │   │   ├── completion.py
│       │   │   ├── lexer.py
│       │   │   ├── regex_parser.py
│       │   │   └── validation.py
│       │   ├── ssh/
│       │   │   ├── __init__.py
│       │   │   └── server.py
│       │   └── telnet/
│       │       ├── __init__.py
│       │       ├── log.py
│       │       ├── protocol.py
│       │       └── server.py
│       ├── cursor_shapes.py
│       ├── data_structures.py
│       ├── document.py
│       ├── enums.py
│       ├── eventloop/
│       │   ├── __init__.py
│       │   ├── async_generator.py
│       │   ├── inputhook.py
│       │   ├── utils.py
│       │   └── win32.py
│       ├── filters/
│       │   ├── __init__.py
│       │   ├── app.py
│       │   ├── base.py
│       │   ├── cli.py
│       │   └── utils.py
│       ├── formatted_text/
│       │   ├── __init__.py
│       │   ├── ansi.py
│       │   ├── base.py
│       │   ├── html.py
│       │   ├── pygments.py
│       │   └── utils.py
│       ├── history.py
│       ├── input/
│       │   ├── __init__.py
│       │   ├── ansi_escape_sequences.py
│       │   ├── base.py
│       │   ├── defaults.py
│       │   ├── posix_pipe.py
│       │   ├── posix_utils.py
│       │   ├── typeahead.py
│       │   ├── vt100.py
│       │   ├── vt100_parser.py
│       │   ├── win32.py
│       │   └── win32_pipe.py
│       ├── key_binding/
│       │   ├── __init__.py
│       │   ├── bindings/
│       │   │   ├── __init__.py
│       │   │   ├── auto_suggest.py
│       │   │   ├── basic.py
│       │   │   ├── completion.py
│       │   │   ├── cpr.py
│       │   │   ├── emacs.py
│       │   │   ├── focus.py
│       │   │   ├── mouse.py
│       │   │   ├── named_commands.py
│       │   │   ├── open_in_editor.py
│       │   │   ├── page_navigation.py
│       │   │   ├── scroll.py
│       │   │   ├── search.py
│       │   │   └── vi.py
│       │   ├── defaults.py
│       │   ├── digraphs.py
│       │   ├── emacs_state.py
│       │   ├── key_bindings.py
│       │   ├── key_processor.py
│       │   └── vi_state.py
│       ├── keys.py
│       ├── layout/
│       │   ├── __init__.py
│       │   ├── containers.py
│       │   ├── controls.py
│       │   ├── dimension.py
│       │   ├── dummy.py
│       │   ├── layout.py
│       │   ├── margins.py
│       │   ├── menus.py
│       │   ├── mouse_handlers.py
│       │   ├── processors.py
│       │   ├── screen.py
│       │   ├── scrollable_pane.py
│       │   └── utils.py
│       ├── lexers/
│       │   ├── __init__.py
│       │   ├── base.py
│       │   └── pygments.py
│       ├── log.py
│       ├── mouse_events.py
│       ├── output/
│       │   ├── __init__.py
│       │   ├── base.py
│       │   ├── color_depth.py
│       │   ├── conemu.py
│       │   ├── defaults.py
│       │   ├── flush_stdout.py
│       │   ├── plain_text.py
│       │   ├── vt100.py
│       │   ├── win32.py
│       │   └── windows10.py
│       ├── patch_stdout.py
│       ├── py.typed
│       ├── renderer.py
│       ├── search.py
│       ├── selection.py
│       ├── shortcuts/
│       │   ├── __init__.py
│       │   ├── choice_input.py
│       │   ├── dialogs.py
│       │   ├── progress_bar/
│       │   │   ├── __init__.py
│       │   │   ├── base.py
│       │   │   └── formatters.py
│       │   ├── prompt.py
│       │   └── utils.py
│       ├── styles/
│       │   ├── __init__.py
│       │   ├── base.py
│       │   ├── defaults.py
│       │   ├── named_colors.py
│       │   ├── pygments.py
│       │   ├── style.py
│       │   └── style_transformation.py
│       ├── token.py
│       ├── utils.py
│       ├── validation.py
│       ├── widgets/
│       │   ├── __init__.py
│       │   ├── base.py
│       │   ├── dialogs.py
│       │   ├── menus.py
│       │   └── toolbars.py
│       └── win32_types.py
├── tests/
│   ├── test_async_generator.py
│   ├── test_buffer.py
│   ├── test_cli.py
│   ├── test_completion.py
│   ├── test_document.py
│   ├── test_filter.py
│   ├── test_formatted_text.py
│   ├── test_history.py
│   ├── test_inputstream.py
│   ├── test_key_binding.py
│   ├── test_layout.py
│   ├── test_memory_leaks.py
│   ├── test_print_formatted_text.py
│   ├── test_regular_languages.py
│   ├── test_shortcuts.py
│   ├── test_style.py
│   ├── test_style_transformation.py
│   ├── test_utils.py
│   ├── test_vt100_output.py
│   ├── test_widgets.py
│   └── test_yank_nth_arg.py
├── tools/
│   ├── debug_input_cross_platform.py
│   └── debug_vt100_input.py
└── tox.ini

================================================
FILE CONTENTS
================================================

================================================
FILE: .codecov.yml
================================================
comment: off


================================================
FILE: .github/workflows/test.yaml
================================================
name: test

on:
  push: # any branch
  pull_request:
    branches: [main]

env:
  FORCE_COLOR: 1

jobs:
  test-ubuntu:
    runs-on: ubuntu-latest
    strategy:
      fail-fast: false
      matrix:
        python-version:
          ["3.10", "3.11", "3.12", "3.13", "3.14", "3.14t"]

    steps:
      - uses: actions/checkout@v6.0.2
      - uses: astral-sh/setup-uv@v7
        with:
          python-version: ${{ matrix.python-version }}
      - name: Code formatting
        if: ${{ matrix.python-version == '3.14' }}
        run: |
          uv run ruff check .
          uv run ruff format --check .
      - name: Typos
        if: ${{ matrix.python-version == '3.14' }}
        run: |
          uv run typos .
      - name: Unit test
        run: |
          uv run coverage run -m pytest tests/
      - name: Type Checking
        run: |
          uv run mypy --strict src/ --platform win32
          uv run mypy --strict src/ --platform linux
          uv run mypy --strict src/ --platform darwin
      - name: Run codecov
        run: |
          uv run codecov
      - name: Upload coverage to Codecov
        uses: codecov/codecov-action@v5
        env:
          CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}


================================================
FILE: .gitignore
================================================
*.py[cod]

# C extensions
*.so

# Packages
*.egg
*.egg-info
dist
build
eggs
parts
bin
var
sdist
develop-eggs
.installed.cfg
lib
lib64
__pycache__

# Python 3rd Party
Pipfile*

# Installer logs
pip-log.txt

# Unit test / coverage reports
.coverage
.tox
nosetests.xml
.pytest_cache
coverage.xml

# Translations
*.mo

# Makefile - for those who like that workflow
Makefile

# Mr Developer
.mr.developer.cfg
.project
.pydevproject

# Generated documentation
docs/_build

# pycharm metadata
.idea

# uv
uv.lock

# vscode metadata
.vscode

# virtualenvs
.venv*


================================================
FILE: .pre-commit-config.yaml
================================================
repos:
  - repo: https://github.com/pre-commit/pre-commit-hooks
    rev: "v6.0.0"
    hooks:
      - id: check-case-conflict
      - id: check-executables-have-shebangs
      - id: check-merge-conflict
      - id: check-toml
      - id: detect-private-key
      - id: end-of-file-fixer
      - id: fix-byte-order-marker
      - id: mixed-line-ending
      - id: trailing-whitespace

  - repo: https://github.com/astral-sh/ruff-pre-commit
    rev: "v0.15.6"
    hooks:
      - id: ruff-format
        args: [--config=pyproject.toml]
      - id: ruff-check
        args: [--config=pyproject.toml, --fix, --exit-non-zero-on-fix]

  - repo: https://github.com/crate-ci/typos
    rev: v1.44.0
    hooks:
      - id: typos
        exclude: |
          (?x)^(
            tests/.*
          )$


================================================
FILE: .readthedocs.yml
================================================
version: 2

build:
  os: ubuntu-22.04
  tools:
    python: "3.11"

formats:
  - pdf
  - epub

sphinx:
  configuration: docs/conf.py

python:
  install:
    - requirements: docs/requirements.txt
    - method: pip
      path: .


================================================
FILE: AUTHORS.rst
================================================
Authors
=======

Creator
-------
Jonathan Slenders <jonathan AT slenders.be>

Contributors
------------

- Amjith Ramanujam <amjith.r AT gmail.com>


================================================
FILE: CHANGELOG
================================================
CHANGELOG
=========

3.0.52: 2025-08-27
------------------

New features:
- Add `choice()` shortcut for selecting an option amongst a list of choices
  (see documentation for examples).
- Add support for ANSI dim text formatting.
- Add `frame=...` option for `prompt()` and `choice()` shortcuts to allow for
  displaying a frame around the input prompt.

Fixes:
- Fix button width when non English characters are displayed.
- Implement flushing in Windows VT100 input.
- Fix signal handling for GraalPy.
- Fix handling of zero sized dimensions.

3.0.51: 2025-04-15
------------------

New features:
- Use pyproject.toml instead of setup.py.

Fixes:
- Fix edge case in `formatted_text.split_lines` when the input starts with a
  line ending.

3.0.50: 2025-01-20
------------------

Fixes:
- Fixes non user impacting regression on the output rendering. Don't render
  cursor hide/show ANSI escape codes if not needed.


3.0.49: 2025-01-20
------------------

New features:
- On Windows, use virtual terminal input when available.
- Support for multiline suggestions.

Fixes:
- Handle `InvalidStateError` during termination when using
  `run_in_terminal`/`patch_stdout`. This can happen in some cases during
  cancellation, probably when using anyio.
- Fix cursor that remains in hidden state when the application exits. This can
  happen when the application doesn't show the cursor and `erase_when_done` is
  being used.

Breaking changes:
- Drop support for Python 3.7:


3.0.48: 2024-09-25
------------------

Fixes:
- Typing improvements:
  * Add `@overload` to `contrib.regular_languages.compiler.Variables.get`.
  * Use `Sequence` instead of `list` for `words` argument in completers.
- Improve `ModalCursorShapeConfig`:
  * Display an "underscore" cursor in Vi's "replace single" mode, like
    "replace" mode.
  * Display an "beam" cursor in Emacs (insert) mode.


3.0.47: 2024-06-10
------------------

New features:
- Allow passing exception classes for `KeyboardInterrupt` and `EOFError` in
  `PromptSession`.

Fixes:
- Compute padding parameters for `Box` widget lazily.


3.0.46: 2024-06-04
------------------

Fixes:
- Fix pytest capsys fixture compatibility.


3.0.45: 2024-05-28
------------------

Fixes:
- Improve performance of `GrammarCompleter` (faster deduplication of completions).


3.0.44: 2024-05-27
------------------

New features:
- Accept `os.PathLike` in `FileHistory` (typing fix).

Fixes:
- Fix memory leak in filters.
- Improve performance of progress bar formatters.
- Fix compatibility when a SIGINT handler is installed by non-Python (Rust, C).
- Limit number of completions in buffer to 10k by default (for performance).


3.0.43: 2023-12-13
------------------

Fixes:
- Fix regression on Pypy: Don't use `ctypes.pythonapi` to restore SIGINT if not
  available.


3.0.42: 2023-12-12
------------------

Fixes:
- Fix line wrapping in `patch_stdout` on Windows.
- Make `formatted_text.split_lines()` accept an iterable instead of lists only.
- Disable the IPython workaround (from 3.0.41) for IPython >= 8.18.
- Restore signal.SIGINT handler between prompts.


3.0.41: 2023-11-14
------------------

Fixes:
- Fix regression regarding IPython input hook (%gui) integration.

3.0.40: 2023-11-10
------------------

Fixes:
- Improved Python 3.12 support (fixes event loop `DeprecationWarning`).

New features:
- Vi key bindings: `control-t` and `control-d` for indent/unindent in insert
  mode.
- Insert partial suggestion when `control+right` is pressed, similar to Fish.
- Use sphinx-nefertiti theme for the docs.


3.0.39: 2023-07-04
------------------

Fixes:
- Fix `RuntimeError` when `__breakpointhook__` is called from another thread.
- Fix memory leak in filters usage.
- Ensure that key bindings are handled in the right context (when using
  contextvars).

New features:
- Accept `in_thread` keyword in `prompt_toolkit.shortcuts.prompt()`.
- Support the `NO_COLOR` environment variable.


3.0.38: 2023-02-28
------------------

Fixes:
- Fix regression in filters. (Use of `WeakValueDictionary` caused filters to
  not be cached).

New features:
- Use 24-bit true color now by default on Windows 10/11.


3.0.37: 2023-02-21
------------------

Bug fixes:
- Fix `currentThread()` deprecation warning.
- Fix memory leak in filters.
- Make VERSION tuple numeric.

New features:
- Add `.run()` method in `TelnetServer`. (To be used instead of
  `.start()/.stop()`.

Breaking changes:
- Subclasses of `Filter` have to call `super()` in their `__init__`.
- Drop support for Python 3.6:
  * This includes code cleanup for Python 3.6 compatibility.
  * Use `get_running_loop()` instead of `get_event_loop()`.
  * Use `asyncio.run()` instead of `asyncio.run_until_complete()`.


3.0.36: 2022-12-06
------------------

Fixes:
- Another Python 3.6 fix for a bug that was introduced in 3.0.34.


3.0.35: 2022-12-06
------------------

Fixes:
- Fix bug introduced in 3.0.34 for Python 3.6. Use asynccontextmanager
  implementation from prompt_toolkit itself.


3.0.34: 2022-12-06
------------------

Fixes:
- Improve completion performance in various places.
- Improve renderer performance.
- Handle `KeyboardInterrupt` when the stacktrace of an unhandled error is
  displayed.
- Use correct event loop in `Application.create_background_task()`.
- Fix `show_cursor` attribute in `ScrollablePane`.


3.0.33: 2022-11-21
------------------

Fixes:
- Improve termination of `Application`. Don't suppress `CancelledError`. This
  fixes a race condition when an `Application` gets cancelled while we're
  waiting for the background tasks to complete.
- Fixed typehint for `OneStyleAndTextTuple`.
- Small bugfix in `CombinedRegistry`. Fixed missing `@property`.


3.0.32: 2022-11-03
------------------

Bug fixes:
- Use `DummyInput` by default in `create_input()` if `sys.stdin` does not have
  a valid file descriptor. This fixes errors when `sys.stdin` is patched in
  certain situations.
- Fix control-c key binding for `ProgressBar` when the progress bar was not
  created from the main thread. The current code would try to kill the main
  thread when control-c was pressed.

New features:
- Accept a `cancel_callback` in `ProgressBar` to specify the cancellation
  behavior for when `control-c` is pressed.
- Small performance improvement in the renderer.


3.0.31: 2022-09-02
------------------

New features:
- Pass through `name` property in `TextArea` widget to `Buffer`.
- Added a `enable_cpr` parameter to `Vt100_Output`, `TelnetServer` and
  `PromptToolkitSSHServer`, to completely disable CPR support instead of
  automatically detecting it.


3.0.30: 2022-06-27
------------------

New features:
- Allow zero-width-escape sequences in `print_formatted_text`.
- Add default value option for input dialog.
- Added `has_suggestion` filter.

Fixes:
- Fix rendering of control-shift-6 (or control-^). Render as '^^'
- Always wrap lines in the Label widget by default.
- Fix enter key binding in system toolbar in Vi mode.
- Improved handling of stdout objects that don't have a 'buffer' attribute. For
  instance, when using `renderer_print_formatted_text` in a Jupyter Notebook.


3.0.29: 2022-04-04
------------------

New features:
- Accept 'handle_sigint' parameter in PromptSession.

Fixes
- Fix 'variable referenced before assignment' error in vt100 mouse bindings.
- Pass `handle_sigint` from `Application.run` to `Application.run_async`.
- Fix detection of telnet client side changes.
- Fix `print_container` utility (handle `EOFError`).

Breaking changes:
- The following are now context managers:
  `create_pipe_input`, `PosixPipeInput` and `Win32PipeInput`.


3.0.28: 2022-02-11
------------------

New features:
- Support format specifiers for HTML and ANSI formatted text.
- Accept defaults for checkbox and radio list, and their corresponding dialogs.

Fixes:
- Fix resetting of cursor shape after the application terminates.


3.0.27: 2022-02-07
------------------

New features:
- Support for cursor shapes. The cursor shape for prompts/applications can now
  be configured, either as a fixed cursor shape, or in case of Vi input mode,
  according to the current input mode.
- Handle "cursor forward" command in ANSI formatted text. This makes it
  possible to render many kinds of generated ANSI art.
- Accept `align` attribute in `Label` widget.
- Added `PlainTextOutput`: an output implementation that doesn't render any
  ANSI escape sequences. This will be used by default when redirecting stdout
  to a file.
- Added `create_app_session_from_tty`: a context manager that enforces
  input/output to go to the current TTY, even if stdin/stdout are attached to
  pipes.
- Added `to_plain_text` utility for converting formatted text into plain text.

Fixes:
- Don't automatically use `sys.stderr` for output when `sys.stdout` is not a
  TTY, but `sys.stderr` is. The previous behavior was confusing, especially
  when rendering formatted text to the output, and we expect it to follow
  redirection.

3.0.26: 2022-01-27
------------------

Fixes:
- Fixes issue introduced in 3.0.25: Don't handle SIGINT on Windows.


3.0.25: 2022-01-27
------------------

Fixes:
- Use `DummyOutput` when `sys.stdout` is `None` and `DummyInput` when
  `sys.stdin` is `None`. This fixes an issue when the code runs on windows,
  using pythonw.exe and still tries to interact with the terminal.
- Correctly reset `Application._is_running` flag in case of exceptions in some
  situations.
- Handle SIGINT (when sent from another process) and allow binding it to a key
  binding. For prompt sessions, the behavior is now identical to pressing
  control-c.
- Increase the event loop `slow_duration_callback` by default to 0.5. This
  prevents printing warnings if rendering takes too long on slow systems.


3.0.24: 2021-12-09
------------------

Fixes:
- Prevent window content overflowing when using scrollbars.
- Handle `PermissionError` when trying to attach /dev/null in vt100 input.


3.0.23: 2021-11-26
------------------

Fixes:
- Fix multiline bracketed paste on Windows

New features:
- Add support for some CSI 27 modified variants of "Enter" for xterm in the
  vt100 input parser.


3.0.22: 2021-11-04
------------------

Fixes:
- Fix stopping of telnet server (capture cancellation exception).


3.0.21: 2021-10-21
------------------

New features:
- Improved mouse support:
  * Support for click-drag, which is useful for selecting text.
  * Detect mouse movements when no button is pressed.
- Support for Python 3.10.


3.0.20: 2021-08-20
------------------

New features:
- Add support for strikethrough text attributes.
- Set up custom breakpointhook while an application is running (if no other
  breakpointhook was installed). This enhances the usage of PDB for debugging
  applications.
- Strict type checking is now enabled.

Fixes:
- Ensure that `print_formatted_text` is always printed above the running
  application, like `patch_stdout`. (Before, `patch_stdout` was even completely
  ignored in case of `print_formatted_text, so there was no proper way to use
  it in a running application.)
- Fix handling of non-bmp unicode input on Windows.
- Set minimum Python version to 3.6.2 (Some 3.6.2 features were used).


3.0.19: 2021-06-17
------------------

Fixes:
- Make the flush method of the vt100 output implementation re-entrant (fixes an
  issue when using aiogevent).
- Fix off-by-one in `FormattedTextControl` mouse logic.
- Run `print_container` always in a thread (avoid interfering with possible
  event loop).
- Make sphinx autodoc generation platform agnostic (don't import Windows stuff
  when generating Sphinx docs).


3.0.18: 2021-03-22
------------------

New features:
- Added `in_thread` parameter to `Application.run`.
  This is useful for running an application in a background thread, while the
  main thread blocks. This way, we are sure not to interfere with an event loop
  in the current thread. (This simplifies some code in ptpython and fixes an
  issue regarding leaking file descriptors due to not closing the event loop
  that was created in this background thread.)


3.0.17: 2021-03-11
------------------

New features:
- Accept `style` parameter in `print_container` utility.
- On Windows, handle Control-Delete.

Fixes:
- Avoid leaking file descriptors in SSH server.


3.0.16: 2021-02-11
------------------

New features:
- Added `ScrollablePane`: a scrollable layout container.
  This allows applications to build a layout, larger than the terminal, with a
  vertical scroll bar. The vertical scrolling will be done automatically when
  certain widgets receive the focus.
- Added `DeduplicateCompleter and `ConditionalCompleter`.
- Added `deduplicate` argument to `merge_completers`.


3.0.15: 2021-02-10
------------------

Fixes:
- Set stdout blocking when writing in vt100 output. Fixes an issue when uvloop
  is used and big amounts of text are written.
- Guarantee height of at least 1 for both labels and text areas.
- In the `Window` rendering, take `dont_extend_width`/`dont_extend_height` into
  account. This fixes issues where one window is enlarged unexpectedly because
  it's bundled with another window in a `HSplit`/`VSplit`, but with different
  width/height.
- Don't handle `SIGWINCH` in progress bar anymore. (The UI runs in another
  thread, and we have terminal size polling now).
- Fix several thread safety issues and a race condition in the progress bar.
- Fix thread safety issues in `Application.invalidate()`. (Fixes a
  `RuntimeError` in some situations when using progress bars.)
- Fix handling of mouse events on Windows if we have a Windows 10 console with
  ANSI support.
- Disable `QUICK_EDIT_MODE` on Windows 10 when mouse support is requested.


3.0.14: 2021-01-24
------------------

New features:
- Disable bell when `PROMPT_TOOLKIT_BELL=false` environment variable has been
  set.

Fixes:
- Improve cancellation of history loading.


3.0.13: 2021-01-21
------------------

Fixes:
- Again, fixed the race condition in `ThreadedHistory`. Previous fix was not
  correct.


3.0.12: 2021-01-21
------------------

Fixes:
- Fixed a race condition in `ThreadedHistory` that happens when continuously
  pasting input text (which would continuously repopulate the history).
- Move cursor key mode resetting (for vt100 terminals) to the renderer. (Mostly
  cleanup).


3.0.11: 2021-01-20
------------------

New features:
- Poll terminal size: better handle resize events when the application runs in
  a thread other than the main thread (where handling SIGWINCH doesn't work) or
  in the Windows console.

Fixes:
- Fix bug in system toolbar. The execution of system commands was broken.
- A refactoring of patch_stdout that includes several fixes.
  * We know look at the `AppSession` in order to see which application is
    running, rather then looking at the event loop which is installed when
    `StdoutProxy` is created. This way, `patch_stdout` will work when
    prompt_toolkit applications with a different event loop run.
  * Fix printing when no application/event loop is running.
  * Fixed the `raw` argument of `PatchStdout`.
- A refactoring of the `ThreadedHistory`, which includes several fixes, in
  particular a race condition (see issue #1158) that happened when editing
  input while a big history was still being loaded in the background.


3.0.10: 2021-01-08
------------------

New features:
- Improved `WordCompleter`: accept `display_dict`. Also accept formatted text
  for both `display_dict` and `meta_dict`.
- Allow customization of button arrows.

Fixes:
- Correctly recognize backtab on Windows.
- Show original display text in fuzzy completer if no filtering was done.


3.0.9: 2021-01-05
-----------------

New features:
- Handle c-tab for TERM=linux.

Fixes:
- Improve rendering speed of `print_formatted_text`. (Don't render styling
  attributes to output between fragments that have identical styling.)
- Gracefully handle `FileHistory` decoding errors.
- Prevent asyncio deprecation warnings.


3.0.8: 2020-10-12
-----------------

New features:
- Added `validator` parameter to `input_dialog`.

Fixes:
- Cope with stdout not having a working `fileno`.
- Handle situation when /dev/null is piped into stdin, or when stdin is closed
  somehow.
- Fix for telnet/ssh server: `isatty` method was not implemented.
- Display correct error when a tuple is passed into `to_formatted_text`.
- Pass along WORD parameter in `Document._is_word_before_cursor_complete`.
  Fixes some key bindings.
- Expose `ProgressBarCounter` in shortcuts module.


3.0.7: 2020-08-29
-----------------

New features:
- New "placeholder" parameter added to `PromptSession`.

Other changes:
- The "respond to CPR" logic has been moved from the `Input` to `Output`
  classes (this does clean up some code).

Fixes:
- Bugfix in shift-selection key bindings.
- Fix height calculation of `FormattedTextControl` when line wrapping is turned
  on.
- Fixes for SSH server:
  * Missing encoding property.
  * Fix failure in "set_line_mode" call.
  * Handle `BrokenPipeError`.


3.0.6: 2020-08-10
-----------------

New features:
- The SSH/Telnet adaptors have been refactored and improved in several ways.
  See issues #876 and PR #1150 and #1184 on GitHub.
  * Handle terminal types for both telnet and SSH sessions.
  * Added pipe input abstraction. (base class for `PosixPipeInput` and
    `Win32PipeInput`).
  * The color depth logic has been refactored and moved to the `Output`
    implementations. Added `get_default_color_depth` method to `Output`
    objects.
  * All line feet are now preceded by a carriage return in the telnet
    connection stdout.
- Introduce `REPLACE_SINGLE` input mode for Vi key bindings.
- Improvements to the checkbox implementation:
    * Hide the scrollbar for a single checkbox.
    * Added a "checked" setter to the checkbox.
- Expose `KeyPressEvent` in key_binding/__init__.py (often used in type
  annotations).
- The renderer has been optimized so that no trailing spaces are generated
  (this improves copying in some terminals).

Fixes:
- Ignore F21..F24 key bindings by default.
- Fix auto_suggest key bindings when suggestion text is empty.
- Bugfix in SIGWINCH handling.
- Handle bug in HSplit/VSplit when the number of children is zero.
- Bugfix in CPR handling in renderer. Proper cancellation of pending tasks.
- Ensure rprompt aligns with input.
- Use `sys.stdin.encoding` for decoding stdin stream.


3.0.5: 2020-03-26
-----------------

Fixes:
- Bugfix in mouse handling on Windows.


3.0.4: 2020-03-06
-----------------

New features:
- Added many more vt100 ANSI sequences and keys.
- Improved control/shift key support in Windows.
- No Mypy errors in prompt_toolkit anymore.
- Added `set_exception_handler` optional argument to `PromptSession.prompt()`.

Fixes:
- Bugfix in invalidate code. `PromptSession` was invalidating the UI
  continuously.
- Add uvloop support (was broken due to an issue in our `call_soon_threadsafe`).
- Forwarded `set_exception_handler` in `Application.run` to the `run_async` call.
- Bugfix in `NestedCompleter` when there is a leading space.

Breaking changes:
- `ShiftControl` has been replaced with `ControlShift` and `s-c` with `c-s` in
  key bindings. Aliases for backwards-compatibility have been added.


3.0.3: 2020-01-26
-----------------

New features:
- Improved support for "dumb" terminals.
- Added support for new keys (vt100 ANSI sequences): Alt +
  home/end/page-up/page-down/insert.
- Better performance for the "regular languages compiler". Generate fewer and
  better regular expressions. This should improve the start-up time for
  applications using this feature.
- Better detection of default color depth.
- Improved the progress bar:
  * Set "time left" to 0 when done or stopped.
  * Added `ProgressBarCounter.stopped`.
- Accept callables for `scroll_offset`, `min_brightness` and `max_brightness`.
- Added `always_prefer_tty` parameters to `create_input()` and `create_output()`.
- Create a new event loop in `Application.run()` if `get_event_loop()` raises
  `Runtimeerror`.

Fixes:
- Correct cancellation of flush timers for input. (Fixes resource leak where
  too many useless coroutines were created.)
- Improved the Win32 input event loop. This fixes a bug where the
  prompt_toolkit application is stopped by something other than user input. (In
  that case, the application would hang, waiting for input.) This also fixes a
  `RuntimeError` in the progress bar code.
- Fixed `line-number.current` style. (was `current-line-number`.)
- Handle situation where stdout is no longer a tty (fix bug in `get_size`).
- Fix parsing of true color in ANSI strings.
- Ignore `invalidate()` if the application is not running.


3.0.2: 2019-11-30
-----------------

Fixes:
- Bugfix in the UI invalidation. Fixes an issue when the application runs again
  on another event loop.
  See: https://github.com/ipython/ipython/pull/11973


3.0.1: 2019-11-28
-----------------

New features:
- Added `new_eventloop_with_inputhook` function.
- Set exception handler from within `Application.run_async`.
- Applied Black code style.

Fixes:
- No longer expect a working event loop in the `History` classes.
  (Fix for special situations when a `ThreadedHistory` is created before the
  event loop has been set up.)
- Accept an empty prompt continuation.
- A few fixes to the `Buffer` tempfile code.


3.0.0: 2019-11-24
-----------------

New features:
- (almost) 100% type annotated.
- Native asyncio instead of custom event loops.
- Added shift-based text selection (use shift+arrows to start selecting text).

Breaking changes:
- Python 2 support has been dropped. Minimal Python version is now 3.6,
  although 3.7 is preferred (because of ContextVars).
- Native asyncio, so some async code becomes slightly different.
- The active `Application` became a contextvar. Which means that it should be
  propagated correctly to the code that requires it. However, random other
  threads or coroutines won't be able to know what the current application is.
- The dialog shortcuts API changed. All dialog functions now return an
  `Application`. You still have to call either `run()` or `run_async` on the
  `Application` object.
- The way inputhooks work is changed.
- `patch_stdout` now requires an `Application` as input.


2.0.9: 2019-02-19
-----------------

Bug fixes:
- Fixed `Application.run_system_command` on Windows.
- Fixed bug in ANSI text formatting: correctly handle 256/true color sequences.
- Fixed bug in WordCompleter. Provide completions when there's a space before
  the cursor.


2.0.8: 2019-01-27
-----------------

Bug fixes:
- Fixes the issue where changes made to the buffer in the accept handler were
  not reflected in the history.
- Fix in the application invalidate handler. This prevents a significant slow
  down in some applications after some time (especially if there is a refresh
  interval).
- Make `print_container` utility work if the input is not a pty.

New features:
- Underline non breaking spaces instead of rendering as '&'.
- Added mouse support for radio list.
- Support completion styles for `READLINE_LIKE` display method.
- Accept formatted text in the display text of completions.
- Added a `FuzzyCompleter` and `FuzzyWordCompleter`.
- Improved error handling in Application (avoid displaying a meaningless
  AssertionError in many cases).


2.0.7: 2018-10-30
-----------------

Bug fixes:
- Fixed assertion in PromptSession: the style_transformation check was wrong.
- Removed 'default' attribute in PromptSession. Only ask for it in the
  `prompt()` method. This fixes the issue that passing `default` once, will
  store it for all consequent calls in the `PromptSession`.
- Ensure that `__pt_formatted_text__` always returns a `FormattedText`
  instance. This fixes an issue with `print_formatted_text`.

New features:
- Improved handling of situations where stdin or stdout are not a terminal.
  (Print warning instead of failing with an assertion.)
- Added `print_container` utility.
- Sound bell when attempting to edit read-only buffer.
- Handle page-down and page-up keys in RadioList.
- Accept any `collections.abc.Sequence` for HSplit/VSplit children (instead of
  lists only).
- Improved Vi key bindings: return to navigation mode when Insert is pressed.


2.0.6: 2018-10-12
-----------------

Bug fixes:
- Don't use the predefined ANSI colors for colors that are defined as RGB.
  (Terminals can assign different color schemes for ansi colors, and we don't
  want use any of those for colors that are defined like #aabbcc for instance.)
- Fix in handling of CPRs when patch_stdout is used.

Backwards incompatible changes:
- Change to the `Buffer` class. Reset the buffer unless the `accept_handler`
  returns `True` (which means: "keep_text"). This doesn't affect applications
  that use `PromptSession`.

New features:
- Added `AdjustBrightnessStyleTransformation`. This is a simple style
  transformation that improves the rendering on terminals with light or dark
  background.
- Improved performance (string width caching and line height calculation).
- Improved `TextArea`:
  * Exposed `focus_on_click`.
  * Added attributes: `auto_suggest`, `complete_while_typing`, `history`,
    `get_line_prefix`, `input_processors`.
  * Made attributes writable: `lexer`, `completer`, `complete_while_typing`,
    `accept_handler`, `read_only`, `wrap_lines`.

2.0.5: 2018-09-30
-----------------

Bug fixes:
- Fix in `DynamicContainer`. Return correct result for `get_children`. This
  fixes a bug related to focusing.
- Properly compute length of `start`, `end` and `sym_b` characters of
  progress bar.
- CPR (cursor position request) fix.

Backwards incompatible changes:
- Stop restoring `PromptSession` attributes when exiting prompt.

New features:
- Added `get_line_prefix` attribute to window. This opens many
  possibilities:
  * Line wrapping (soft and hard) can insert whitespace in front
    of the line, or insert some symbols in front. Like the Vim "breakindent"
    option.
  * Single line prompts also support line continuations now.
  * Line continuations can have a variable width.
- For VI mode: implemented temporary normal mode (control-O in insert mode).
- Added style transformations API. Useful for swapping between light and
  dark color schemes. Added `swap_light_and_dark_colors` parameter to
  `prompt()` function.
- Added `format()` method to ANSI formatted text.
- Set cursor position for Button widgets.
- Added `pre_run` argument to `PromptSession.prompt()` method.


2.0.4: 2018-07-22
-----------------

Bug fixes:
- Fix render height for rendering full screen applications in Windows.
- Fix in `TextArea`. Set `accept_handler` to `None` if not given.
- Go to the beginning of the next line when enter is pressed in Vi navigation
  mode, and the buffer doesn't have an accept handler.
- Fix the `default` argument of the `prompt` function when called multiple
  times.
- Display decomposed multiwidth characters correctly.
- Accept `history` in `prompt()` function again.

Backwards incompatible changes:
- Renamed `PipeInput` to `PosixPipeInput`. Added `Win32PipeInput` and
  `create_input_pipe`.
- Pass `buffer` argument to the `accept_handler` of `TextArea`.

New features:
- Added `accept_default` argument to `prompt()`.
- Make it easier to change the body/title of a Frame/Dialog.
- Added `DynamicContainer`.
- Added `merge_completers` for merging multiple completers together.
- Add vt100 data to key presses in Windows.
- Handle left/right key bindings in Vi block insert mode.


2.0.3: 2018-06-08
-----------------

Bug fixes:
- Fix in 'x' and 'X' Vi key bindings. Correctly handle line endings and args.
- Fixed off by one error in Vi line selection.
- Fixed bugs in Vi block selection. Correctly handle lines that the selection
  doesn't cross.
- Python 2 bugfix. Handle str/unicode correctly.
- Handle option+left/right in iTerm.


2.0.2: 2018-06-03
-----------------

Bug fixes:
- Python 3.7 support: correctly handle StopIteration in asynchronous generator.
- Fixed off-by-one bug in Vi visual block mode.
- Bugfix in TabsProcessor: handle situations when the cursor is at the end of
  the line.


2.0.1: 2018-06-02
-----------------

Version 2.0 includes a big refactoring of the internal architecture. This
includes the merge of the CommandLineInterface and the Application object, a
rewrite of how user controls are focused, a rewrite of how event loops work
and the removal of the buffers dictionary. This introduces many backwards
incompatible changes, but the result is a very nice and powerful architecture.

Most architectural changes effect full screen applications. For applications
that use `prompt_toolkit.shortcuts` for simple prompts, there are fewer
incompatibilities.

Changes:

- No automatic translation from \r into \n during the input processing. These
  are two different keys that can be handled independently. This is a big
  backward-incompatibility, because the `Enter` key is `ControlM`, not
  `ControlJ`. So, now that we stopped translating \r into \n, it could be that
  custom key bindings for `Enter` don't work anymore. Make sure to bind
  `Keys.Enter` instead of `Keys.ControlJ` for handling the `Enter` key.

- The `CommandLineInterface` and the `Application` classes are merged. First,
  `CommandLineInterface` contained all the I/O objects (like the input, output
  and event loop), while the `Application` contained everything else. There was
  no practical reason to keep this separation. (`CommandLineInterface` was
  mostly a proxy to `Application`.)

  A consequence is that almost all code which used to receive a
  `CommandLineInterface`, will now use an `Application`. Usually, where we
  had an attribute `cli`, we'll now have an attribute `app`.

  Secondly, the `Application` object is no longer passed around. The `get_app`
  function can be used at any time to acquire the active application.

  (For backwards-compatibility, we have aliases to the old names, whenever
  possible.)

- prompt_toolkit no longer depends on Pygments, but it can still use Pygments
  for its color schemes and lexers. In many places we used Pygments "Tokens",
  this has been replaced by the concept of class names, somewhat similar to
  HTML and CSS.

  * `PygmentsStyle` and `PygmentsLexer` adaptors are available for
     plugging in Pygments styles and lexers.

  * Wherever we had a list of `(Token, text)` tuples, we now have lists of
    `(style_string, text)` tuples. The style string can contain both inline
    styling as well as refer to a class from the style sheet. `PygmentsTokens`
    is an adaptor that converts a list of Pygments tokens into a list of
    `(style_string, text)` tuples.

- Changes in the `Style` classes.

  * `style.from_dict` does not exist anymore. Instantiate the ``Style`` class
    directory to create a new style. ``Style.from_dict`` can be used to create
    a style from a dictionary, where the dictionary keys are a space separated
    list of class names, and the values, style strings (like before).

  * `print_tokens` was renamed to `print_formatted_text`.

  * In many places in the layout, we accept a parameter named `style`. All the
    styles from the layout hierarchy are combined to decide what style to be
    used.

  * The ANSI color names were confusing and inconsistent with common naming
    conventions. This has been fixed, but aliases for the original names were
    kept.

- The way focusing works is different. Before it was always a `Buffer` that
  was focused, and because of that, any visible `BufferControl` that contained
  this `Buffer` would be focused. Now, any user control can be focused. All
  of this is handled in the `Application.layout` object.

- The `buffers` dictionary (`CommandLineInterface.buffers`) does not exist
  anymore. Further, `buffers` was a `BufferMapping` that keeps track of which
  buffer has the focus. This significantly reduces the freedom for creating
  complex applications. We wanted to move toward a layout that can be defined
  as a (hierarchical) collection of user widgets. A user widget does not need
  to have a `Buffer` underneath and any widget should be focusable.

  * `layout.Layout` was introduced to contain the root layout widget and keep
    track of the focus.

- The key bindings were refactored. It became much more flexible to combine
  sets of key bindings.

  * `Registry` has been renamed to `KeyBindings`.
  * The `add_binding` function has been renamed to simply `add`.
  * Every `load_*` function returns one `KeyBindings` objects, instead of
    populating an existing one, like before.
  * `ConditionalKeyBindings` was added. This can be used to enable/disable
    all the key bindings from a given `Registry`.
  * A function named `merge_key_bindings` was added. This takes a list of
    `KeyBindings` and merges them into one.
  * `key_binding.defaults.load_key_bindings` was added to load all the key
    bindings.
  * `KeyBindingManager` has been removed completely.
  * `input_processor` was renamed to `key_processor`.

  Further:

  * The `Key` class does not exist anymore. Every key is a string and it's
    considered fine to use string literals in the key bindings. This is more
    readable, but we still have run-time validation. The `Keys` enum still
    exist (for backwards-compatibility, but also to have an overview of which
    keys are supported.)
  * 'enter' and 'tab' are key aliases for 'c-m' and 'c-i'.

- User controls can define key bindings, which are active when the user control
  is focused.

  * `UIControl` got a `get_key_bindings` (abstract) method.

- Changes in the layout engine:

  * `LayoutDimension` was renamed to `Dimension`.
  * `VSplit` and `HSplit` now take a `padding` argument.
  * `VSplit` and `HSplit` now take an `align` argument.
    (TOP/CENTER/BOTTOM/JUSTIFY) or (LEFT/CENTER/RIGHT/JUSTIFY).
  * `Float` now takes `allow_cover_cursor` and `attach_to_window` arguments.
  * `Window` got an `WindowAlign` argument. This can be used for the alignment
    of the content. `TokenListControl` (renamed to `FormattedTextControl`) does
    not have an alignment argument anymore.
  * All container objects, like `Window`, got a `style` argument. The style for
    parent containers propagate to child containers, but can be overridden.
    This is in particular useful for setting a background color.
  * `FillControl` does not exist anymore. Use the `style` and `char` arguments
    of the `Window` class instead.
  * `DummyControl` was added.
  * The continuation function of `PromptMargin` now takes `line_number` and
    `is_soft_wrap` as input.

- Changes to `BufferControl`:

  * The `InputProcessor` class has been refactored. The `apply_transformation`
    method should now takes a `TransformationInput` object as input.

  * The text `(reverse-i-search)` is now displayed through a processor. (See
    the `shortcuts` module for an example of its usage.)

- `widgets` and `dialogs` modules:

  * A small collection of widgets was added. These are more complex collections
    of user controls that are ready to embed in a layout. A `shortcuts.dialogs`
    module was added as a high level API for displaying input, confirmation and
    message dialogs.

  * Every class that exposes a ``__pt_container__`` method (which is supposed
    to return a ``Container`` instance) is considered a widget. The
    ``to_container`` shortcut will call this method in situations where a
    ``Container`` object is expected. This avoids inheritance from other
    ``Container`` types, but also having to unpack the container object from
    the widget, in case we would have used composition.

  * Warning: The API of the widgets module is not considered stable yet, and
    can change is the future, if needed.

- Changes to `Buffer`:

  * A `Buffer` no longer takes an `accept_action`.  Both `AcceptAction` and
    `AbortAction` have been removed. Instead it takes an `accept_handler`.

- Changes regarding auto completion:

  * The left and right arrows now work in the multi-column auto completion
    menu.
  * By default, autocompletion is synchronous. The completer needs to be
    wrapped in `ThreadedCompleter` in order to get asynchronous autocompletion.
  * When the completer runs in a background thread, completions will be
    displayed as soon as they are generated. This means that we don't have to
    wait for all the completions to be generated, before displaying the first
    one. The completion menus are updated as soon as new completions arrive.

- Changes regarding input validation:

  * Added the `Validator.from_callable` class method for easy creation of
    new validators.

- Changes regarding the `History` classes:

  * The `History` base class has a different interface. This was needed for
    asynchronous loading of the history. `ThreadedHistory` was added for this.

- Changes related to `shortcuts.prompt`:

  * There is now a class `PromptSession` which also has a method `prompt`. Both
    the class and the method take about the same arguments. This can be used to
    create a session. Every `prompt` call of the same instance will reuse all
    the arguments given to the class itself.

    The input history is always shared during the entire session.

    Of course, it's still possible to call the global `prompt` function. This
    will create a new `PromptSession` every time when it's called.

  * The `prompt` function now takes a `key_bindings` argument instead of
    `key_bindings_registry`. This should only contain the additional bindings.
    (The default bindings are always included.)

- Changes to the event loops:

  * The event loop API is now closer to how asyncio works. A prompt_toolkit
    `Application` now has a `Future` object. Calling the `.run_async()` method
    creates and returns that `Future`. An event loop has a `run_until_complete`
    method that takes a future and runs the event loop until the Future is set.

    The idea is to be able to transition easily to asyncio when Python 2
    support can be dropped in the future.

  * `Application` still has a method `run()` that underneath still runs the
    event loop until the `Future` is set and returns that result.

  * The asyncio adaptors (like the asyncio event loop integration) now require
    Python 3.5. (We use the async/await syntax internally.)

  * The `Input` and `Output` classes have some changes. (Not really important.)

  * `Application.run_sub_applications` has been removed. The alternative is to
    call `run_coroutine_in_terminal` which returns a `Future`.

- Changes to the `filters` module:

  * The `Application` is no longer passed around, so both `CLIFilter` and
    `SimpleFilter` were merged into `Filter`. `to_cli_filter` and
    `to_simple_filter` became `to_filter`.

  * All filters have been turned into functions. For instance, `IsDone`
    became `is_done` and `HasCompletions` became `has_completions`.

    This was done because almost all classes were called without any arguments
    in the `__init__` causing additional braces everywhere. This means that
    `HasCompletions()` has to be replaced by `has_completions` (without
    parenthesis).

    The few filters that took arguments as input, became functions, but still
    have to be called with the given arguments.

    For new filters, it is recommended to use the `@Condition` decorator,
    rather then inheriting from `Filter`.

- Other renames:

  * `IncrementalSearchDirection` was renamed to `SearchDirection`.
  * The `use_alternate_screen` parameter has been renamed to `full_screen`.
  * `Buffer.initial_document` was renamed to `Buffer.document`.
  * `TokenListControl` has been renamed to `FormattedTextControl`.
  * `Application.set_return_value` has been renamed to `Application.set_result`.

- Other new features:

  * `DummyAutoSuggest` and `DynamicAutoSuggest` were added.
  * `DummyClipboard` and `DynamicClipboard` were added.
  * `DummyCompleter` and `DynamicCompleter` were added.
  * `DummyHistory` and `DynamicHistory` was added.

  * `to_container` and `to_window` utilities were added.


1.0.9: 2016-11-07
-----------------

Fixes:
- Fixed a bug in the `cooked_mode` context manager. This caused a bug in
  ptpython where executing `input()` would display ^M instead of accepting the
  input.
- Handle race condition in eventloop/posix.py
- Updated ANSI color names for vt100. (High and low intensity colors were
  swapped.)

New features:
- Added yank-nth-arg and yank-last-arg readline commands + Emacs bindings.
- Allow searching in Vi selection mode.
- Made text objects of the Vi 'n' and 'N' search bindings. This adds for
  instance the following bindings: cn, cN, dn, dN, yn, yN

1.0.8: 2016-10-16
-----------------

Fixes:
- In 'shortcuts': complete_while_typing was a SimpleFilter, not a CLIFilter.
- Always reset color attributes after rendering.
- Handle bug in Windows when '$TERM' is not defined.
- Ignore errors when calling tcgetattr/tcsetattr.
  (This handles the "Inappropriate ioctl for device" crash in some scenarios.)
- Fix for Windows. Correctly recognize all Chinese and Lithuanian characters.

New features:
- Added shift+left/up/down/right keys.
- Small performance optimization in the renderer.
- Small optimization in the posix event loop. Don't call time.time() if we
  don't have an inputhook. (Less syscalls.)
- Turned the _max_postpone_until argument of call_from_executor into a float.
  (As returned by `time.time`.) This will do less system calls. It's
  backwards-incompatible, but this is still a private API, used only by pymux.)
- Added Shift-I/A commands in Vi block selection mode for inserting text at the
  beginning of each line of the block.
- Refactoring of the 'selectors' module for the posix event loop. (Reuse the
  same selector object in one loop, don't recreate it for each select.)


1.0.7: 2016-08-21
-----------------

Fixes:
- Bugfix in completion. When calculating the common completion to be inserted,
  the new completions were calculated wrong.
- On Windows, avoid extra vertical scrolling if the cursor is already on screen.

New features:
- Support negative arguments for next/previous word ending/beginning.


1.0.6: 2016-08-15
-----------------

Fixes:
- Go to the start of the line in Vi navigation mode, when 'j' or 'k' have been
  pressed to navigate to a new history entry.
- Don't crash when pasting text that contains \r\n characters. (This could
  happen in iTerm2.)
- Python 2.6 compatibility fix.
- Allow pressing <esc> before each -ve argument.
- Better support for conversion from #ffffff values to ANSI colors in
  Vt100_Output.
    * Prefer colors with some saturation, instead of gray colors, if the given
      color was not gray.
    * Prefer a different foreground and background color if they were
      originally not the same. (This avoids concealing text.)

New features:
- Improved ANSI color support.
    * If the $PROMPT_TOOLKIT_ANSI_COLORS_ONLY environment variable has been
      set, use the 16 ANSI colors only.
    * Take an `ansi_colors_only` parameter in `Vt100_Output` and
      `shortcuts.create_output`.


1.0.5: 2016-08-04
-----------------

Fixes:
- Critical fix for running on Windows. The gevent work-around in the inputhook
  caused 'An operation was attempted on something that is not a socket'.


1.0.4: 2016-08-03
-----------------

Fixes:
- Key binding fixes:
      * Improved handling of repeat arguments in Emacs mode. Pressing sequences
        like 'esc---123' do now work (like GNU Readline):
              - repetition of the minus sign is ignored.
              - No esc prefix is required for each digit.
      * Fix in ControlX-ControlX binding.
      * Fix in bracketed paste.
      * Pressing Control-U at the start of the line now deletes the newline.
      * Pressing Control-K at the end of the line, deletes the newline after
        the cursor.
      * Support negative argument for Control-K
      * Fixed cash when left/right were pressed with a negative argument. (In
        Emacs mode.)
      * Fix in ControlUp/ControlDown key bindings.
      * Distinguish backspace from Control-H. They are not the same.
      * Delete in front of the cursor when a negative argument has been given
        to backspace.
      * Handle arrow keys correctly in emacs-term.
- Performance optimizations:
      * Performance optimization in Registry.
      * Several performance optimization in filters.
      * Import asyncio inline (only if required).
- Use the best possible selector in the event loop. This fixes bugs in
  situations where we have too many open file descriptors.
- Fix UI freeze when gevent monkey patch has been applied.
- Fix segmentation fault in Alpine Linux. (Regarding the use of ioctl.)
- Use the correct colors on Windows. (When the foreground/background colors
  have been modified.)
- Display a better error message when running in Idle.
- Additional flags for vt100 inputs: disable flow control.
- Also patch stderr in CommandLineInterface.patch_stdout_context.

New features:
- Allow users to enter Vi digraphs in reverse order.
- Improved autocompletion behavior. See IPython issue #9658.
- Added a 'clear' function in the shortcuts module.

For future compatibility:
- `Keys.Enter` has been added. This is the key that should be bound for
  handling the enter key.

  Right now, prompt_toolkit translates \r into \n during the handling of the
  input; this is not correct and makes it impossible to distinguish between
  ControlJ and ControlM. Some applications bind ControlJ for custom handling of
  the enter key, because this equals \n. However, in a future version we will
  stop replacing \r by \n and at that point, the enter key will be ControlM.
  So better is to use `Keys.Enter`, which becomes an alias for whatever the
  enter key translates into.


1.0.3: 2016-06-20
-----------------

Fixes:
- Bugfix for Python2 in readline-like completion.
- Bugfix in readline-like completion visualization.

New features:
- Added `erase_when_done` parameter to the `Application` class.  (This was
  required for the bug fixes.)
- Added (experimental) `CommandLineInterface.run_application_generator` method.
  (Also required for the bug fix.)

1.0.2: 2016-06-16
-----------------

Fixes:
- Don't select the first completion when `complete_while_typing` is False.
  (Restore the old behavior.)


1.0.1: 2016-06-15
-----------------

Fixes:
- Bugfix in GrammarValidator and SentenceValidator.
- Don't leave the alternate screen on resize events.
- Use errors=surrogateescape, in order to handle mouse events in some
  terminals.
- Ignore key presses in _InterfaceEventLoopCallbacks.feed_key when the CLI is in the done state.
- Bugfix in get_common_complete_suffix. Don't return any suffix when there are
  completions that change whatever is before the cursor.
- Bugfix for Win32/Python2: use unicode literals: This crashed arrow navigation
  on Windows.
- Bugfix in InputProcessor: handling of more complex key bindings.
- Fix: don't apply completions, if there is only one completion which doesn't
  have any effect.
- Fix: correctly handle prompts starting with a newline in
  prompt_toolkit.shortcuts.
- Fix: thread safety in autocomplete code.
- Improve styling for matching brackets. (Allow individual styling for the
  bracket under the cursor and the other.)
- Fix in ShowLeadingWhiteSpaceProcessor/ShowTrailingWhiteSpaceProcessor: take
  output encoding into account. (The signature had to change a little for
  this.)
- Bug fix in key bindings: only activate Emacs system/open-in-editor bindings
  if editing_mode is emacs.
- Added write_binary parameter to Vt100_Output. This fixes a bug in some cases
  where we expect it to write non-encoded strings.
- Fix key bindings for Vi mode registers.

New features (**):
- Added shortcuts.confirm/create_confirm_application function.
- Emulate bracketed paste on Windows. (When the input stream contains multiple
  key presses among which a newline and at least one other character, consider
  this a paste event, and handle as bracketed paste on Unix.
- Added key handler for displaying completions, just like readline does.
- Implemented Vi guu,gUU,g~~ key bindings.
- Implemented Vi 'gJ' key binding.
- Implemented Vi ab,ib,aB,iB text objects.
- Support for ZeroWidthEscape tokens in prompt and token lists. Used to support
  final shell integration.
- Fix: Make document.text/cursor_position/selection read-only. (Changing these
  would break the caching causing bigger issues.)
- Using pytest for unit tests.
- Allow key bindings to have Keys.Any at any possible position. (Not just the
  end.) This made it significantly easier to write the named register Vi
  bindings, resulting in an approved start-up time.)
- Better feedback when entering multi-key key bindings in insert mode. (E.g.
  when 'jj' would be mapped to escape.)
- Small improvement in key processor: allow key bindings to generate new key
  presses.
- Handle ControlUp and ControlDown by default: move to the previous/next record
  in the history.
- Accept 'char'/'get_char' parameters in FillControl.
- Added refresh_interval method to prompt() function.

Performance improvements:
- Improve the performance of test_callable_args: this should significantly
  increase the start-up time.
- Start-up time for creating the Vi bindings has been improved significantly.

(**) Some small backwards-compatible features were allowed for this minor
     release. After evaluating the impact/risk/work involved we concluded that
     we could ship these in a minor release.


1.0.0: 2016-05-05
-----------------

Fixes:
- Adjust minimum completion menu width to match UIControl and Window class.
- Bugfix regarding weakref in InputProcessor.
- Fix for pypy3: bug in WeakValueDictionary.
- Correctly handle '0' key binding in Vi mode.
- Also load Vi bindings by default in Application if no registry has been given.
- Only go into selection mode if the current buffer is not empty.
- Close PipeInput after usage.
- Only use 16 colors in (Emacs) eterm-color.
- Bugfix in "xP Vi key binding.
- Bugfix in Vi { and } key binding.
- Fix: use correct token for Scrollbar in MultiColumnCompletionMenuControl.
- Handle negative values in translate_row_col_to_index.
- Handle decomposed unicode characters.
- Fixed Window.always_hide_cursor. (Parameter was ignored.)
- Fix in zz Vi key binding. (When render info is not available.)
- Fix in Document.get_cursor_up_position. (When an argument is given.)

New features:
- Separated `load_mouse_bindings`.
- Refactoring/simplification of the key bindings: better use of filters and
  CLI.editing_mode.
- Added DummyOutput class and a few unit tests that test the whole CLI.
- Use the bisect module in Document._line_start_indexes instead of a custom
  binary search. This should improve the performance.
- Stay in the same column when doing multiple up/down movements.
- Visual improvements:
  * Implemented cursorcolumn, cursorline and colorcolumn.
  * Only reserve menu space when `complete_while_typing=True` or when there are
    completions to be displayed.
  * Support for chaining tokens for combined styles. SelectedText will now
    reverse the colors from the highlighting by default. Style
    `Token.SelectedText` to set a fixed foreground/background.
    Also for SearchMatch, we now use combined tokens.
  * Support for dark gray on Windows.
  * Default token for SystemToolbar and SearchToolbar.
  * Display selection also on empty lines.
- Emacs key bindings improved:
  * Recognize + handle ControlDelete key.
  * Implemented meta-* and control-backslash key bindings.
- Vi key bindings improved:
  * Handle inclusive and linewise motions properly.
  * Fix g_ motion off by one character, and don't work when cursor is in
    the trailing whitespace part of line.
  * Make a(/a)/i(/i)/... motions. Find enclosing brackets instead of the next
    bracket.
  * Update N% motion according to vim behaviors.
  * Fix | motion off by one character.
  * ge/gE motions go to end of previous word, not start.
  * Added Vi 'gm' key binding.
  * Implemented 'gq' key binding in Vi mode. (Reshape text.)
  * Vi operator/text object separation for key bindings.
  * Added 'ap' (auto-paragraph) text object.
  * Implemented Vi digraphs. ControlK will now insert a digraph.
  * Implemented vi tilde_operator.
  * Support named registers.
  * Vi < and > key bindings became operators.
  * Text objects and motions are now separate bindings.
  * Improved copy/paste in Vi mode.

Backwards-incompatible changes:
- Don't reset the current buffer anymore by default in
  CommandLineInterface.run(). Passing `reset_current_buffer=True` is now
  required.
- Renamed MouseEventTypes to MouseEventType for consistency. The old name is
  still valid, but deprecated.
- Refactoring of Callbacks. All events should now receive one argument, which
  is the sender. (Further, Callback was renamed to Event.) This is mostly used
  internally.
- Moved on_invalidate callback from CommandLineInterface to Application
- Renamed `PipeInput.send` to `PipeInput.send_text`. (Old deprecated name is
  still kept as a valid alias.)
- Renamed SimpleLexer.default_token to SimpleLexer.token. (+
  backwards-compatibility.)
- Refactoring of the filters: `ViStateFilter` has been deprecated. (Should not
  be used anymore.) Use the filters, as defined in prompt_toolkit.filters.
- `editing_mode` is now a property of `CommandLineInterface`. This is replacing
  the `vi_mode` parameter in `KeyBindingManager`.
- The default accept_action for the default Buffer in Application now becomes
  IGNORE. This is a much more sensible default. Pass RETURN_DOCUMENT to get
  the previous behavior,
- Always expect an EventLoop instance in CommandLineInterface. Creating it in
  __init__ caused a memory leak.


0.60: 2016-03-14
----------------

Fixes:
- Fix in Document.paste. (The screen was not updated after an undo of a paste.)
- Don't use deprecated inspect.getargspec on Python 3.
- Fixed reading input on Windows when input was piped in stdin.
- Use correct file descriptors for input/output in run_system_command.
- Always correctly split prompt in shortcuts.prompt. (Even when multiline=False)
- Correctly align right prompt to the top when the left prompt consists of
  multiple lines.
- Correctly use Token.Transparent as default token for a TokenListControl.
- Fix in syntax synchronization. (Better handle the case when no
  synchronization point was found.)
- Send SIGTSTP to the whole process group.
- Correctly raise on_buffer_changed on all text changes.
- Fix in regular_languages.GrammarLexer. (Fixes bug in ptipython syntax
  highlighting.)

New features:
- Add support for additional readers to the Win32 event loop.
- Added on_render event.
- Carry the weight in layout dimensions to allow stretching.


0.59: 2016-02-27
----------------

Fixes:
- Set correct default color on Windows. (Gray instead of high intensity gray.)
- Reverse colors on Windows when foreground/background color have not been
  specified.
- Correct handling of mouse events for FillControl.
- Take margin into account when calculating Window height. (Fixes bug in
  multiline prompt.)
- Handle division by zero in UIContent.get_height_for_text.


0.58: 2016-02-23
----------------

Fixes:
- Correctly return result for mouse handler in TokenListControl.
- Bugfix in meta-backspace key binding. (Delete all whitespace before the
  cursor, when there is only whitespace.)
- Bugfix in Vi gu, gU, g? and g~ key bindings (in selection mode).
- Correctly restore default console attributes on Windows.
- Disable bracketed paste support in ConEmu. (This was broken.)
- When an unknown exception is raised in `CommandLineInterface.run()`, don't
  forget to redraw the CLI.

New features:
- Many performance improvements and better caching. (Especially in the
  `Document` class.)
- Support for continuation tokens in `shortcuts.prompt` and
  `shortcuts.create_prompt_layout`.
- Added `shortcuts.print_tokens` function for printing colored output.
- Sound bell when nothing was deleted.
- Added escape sequences for F1-F5 keys on the Linux console.
- Improved support for the Linux console. (Switch back to 16 colors.)
- Added F13-F24 input codes for xterm.
- Created prompt_toolkit.token. A custom Token implementation, that is
  compatible with Pygments.token. (This way, Pygments becomes an optional
  dependency. For many use cases, nothing except the Token class from Pygments
  was used, so it was a bit overkill to install Pygments for only that.)
- Refactoring of prompt_toolkit.styles.
- `Float` objects got a `hide_when_covering_content` option.
- Implementation of RPROMPT, like ZSH: Added `get_rprompt_tokens` to
  `create_prompt_layout`.
- Some improvements to the default style.
- Also handle Ctrl-R and Ctrl-S in Vi mode when searching.
- Added TabsProcessor: a tool to visualize tabs instead of displaying ^I.
- Give a better error message when trying to run in git-bash.
- Support for ANSI color names in style dictionaries.

- Big refactoring of the `Window` and `UIControl` classes. This should result
  in huge performance improvements on big inputs. (While first, a document
  could have 1,000 lines; now it can have about 100,000 lines on the same system.)

  The Window and UIControl have been rewritten very much. Rather than each time
  rendering the whole user control, we now only have to render the visible part.

  Because of this, many pieces had to be rewritten:
  - UIControls work differently. They return a `UIContent` instance that
    consist of a collection of lines.
  - All processors have been rewritten. (Their API changed as well, because
    they process one line at a time.)
  - Lexers work differently. `Lexer.lex_document` should now return a function
    that returns the tokens for one line. PygmentsLexer has been optimized that
    it becomes 'lazy', and it has optional syntax synchronization. That means,
    that the lexer doesn't have to start the lexing at the beginning of the
    document. (Which would be slow for big documents.)

Backwards-incompatible changes:
- As mentioned above, the refactoring of `Window` and `UIControl` caused many
  "internal" APIs to change. All custom `UIControl`, `Processor` and `Lexer`
  classes have to be rewritten. However, for most applications this should not
  be an issue. Especially, the `shortcuts.prompt` function is
  backwards-compatible.
- `wrap_lines` became a property of `Window` instead of `BufferControl`.


0.57: 2016-01-04
----------------

Fixes:
- Made `max_render_postpone_time` configurable. The current default was bad.
  (We should probably always draw the UI once every cycle of the event loop.)


0.56: 2016-01-03
----------------

Fixes:
- Fix in bracketed paste. It was not correctly enabled for each prompt.


0.55: 2016-01-03
----------------

New features:
- Implemented bracketed paste mode. (This allows much faster pasting, as well
  as pasting without going into paste mode. This makes sure that indentation in
  ptpython for instance is kept correctly.)
- Added support for italic output and blink. (For terminals that support it.)
- Added get_horizontal_scroll, get_vertical_scroll and always_hide_cursor
  parameters to Window.
- Refactoring of the posix event loop. Better scheduling of all tasks/FDs to
  avoid starvation. (Everything should feel more responsive in high CPU
  situations.)
- Added get_default_char function to TokenListControl.
- AppendAutoSuggestion now accepts a token parameter.
- Support for ansi color names in styles.
- Accept get_width/get_height parameters in Float.
- Added Output.write_raw and accept 'raw' parameter in
  CommandLineInterface.stdout_proxy.
- Better caching of tokens in TokenListControl.
- Add mouse support to TokenListControl.
- Display "Window too small" when the window becomes too small.
- Added 'bell' function to Output.
- Accept weights in HSplit/VSplit.
- Added Registry.remove_binding method to dynamically remove key bindings.
- Added focus_on_click parameter to BufferControl.
- Introduced BufferMapping class as a wrapper around the buffers dictionary.
  This one also contains the focus stack.
- Improved 'v' and 'V' key bindings. Allow switching between line and character
  selection modes.
- Added layout.highlighters. A new, much faster way to do selection and search
  highlighting.
- Make search_state dynamic for key bindings.
- Added 'sentence' option to WordCompleter.
- Cache Document.lines for better performance.
- Implementation of BLOCK selections. (Cut, copy, paste.)
- Accept a 'reserve_space_for_menu' parameter in the shortcuts. (This is an
  integer.)
- Support for 24bit true color on vt100 terminals.
- Added CommandLineInterface.on_invalidate event.
- Added __version__ to __init__.py.

Fixes:
- Always show cursor in the 'done' state.
- Allow HSplit to have zero children.
- Bugfix for handling of backslash on Windows with some non-us keyboards.
  (Ptpython issue #28.)
- Never render characters outside the visible screen region.
- Fix in WordCompleter. When case insensitive and input contained uppercase.
- Highlight search match when the cursor is at any position on the match. (not
  just the beginning.)

Backwards-incompatible changes:
(Most changes will probably not have an impact on external applications.)
- Change in the `Style` API. This allows caching of Attrs in renderer and
  faster rendering.  (Style now has a get_attrs_for_token instead of a
  get_token_to_attributes_dict method.)
- Removed DefaultStyle. Created PygmentsStyle.from_defaults class method instead.
- Removed AbortAction.IGNORE. This was ambiguous.
- Accept 'cli' parameter in 'walk' and 'find_window_for_buffer_name'.
- The focus stack is now stored in BufferMapping.
- ViStateFilter and KeyBindingManager now accept a get_vi_state callable
  instead of vi_state itself. (This way a key bindings registry becomes
  stateless.)
- HighlightSearchProcessor and HighlightSelectionProcessor became deprecated.
  (Use highlighters instead.)


0.54: 2015-10-29
----------------

New features:
- Allow CommandLineInterface to run in any thread.
- Hide cursor while rendering.
- Added add_reader/remove_reader methods to EventLoop.
- Support for 'reverse' style.
- Redraw more lazy, by using invalidate.
- Added show_cursor property to Screen.
- Center or right align text in TokenListControl also when it spans multiple
  lines.

Fixes:
- Bugfix in PathCompleter. (Expanduser issue.)
- Fix in signal handler.
- Use utf-8 encoding in Vt100_Output by default.
- Use correct default token in BufferControl.
- Fix in ControlL key binding. Use @handle to allow deactivation.

Backwards-incompatible changes:
- Renamed create_default_layout to create_prompt_layout
- Renamed create_default_application to create_prompt_application
- Renamed Layout to Container.
- Renamed CommandLineInterfaces.request_redraw to invalidate.
- Changed the actual value of SEARCH_BUFFER, DEFAULT_BUFFER, SYSTEM_BUFFER and
  DUMMY_BUFFER.
- Changed order of keyword arguments of the BufferControl class. "buffer_name"
  now comes first.
- Removed old pt(i)python code.

0.53: 2015-10-06
----------------

New features:
- Handling of the insert key in Vi mode.
- Added 'zt' and 'zb' Vi key bindings.
- Added delete key binding for deleting selected text.
- Select word below cursor on double mouse click.
- Added `wrap_lines` option to TokenListControl.
- Added `KeyBindingManager.for_prompt`.

Fixes:
- Fix in rendering output.
- Reset renderer correctly in run_in_terminal.
- Only reset buffer when using `AbortAction.RETRY`.
- Fix in handling of exit (Ctrl-D) key presses.
- Fix in `CompleteEvent`. Correctly set `completion_requested`.

Backwards-incompatible changes:
- Renamed `ValidationError.index` to `ValidationError.cursor_position`.
- Renamed `shortcuts.get_input` to `shortcuts.prompt`.
- Return empty string instead of None in
  `Document.current_char`/`char_before_cursor`.


0.52: 2015-09-24
----------------

Fixes:
- Fix in auto suggestion: hide suggestion when accepting input.


0.51: 2015-09-24
----------------

New features:
- Mouse support. (Scrolling and clicking for vt100 terminals. For Windows only
  clicking.) Both the autocompletion menus and buffer controls respond to
  scrolling and clicking.
- Added auto suggestions. (Like the fish shell.)
- Stdout proxy become thread safe.
- Linewrapping can now be disabled, instead we get horizontal scrolling.
- Line numbering can now be relative. Like the vi 'relativenumber' option.

Fixes:
- Fixed excessive scrolling in Windows.
- Bugfix in search highlighting.
- Copy all words during repetition of Ctrl-W presses.
- The 'libs' folder has been removed.
- Fix in MultiColumnCompletionsMenu: don't create very big columns.

Backwards-incompatible changes:
- Disable search by default in KeyBindingManager.
- Separated abort/exit key bindings. Disabled by default in KeyBindingManager.
- 'Ignore' became the default on_abort action in `Application`.
- 'Ignore' became the default accept_action in `Buffer`.
- The layout processors have been refactored. The API is changed.
- `SwitchableValidator` has been renamed to `ConditionalValidator`.
- `WindowRenderInfo` has several incompatible changes.
- Margins have been refactored completely. Now it's the window that has the
  margin instead of `BufferControl`. Is is both much more performant and
  flexible.


0.50: 2015-09-06
----------------

Fix:
- Leaving of alternate screen on Windows.


0.49: 2015-09-06
----------------

New features:
- Added MANIFEST.in
- Better support for multiline prompts in shortcuts.
- Added Document.set_document method.
- Added 'default' argument to `shortcuts.create_default_application`.
- Added `align_center` option for `TokenListControl`.
- Added optional key bindings for full page navigation. (Moved key bindings
  from pyvim into prompt-toolkit.)
- Accepts default_char in BufferControl for filling the background.
- Added InFocusStack filter.

Fixes:
- Small fix in TokenListControl: use the right Char for aligning.

Backwards-incompatible changes:
- Removed deprecated 'tokens' attribute from GrammarLexer.


0.48: 2015-09-02
----------------

New features:
- run_in_terminal now returns the result of the called function.
- Made history attribute of Buffer class public.
- Added support for sub CommandLineInterfaces.
- Accept optional vi_state parameter in KeyBindingManager.

Fixes:
- Pop-up menu positioning. The menu was shown too often above instead of below
  the cursor.
- Fix in Control-W key binding. When there is only whitespace before the
  cursor, delete the whitespace.
- Rendering bug fix in open_in_editor: run editor using cli.run_in_terminal.
- Fix in renderer. Correctly reserve the vertical space as required by the
  layout.
- Small fix in Margin ABC.
- Added __iter__ to History ABC.
- Small bugfix in CommandLineInterface: create correct eventloop when no
  eventloop was given.
- Never schedule a second repaint operation when a previous was not yet
  executed.


0.47: 2015-08-19
----------------

New features:
- Added `prompt_toolkit.layout.utils.iter_token_lines`.
- Allow `None` values on the focus stack.
- Buffers can be readonly. Added `IsReadOnly` filter.
- `eager` behavior for key bindings. When a key binding is eager it will be
  executed as soon as it's matched, even when there is another binding that
  starts with this key sequence.
- Custom margins for BufferControl.

Fixes:
- Don't trigger autocompletion on paste.
- Added `pre_run` parameter to CommandLineInterface.
- Correct invalidation of BeforeInput and AfterInput.
- Correctly handle transparency. (For floats.)
- Small change in the algorithm to determine Window dimensions: keep in the
  bounds of the Window dimensions.

Backwards-incompatible changes:
- There a now a `Lexer` abstract base class. Every lexer should be an instance
  of that class, and Pygments lexers should be wrapped in a `PygmentsLexer`
  class. `prompt_toolkit.shortcuts` still accepts Pygments lexers directly for
  backwards-compatibility.
- BufferControl no longer has a `show_line_numbers` argument. Pass a
  `NumberedMargin` instance instead.
- The `History` class became an abstract base class and only defines an
  interface. The default history class is now called `InMemoryHistory`.


0.46: 2015-08-08
----------------

New features:
- By default, in shortcuts, only show search highlighting when the search is
  the current input buffer.
- Accept 'count' for all search operations. (For repetition.)
- `shortcuts.create_default_layout` accepts a `multiline` parameter.
- Show meta display text for completions also in multi-column mode.

Fixes:
- Correct invalidation of DefaultPrompt when search direction changes.
- Correctly include/exclude current cursor position in search.
- More consistency in styles.
- Fix in ConditionalProcessor.has_focus.
- Python 2.6 compatibility fix.
- Show cursor at the correct position during reverse-i-search.
- Fixed stdout encoding bug for vt100 output.

Backwards-incompatible changes:
- Use of `ConditionalContainer` everywhere. The `Window` class no longer
  accepts a `filter` argument to decide about the visibility. Instead
  wrapping inside a `ConditionalContainer` class is required.


0.45: 2015-07-30
----------------

Fixes:
- Bug fix on OS X: correctly detect platform as not Windows.


0.44: 2015-07-30
----------------

Fixes:
- Fixed bug in eventloops: handle timeout correctly, even when there is an eventhook.
- Bug fix in open-in-editor: set correct cursor position.

New features:
- CompletionsMenu got a scroll_offset.
- Use 256 colors and ANSI sequences when ConEmu ANSI support has been detected.
- Added PyperclipClipboard for synchronization with the system clipboard.
  and clipboard parameter in shortcut functions.
- Filter for enabling/disabling handling of Vi 'v' binding.


0.43: 2015-07-15
----------------

Fixes:
- Windows bug fix. STD_INPUT_HANDLE should be c_ulong instead of HANDLE.
  (This caused crashes on some systems.)

New features:
- Added eventloop and patch_stdout parameters to get_input.
- Inputhook support added.
- Added ShowLeadingWhiteSpaceProcessor and ShowTrailingWhiteSpaceProcessor
  processors.
- Accept Filter as multiline parameter in 'shortcuts'.
- MultiColumnCompletionsMenu + display_completions_in_columns parameter
  in shortcuts.

Backwards incompatible changes:
- Layout.width was renamed to preferred_width and now receives a
  max_available_width parameter.


0.42: 2015-06-25
----------------

Fixes:
- Support for Windows cmder and conemu consoles.
- Correct handling of unicode input and output on Windows.

New features:
- Support terminal titles.
- Handle Control-Enter as Meta-Enter on Windows.
- Control-Z key binding for Windows.
- Implemented alternate screen buffer on Windows.
- Clipboard became an ABC and InMemoryClipboard default implementation.


0.41: 2015-06-20
----------------

Fixes:
- Emacs Control-T key binding.
- Color fix for Windows consoles.

New features:
- Allow both booleans and Filters in many places.
- `password` can be a Filter now.


0.40: 2015-06-15
----------------

Fixes:
- Fix in output_screen_diff: reset correctly.
- Ignore flush errors in vt100_output.
- Implemented <num>gg Vi key binding.
- Bug fix in the renderer when the style changes.

New features:
- TokenListControl can now display the cursor somewhere.
- Added SwitchableValidator class.
- print_tokens function added.
- get_style argument for Application added.
- KeyBindingManager got an enable_all argument.

Backwards incompatible changes:
- history_search is now a SimpleFilter instance.


0.39: 2015-06-04
----------------

Fixes:
- Fixed layout.py example.
- Fixed eventloop for Python 64bit on Windows.
- Fix in history.
- Fix in key bindings.


0.38: 2015-05-31
----------------

New features:
- Improved performance significantly for processing key bindings.
  (Pasting text will be a lot faster.)
- Added 'M' Vi key binding.
- Added 'z-' and 'z+' and 'z-[Enter]' Vi keybindings.
- Correctly handle input and output encodings on Windows.

Bug fixes:
- Fix bug when completion cursor position is outside range of current text.
- Don't crash Control-D is pressed while waiting for ENTER press (in run_system_command.)
- On Ctrl-Z, don't suspend on Windows, where we don't have SIGTSTP.
- Ignore result when open_in_editor received a nonzero return code.
- Bug fix in displaying of menu meta information. Don't show 'None'.

Backwards incompatible changes:
- Refactoring of the I/O layer.  Separation of the CommandLineInterface
  and Application class.
- Renamed enable_system_prompt to enable_system_bindings.

0.37: 2015-05-11
----------------

New features:
- Handling of trailing input in contrib.regular_languages.

Bug fixes:
- Default message in shortcuts.get_input.
- Windows compatibility for contrib.telnet.
- OS X bugfix in contrib.telnet.

0.36: 2015-05-09
----------------

New features:
- Added get_prompt_tokens parameter to create_default_layout.
- Show prompt in bold by default.

Bug fixes:
- Correct cache invalidation of DefaultPrompt.
- Using text_type assertions in contrib.telnet.
- Removed contrib.shortcuts completely. (The .pyc files still
  appeared incorrectly in the wheel.)

0.35: 2015-05-07
----------------

New features:
- WORD parameter for WordCompleter.
- DefaultPrompt.from_message constructor.
- Added reactive.py for simple integer data binding.
- Implemented scroll_offset and scroll_beyond_bottom for Window.
- Some performance improvements.

Bug fixes:
- Handling of relative path in PathCompleter.
- unicode_literals for all examples.
- Visibility of bottom toolbar in create_default_layout shortcut.
- Correctly handle 'J' vi key binding.
- Fix in indent/unindent.
- Better Vi bindings in visual mode.

Backwards incompatible changes:
- Moved prompt_toolkit.contrib.shortcuts to prompt_toolkit.shortcuts.
- Refactoring of contrib.telnet.

0.34: 2015-04-26
----------------

Bug fixes:
- Correct display of multi width characters in completion menu.

Backwards incompatible changes:
- Renamed Buffer.add_to_history to Buffer.append_to_history.

0.33: 2015-04-25
----------------

Bug fixes:
- Crash fixed in SystemCompleter when some directories didn't exist.
- Made text/cursor_position in Document more atomic.
- Fixed Char.__ne__, improves performance.
- Better performance of the filter module.
- Refactoring of the filter module.
- Bugfix in BufferControl, caching was not done correctly.
- fixed 'zz' Vi key binding.

New features:
- Do tilde expansion for system commands.
- Added ignore_case option for CommandLineInterface.

Backwards incompatible changes:
- complete_while_typing parameter has been moved from CommandLineInterface to
  Buffer.


0.32: 2015-04-22
----------------

New features:
- Implemented repeat arg for '{' and '}' vi key binding.
- Added autocorrection example.
- first experimental telnet interface added.
- Added contrib.validators.SentenceValidator.
- Added Layout.walk generator to traverse the layout.
- Improved 'L' and 'H' Vi key bindings.
- Implemented Vi 'zz' key binding.
- ValidationToolbar got a show_position parameter.
- When only width or height are given for a float, the control is centered in
  the parent.
- Added beforeKeyPress and afterKeyPress events.
- Added HighlightMatchingBracketProcessor.
- SearchToolbar got a vi_mode option to show '?' and '/' instead of 'I-search'.
- Implemented vi '*' binding.
- Added onBufferChanged event to CommandLineInterface.
- Many performance improvements: some caching and not rendering after every
  single key stroke.
- Added ConditionalProcessor.
- Floating menus are now shown above the cursor, when below is not enough
  space, but above is enough space.
- Improved vi 'G' key binding.
- WindowRenderInfo got a full_height_visible, top_visible, and a few other
  attributes.
- PathCompleter got an expanduser option to do tilde expansion.

Fixed:
- Always insert indentation when pressing enter.
- vertical_scroll should be an int instead of a float.
- Some bug fixes in renderer.Output.
- Pressing backspace in an empty search in Vi mode now goes back to navigation
  mode.
- Bug fix in TokenListControl (Correctly calculate height for multiline
  content.)
- Only apply HighlightMatchingBracketProcessor when editing buffer.
- Ensure that floating layouts never go out of bounds.
- Home/End now go to the start and end of the line.
- Fixed vi 'c' key binding.
- Redraw the whole output when the style changes.
- Don't trigger onTextInsert when working_index doesn't change.
- Searching now wraps around the start/end of buffer/history.
- Don't go to the start of the line when moving forward in history.

Changes:
- Don't show directory/file/link in the meta information of PathCompleter anymore.
- Complete refactoring of the event loops.
- Refactoring of the Renderer and CommandLineInterface class.
- CommandLineInterface now accepts an optional Output argument.
- CommandLineInterface now accepts a use_alternate_screen parameter.
- Moved highlighting code for search/selection from BufferControl to processors.
- Completers are now always run asynchronously.
- Complete refactoring of the search. (Most responsibility move out of Buffer
  class. CommandLineInterface now got a search_state attribute.)

Backwards incompatible changes:
- get_input does now have a history attribute instead of history_filename.
- EOFError and KeyboardInterrupt is raised for abort and exit instead of custom
  exceptions.
- CommandLineInterface does no longer have a property 'is_reading_input'.
- filters.AlwaysOn/AlwaysOff have been renamed to Always/Never.
- AcceptAction has been moved from CommandLineInterface to Buffer. Now every
  buffer can define its own accept action.
- CommandLineInterface now expects an Eventloop instance in __init__.


0.31: 2015-01-30
----------------

Fixed:
- Bug in float positioning
- Show completion menu only for the default_buffer in get_input.

New features:
- PathCompleter got a get_paths parameter.
- PathCompleter sorts alphabetically.
- Added contrib.completers.SystemCompleter
- Completion got a get_display_meta parameter.


0.30: 2015-01-26
----------------

Fixed:
- Backward compatibility with django_extensions.
- Usage of alternate screen in the renderer.

New features:
- Vi '#' key binding.
- contrib.shortcuts.get_input got a get_bottom_toolbar_tokens argument.
- Separate key bindings for "open in editor." KeyBindingManager got a
  enable_open_in_editor argument.

0.28: 2015-01-25
----------------

Fixed:
- syntax error in 0.27

0.27: 2015-01-25
----------------

Backwards-incompatible changes:
- Complete refactoring of the layout system. (HSplit, VSplit, FloatContainer)
  as well as a list of controls (TokenListControl, BufferControl) in order to
  design much more complex layouts.
- ptpython code has been moved to a separate repository.

New features:
- prompt_toolkit.contrib.shortcuts.get_input has been extended.

Fixed:
- Behavior of Control+left/right/up/down.
- Backspace in incremental search.
- Hide completion menu correctly when the cursor position changes.

0.26: 2015-01-08
----------------

Backwards-incompatible changes:
- Refactoring of the key input system. (The registry which contains the key
  bindings, the focus stack, key binding manager.) Overall much better API.
- Renamed `Line` to `Buffer`.

New features:
- Added filters as a way of disabling/enabling parts of the runtime according
  to certain conditions.
- Global clipboard, shared between all buffers.
- Added (experimental) "merge history" feature to ptpython.
- Added 'C-x r k' and 'C-x r y' emacs key bindings for cut and paste.
- Added g_, ge and gE vi key bindings.
- Added support for handling control + arrows keys.

Fixed:
- Correctly handle f1-f4 in rxvt-unicode.

0.25: 2014-12-11
----------------

Fixed:
- Package did not install on Python 2.6/2.7.

0.24: 2014-12-10
----------------

Backwards-incompatible changes:
- Completer.get_completions now gets a complete_event argument.

New features:
- For ptpython: filename completion inside Python strings.
- prompt_toolkit.contrib.regular_languages added.
- prompt_toolkit.contrib.pdb added. (Experimental PDB front-end.)
- Support for multiline toolbars.
- asyncio support added. (Integration with asyncio event loop.)
- WORD parameter added to Document.word_before_cursor.

Fixed:
- Small fixes in Win32 terminal output.
- Bug fix in parsing of CPR response.

0.23: 2014-11-28
----------------

New features:
- contrib.completers added.

Fixed:
- Improved j/k key bindings in Vi mode.
- Don't leak internal variables into ptipython shell.
- Initialize IPython extensions.
- Use IPython's prompt.
- Workarounds for Jedi crashes.

0.22: 2014-11-09
----------------

Fixed:
- Fixed missing import which caused Ctrl-Z to crash.
- Show error message for ptipython when IPython is not installed.

0.21: 2014-10-25
----------------
New features:
- Using entry_points in setup.py
- Experimental Win32 support added.

Fixed:
- Behavior of 'r' and 'R' key bindings in Vi mode.
- Detect multiline correctly for ptpython when there are triple quoted strings.
- Some other small improvements.


0.20: 2014-10-04
----------------
Fixed:
- Workarounds for Jedi bugs.
- Better handling of window resize events.
- Fixed counter in ptipython prompt.
- Use IPythonInputSplitter.transform_cell for IPython syntax validation.
- Only insert newlines for open brackets if the cursor is at the end of the input string.

New features:
- More Vi key bindings: 'B', 'W', 'E', 'aW', 'aw' and 'iW'
- ControlZ now suspends the process


0.19: 2014-09-30
----------------
Fixed:
- Handle Jedi crashes.
- Autocompletion in `ptipython`
- Input validation in `ptipython`
- Execution of system commands (in `ptpython`) in Python 3
- Add current directory to sys.path for `ptpython`.
- Minimal jedi and six version in setup.py

New features
- Python 2.6 support
- C-C> and C-C< indent and unindent emacs key bindings.
- `ptpython` can now also run python scripts, so aliasing of `ptpython` as
  `python` will work better.

0.18: 2014-09-29
----------------
- First official (beta) release.


Jan 25, 2014
------------
first commit


================================================
FILE: 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:

* Redistributions of source code must retain the above copyright notice, this
  list of conditions and the following disclaimer.

* 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.

* Neither the name of the {organization} 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.


================================================
FILE: MANIFEST.in
================================================
include *rst LICENSE CHANGELOG MANIFEST.in
recursive-include examples *.py
recursive-include tests *.py
prune examples/sample?/build


================================================
FILE: PROJECTS.rst
================================================
Projects using `prompt_toolkit`
===============================

Shells:

- `ptpython <http://github.com/prompt-toolkit/ptpython/>`_: Python REPL
- `ptpdb <http://github.com/jonathanslenders/ptpdb/>`_: Python debugger (pdb replacement)
- `pgcli <https://www.pgcli.com/>`_: Postgres client.
- `mycli <https://www.mycli.net/>`_: MySql client.
- `litecli <https://litecli.com/>`_: SQLite client.
- `wharfee <http://wharfee.com/>`_: A Docker command line.
- `xonsh <http://xon.sh/>`_: A Python-ish, BASHwards-compatible shell.
- `saws <https://github.com/donnemartin/saws>`_: A Supercharged AWS Command Line Interface.
- `cycli <https://github.com/nicolewhite/cycli>`_:  A Command Line Interface for Cypher.
- `crash <https://github.com/crate/crash>`_:  Crate command line client.
- `vcli <https://github.com/dbcli/vcli>`_: Vertica client.
- `aws-shell <https://github.com/awslabs/aws-shell>`_: An integrated shell for working with the AWS CLI.
- `softlayer-python <https://github.com/softlayer/softlayer-python>`_: A command-line interface to manage various SoftLayer products and services.
- `ipython <http://github.com/ipython/ipython/>`_: The IPython REPL
- `click-repl <https://github.com/click-contrib/click-repl>`_: Subcommand REPL for click apps.
- `haxor-news <https://github.com/donnemartin/haxor-news>`_: A Hacker News CLI.
- `gitsome <https://github.com/donnemartin/gitsome>`_: A Git/Shell Autocompleter with GitHub Integration.
- `http-prompt <https://github.com/eliangcs/http-prompt>`_: An interactive command-line HTTP client.
- `coconut <http://coconut-lang.org/>`_: Functional programming in Python.
- `Ergonomica <https://github.com/ergonomica/ergonomica>`_: A Bash alternative written in Python.
- `Kube-shell <https://github.com/cloudnativelabs/kube-shell>`_: Kubernetes shell: An integrated shell for working with the Kubernetes CLI
- `mssql-cli <https://github.com/dbcli/mssql-cli>`_: A command-line client for Microsoft SQL Server.
- `robotframework-debuglibrary <https://github.com/xyb/robotframework-debuglibrary>`_: A debug library and REPL for RobotFramework.
- `ptrepl <https://github.com/imomaliev/ptrepl>`_: Run any command as REPL
- `clipwdmgr <https://github.com/samisalkosuo/clipasswordmgr>`_: Command Line Password Manager.
- `slacker <https://github.com/netromdk/slacker>`_: Easy access to the Slack API and admin of workspaces via REPL.
- `EdgeDB <https://edgedb.com/>`_: The next generation object-relational database.
- `pywit <https://github.com/wit-ai/pywit>`_: Python library for Wit.ai.
- `objection <https://github.com/sensepost/objection>`_: Runtime Mobile Exploration.
- `habu <https://github.com/portantier/habu>`_: Python Network Hacking Toolkit.
- `nawano <https://github.com/rbw/nawano>`_: Nano cryptocurrency wallet
- `athenacli <https://github.com/dbcli/athenacli>`_: A CLI for AWS Athena.
- `vulcano <https://github.com/dgarana/vulcano>`_: A framework for creating command-line applications that also runs in REPL mode.
- `kafka-shell <https://github.com/devshawn/kafka-shell>`_: A supercharged shell for Apache Kafka.
- `starterTree <https://github.com/thomas10-10/starterTree>`_: A command launcher organized in a tree structure with fuzzy autocompletion
- `git-delete-merged-branches <https://github.com/hartwork/git-delete-merged-branches>`_: Command-line tool to delete merged Git branches
- `radian <https://github.com/randy3k/radian>`_: A 21 century R console

Full screen applications:

- `pymux <http://github.com/prompt-toolkit/pymux/>`_: A terminal multiplexer (like tmux) in pure Python.
- `pyvim <http://github.com/prompt-toolkit/pyvim/>`_: A Vim clone in pure Python.
- `freud <http://github.com/stloma/freud/>`_: REST client backed by SQLite for storing servers
- `pypager <https://github.com/prompt-toolkit/pypager>`_: A $PAGER in pure Python (like "less").
- `kubeterminal <https://github.com/samisalkosuo/kubeterminal>`_: Kubectl helper tool.
- `pydoro <https://github.com/JaDogg/pydoro>`_: Pomodoro timer.
- `sanctuary-zero <https://github.com/t0xic0der/sanctuary-zero>`_: A secure chatroom with zero logging and total transience.
- `Hummingbot <https://github.com/CoinAlpha/hummingbot>`_: A Cryptocurrency Algorithmic Trading Platform
- `git-bbb <https://github.com/MrMino/git-bbb>`_: A `git blame` browser.
- `ass <https://github.com/mlang/ass>`_: An OpenAI Assistants API client.

Libraries:

- `ptterm <https://github.com/prompt-toolkit/ptterm>`_: A terminal emulator widget for prompt_toolkit.
- `PyInquirer <https://github.com/CITGuru/PyInquirer/>`_: A Python library that wants to make it easy for existing Inquirer.js users to write immersive command line applications in Python.
- `clintermission <https://github.com/sebageek/clintermission>`_: Non-fullscreen command-line selection menu

Other libraries and implementations in other languages
******************************************************

- `go-prompt <https://github.com/c-bata/go-prompt>`_: building a powerful
  interactive prompt in Go, inspired by python-prompt-toolkit.
- `urwid <http://urwid.org/>`_: Console user interface library for Python.

(Want your own project to be listed here? Please create a GitHub issue.)


================================================
FILE: README.rst
================================================
Python Prompt Toolkit
=====================

|AppVeyor|  |PyPI|  |RTD|  |License|  |Codecov|

.. image :: /docs/images/logo_400px.png

``prompt_toolkit`` *is a library for building powerful interactive command line applications in Python.*

Read the `documentation on readthedocs
<http://python-prompt-toolkit.readthedocs.io/en/stable/>`_.


Gallery
*******

`ptpython <http://github.com/prompt-toolkit/ptpython/>`_ is an interactive
Python Shell, build on top of ``prompt_toolkit``.

.. image :: /docs/images/ptpython.png

`More examples <https://python-prompt-toolkit.readthedocs.io/en/stable/pages/gallery.html>`_


prompt_toolkit features
***********************

``prompt_toolkit`` could be a replacement for `GNU readline
<https://tiswww.case.edu/php/chet/readline/rltop.html>`_, but it can be much
more than that.

Some features:

- **Pure Python**.
- Syntax highlighting of the input while typing. (For instance, with a Pygments lexer.)
- Multi-line input editing.
- Advanced code completion.
- Both Emacs and Vi key bindings. (Similar to readline.)
- Even some advanced Vi functionality, like named registers and digraphs.
- Reverse and forward incremental search.
- Works well with Unicode double width characters. (Chinese input.)
- Selecting text for copy/paste. (Both Emacs and Vi style.)
- Support for `bracketed paste <https://cirw.in/blog/bracketed-paste>`_.
- Mouse support for cursor positioning and scrolling.
- Auto suggestions. (Like `fish shell <http://fishshell.com/>`_.)
- Multiple input buffers.
- No global state.
- Lightweight, the only dependencies are Pygments and wcwidth.
- Runs on Linux, OS X, FreeBSD, OpenBSD and Windows systems.
- And much more...

Feel free to create tickets for bugs and feature requests, and create pull
requests if you have nice patches that you would like to share with others.


Installation
************

::

    pip install prompt_toolkit

For Conda, do:

::

    conda install -c https://conda.anaconda.org/conda-forge prompt_toolkit


About Windows support
*********************

``prompt_toolkit`` is cross platform, and everything that you build on top
should run fine on both Unix and Windows systems. Windows support is best on
recent Windows 10 builds, for which the command line window supports vt100
escape sequences. (If not supported, we fall back to using Win32 APIs for color
and cursor movements).

It's worth noting that the implementation is a "best effort of what is
possible". Both Unix and Windows terminals have their limitations. But in
general, the Unix experience will still be a little better.


Getting started
***************

The most simple example of the library would look like this:

.. code:: python

    from prompt_toolkit import prompt

    if __name__ == '__main__':
        answer = prompt('Give me some input: ')
        print('You said: %s' % answer)

For more complex examples, have a look in the ``examples`` directory. All
examples are chosen to demonstrate only one thing. Also, don't be afraid to
look at the source code. The implementation of the ``prompt`` function could be
a good start.

Philosophy
**********

The source code of ``prompt_toolkit`` should be **readable**, **concise** and
**efficient**. We prefer short functions focusing each on one task and for which
the input and output types are clearly specified. We mostly prefer composition
over inheritance, because inheritance can result in too much functionality in
the same object. We prefer immutable objects where possible (objects don't
change after initialization). Reusability is important. We absolutely refrain
from having a changing global state, it should be possible to have multiple
independent instances of the same code in the same process. The architecture
should be layered: the lower levels operate on primitive operations and data
structures giving -- when correctly combined -- all the possible flexibility;
while at the higher level, there should be a simpler API, ready-to-use and
sufficient for most use cases. Thinking about algorithms and efficiency is
important, but avoid premature optimization.


`Projects using prompt_toolkit <PROJECTS.rst>`_
***********************************************

Special thanks to
*****************

- `Pygments <http://pygments.org/>`_: Syntax highlighter.
- `wcwidth <https://github.com/jquast/wcwidth>`_: Determine columns needed for a wide characters.

.. |PyPI| image:: https://img.shields.io/pypi/v/prompt_toolkit.svg
    :target: https://pypi.python.org/pypi/prompt-toolkit/
    :alt: Latest Version

.. |AppVeyor| image:: https://ci.appveyor.com/api/projects/status/32r7s2skrgm9ubva?svg=true
    :target: https://ci.appveyor.com/project/prompt-toolkit/python-prompt-toolkit/

.. |RTD| image:: https://readthedocs.org/projects/python-prompt-toolkit/badge/
    :target: https://python-prompt-toolkit.readthedocs.io/en/master/

.. |License| image:: https://img.shields.io/github/license/prompt-toolkit/python-prompt-toolkit.svg
    :target: https://github.com/prompt-toolkit/python-prompt-toolkit/blob/master/LICENSE

.. |Codecov| image:: https://codecov.io/gh/prompt-toolkit/python-prompt-toolkit/branch/master/graphs/badge.svg?style=flat
    :target: https://codecov.io/gh/prompt-toolkit/python-prompt-toolkit/


================================================
FILE: appveyor.yml
================================================
environment:
  matrix:
    - PYTHON: "C:\\Python36"
      PYTHON_VERSION: "3.6"
    - PYTHON: "C:\\Python36-x64"
      PYTHON_VERSION: "3.6"

    - PYTHON: "C:\\Python35"
      PYTHON_VERSION: "3.5"
    - PYTHON: "C:\\Python35-x64"
      PYTHON_VERSION: "3.5"

    - PYTHON: "C:\\Python34"
      PYTHON_VERSION: "3.4"
    - PYTHON: "C:\\Python34-x64"
      PYTHON_VERSION: "3.4"

    - PYTHON: "C:\\Python33"
      PYTHON_VERSION: "3.3"
    - PYTHON: "C:\\Python33-x64"
      PYTHON_VERSION: "3.3"

    - PYTHON: "C:\\Python27"
      PYTHON_VERSION: "2.7"
    - PYTHON: "C:\\Python27-x64"
      PYTHON_VERSION: "2.7"

    - PYTHON: "C:\\Python26"
      PYTHON_VERSION: "2.6"
    - PYTHON: "C:\\Python27-x64"
      PYTHON_VERSION: "2.6"

install:
  - "set PATH=%PYTHON%;%PYTHON%\\Scripts;%PATH%"
  - pip install . pytest coverage codecov flake8
  - pip list

build: false

test_script:
  - If not ($env:PYTHON_VERSION==2.6) flake8 prompt_toolkit
  - coverage run -m pytest

after_test:
  - codecov


================================================
FILE: docs/conf.py
================================================
#
# prompt_toolkit documentation build configuration file, created by
# sphinx-quickstart on Thu Jul 31 14:17:08 2014.
#
# This file is execfile()d with the current directory set to its
# containing dir.
#
# Note that not all possible configuration values are present in this
# autogenerated file.
#
# All configuration values have a default; values that are commented out
# serve to show the default.


# If extensions (or modules to document with autodoc) are in another directory,
# add these directories to sys.path here. If the directory is relative to the
# documentation root, use os.path.abspath to make it absolute, like shown here.
# sys.path.insert(0, os.path.abspath('.'))

# -- General configuration ------------------------------------------------

# If your documentation needs a minimal Sphinx version, state it here.
# needs_sphinx = '1.0'

# Add any Sphinx extension module names here, as strings. They can be
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
# ones.
extensions = [
    "sphinx.ext.autodoc",
    "sphinx.ext.graphviz",
    "sphinx_copybutton",
]

# Add any paths that contain templates here, relative to this directory.
# templates_path = ["_templates"]

# The suffix of source filenames.
source_suffix = {".rst": "restructuredtext"}

# The encoding of source files.
# source_encoding = 'utf-8-sig'

# The master toctree document.
master_doc = "index"

# General information about the project.
project = "prompt_toolkit"
copyright = "2014-2024, Jonathan Slenders"

# The version info for the project you're documenting, acts as replacement for
# |version| and |release|, also used in various other places throughout the
# built documents.
#
# ---------------------------------------------------------------------
# Versions.
# The short X.Y version.
version = "3.0.52"
# The full version, including alpha/beta/rc tags.
release = "3.0.52"
# The URL pattern to match releases to ReadTheDocs URLs.
docs_fmt_url = "https://python-prompt-toolkit.readthedocs.io/en/{release}/"
# The list of releases to include in the dropdown.
releases = [
    "latest",
    release,
    "2.0.9",
    "1.0.15",
]

# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
# language = None

# There are two options for replacing |today|: either, you set today to some
# non-false value, then it is used:
# today = ''
# Else, today_fmt is used as the format for a strftime call.
# today_fmt = '%B %d, %Y'

# List of patterns, relative to source directory, that match files and
# directories to ignore when looking for source files.
exclude_patterns = ["_build"]

# The reST default role (used for this markup: `text`) to use for all
# documents.
# default_role = None

# If true, '()' will be appended to :func: etc. cross-reference text.
# add_function_parentheses = True

# If true, the current module name will be prepended to all description
# unit titles (such as .. function::).
# add_module_names = True

# If true, sectionauthor and moduleauthor directives will be shown in the
# output. They are ignored by default.
# show_authors = False

# The name of the Pygments (syntax highlighting) style to use.
# pygments_style = "pastie"  # Provided as a theme option below.

# A list of ignored prefixes for module index sorting.
# modindex_common_prefix = []

# If true, keep warnings as "system message" paragraphs in the built documents.
# keep_warnings = False

# autodoc configuration
# https://www.sphinx-doc.org/en/master/usage/extensions/autodoc.html
autodoc_inherit_docstrings = False
autodoc_mock_imports = [
    "prompt_toolkit.eventloop.win32",
    "prompt_toolkit.input.win32",
    "prompt_toolkit.output.win32",
]

# -- Options for HTML output ----------------------------------------------

# The theme to use for HTML and HTML Help pages.  See the documentation for
# a list of builtin themes.

# on_rtd = os.environ.get("READTHEDOCS", None) == "True"

html_theme = "sphinx_nefertiti"
# html_theme_path = [sphinx_nefertiti.get_html_theme_path()]
html_theme_options = {
    "monospace_font": "Ubuntu Sans Mono",
    "monospace_font_size": "0.9rem",
    # "style" can take the following values: "blue", "indigo", "purple",
    # "pink", "red", "orange", "yellow", "green", "tail", and "default".
    "style": "blue",
    "pygments_light_style": "pastie",
    "pygments_dark_style": "dracula",
    # Fonts are customizable (and are not retrieved online).
    # https://sphinx-nefertiti.readthedocs.io/en/latest/users-guide/customization/fonts.html
    "logo": "logo_400px.png",
    "logo_location": "sidebar",
    "logo_alt": "python-prompt-toolkit",
    "logo_width": "270",
    "logo_height": "270",
    "repository_url": "https://github.com/prompt-toolkit/python-prompt-toolkit",
    "repository_name": "python-prompt-toolkit",
    "current_version": "latest",
    "versions": [(item, docs_fmt_url.format(release=item)) for item in releases],
    "header_links": [
        {"text": "Getting started", "link": "pages/getting_started"},
        {
            "text": "Tutorials",
            "match": "/tutorials/*",
            "dropdown": (
                {"text": "Build an SQLite REPL", "link": "pages/tutorials/repl"},
            ),
        },
        {
            "text": "Advanced",
            "link": "pages/advanced_topics/index",
            "match": "/advanced_topics/*",
            "dropdown": (
                {
                    "text": "More about key bindings",
                    "link": "pages/advanced_topics/key_bindings",
                },
                {
                    "text": "More about styling",
                    "link": "pages/advanced_topics/styling",
                },
                {
                    "text": "Filters",
                    "link": "pages/advanced_topics/filters",
                },
                {
                    "text": "The rendering flow",
                    "link": "pages/advanced_topics/rendering_flow",
                },
                {
                    "text": "Running on top of the asyncio event loop",
                    "link": "pages/advanced_topics/asyncio",
                },
                {
                    "text": "Unit testing",
                    "link": "pages/advanced_topics/unit_testing",
                },
                {
                    "text": "Input hooks",
                    "link": "pages/advanced_topics/input_hooks",
                },
                {
                    "text": "Architecture",
                    "link": "pages/advanced_topics/architecture",
                },
                {
                    "text": "The rendering pipeline",
                    "link": "pages/advanced_topics/rendering_pipeline",
                },
            ),
        },
        {
            "text": "Reference",
            "link": "pages/reference",
        },
    ],
    "footer_links": [
        {
            "text": "Documentation",
            "link": "https://python-prompt-toolkit.readthedocs.io/",
        },
        {
            "text": "Package",
            "link": "https://pypi.org/project/prompt-toolkit/",
        },
        {
            "text": "Repository",
            "link": "https://github.com/prompt-toolkit/python-prompt-toolkit",
        },
        {
            "text": "Issues",
            "link": "https://github.com/prompt-toolkit/python-prompt-toolkit/issues",
        },
    ],
}


# Theme options are theme-specific and customize the look and feel of a theme
# further.  For a list of options available for each theme, see the
# documentation.


# Add any paths that contain custom themes here, relative to this directory.
# html_theme_path = []

# The name for this set of Sphinx documents.  If None, it defaults to
# "<project> v<release> documentation".
# html_title = None

# A shorter title for the navigation bar.  Default is the same as html_title.
# html_short_title = None

# The name of an image file (relative to this directory) to place at the top
# of the sidebar.
html_logo = "images/logo_400px.png"

# The name of an image file (within the static path) to use as favicon of the
# docs.  This file should be a Windows icon file (.ico) being 16x16 or 32x32
# pixels large.
# html_favicon = None

# Add any paths that contain custom static files (such as style sheets) here,
# relative to this directory. They are copied after the builtin static files,
# so a file named "default.css" will overwrite the builtin "default.css".
# html_static_path = ["_static"]

# Add any extra paths that contain custom files (such as robots.txt or
# .htaccess) here, relative to this directory. These files are copied
# directly to the root of the documentation.
# html_extra_path = []

# If not '', a 'Last updated on:' timestamp is inserted at every page bottom,
# using the given strftime format.
# html_last_updated_fmt = '%b %d, %Y'

# If true, SmartyPants will be used to convert quotes and dashes to
# typographically correct entities.
# html_use_smartypants = True

# Custom sidebar templates, maps document names to template names.
# html_sidebars = {}

# Additional templates that should be rendered to pages, maps page names to
# template names.
# html_additional_pages = {}

# If false, no module index is generated.
# html_domain_indices = True

# If false, no index is generated.
# html_use_index = True

# If true, the index is split into individual pages for each letter.
# html_split_index = False

# If true, links to the reST sources are added to the pages.
# html_show_sourcelink = True

# If true, "Created using Sphinx" is shown in the HTML footer. Default is True.
# html_show_sphinx = True

# If true, "(C) Copyright ..." is shown in the HTML footer. Default is True.
# html_show_copyright = True

# If true, an OpenSearch description file will be output, and all pages will
# contain a <link> tag referring to it.  The value of this option must be the
# base URL from which the finished HTML is served.
# html_use_opensearch = ''

# This is the file name suffix for HTML files (e.g. ".xhtml").
# html_file_suffix = None

# Output file base name for HTML help builder.
htmlhelp_basename = "prompt_toolkitdoc"


# -- Options for LaTeX output ---------------------------------------------

latex_elements = {
    # The paper size ('letterpaper' or 'a4paper').
    # 'papersize': 'letterpaper',
    # The font size ('10pt', '11pt' or '12pt').
    # 'pointsize': '10pt',
    # Additional stuff for the LaTeX preamble.
    # 'preamble': '',
}

# Grouping the document tree into LaTeX files. List of tuples
# (source start file, target name, title,
#  author, documentclass [howto, manual, or own class]).
latex_documents = [
    (
        "index",
        "prompt_toolkit.tex",
        "prompt_toolkit Documentation",
        "Jonathan Slenders",
        "manual",
    ),
]

# The name of an image file (relative to this directory) to place at the top of
# the title page.
# latex_logo = None

# For "manual" documents, if this is true, then toplevel headings are parts,
# not chapters.
# latex_use_parts = False

# If true, show page references after internal links.
# latex_show_pagerefs = False

# If true, show URL addresses after external links.
# latex_show_urls = False

# Documents to append as an appendix to all manuals.
# latex_appendices = []

# If false, no module index is generated.
# latex_domain_indices = True


# -- Options for manual page output ---------------------------------------

# One entry per manual page. List of tuples
# (source start file, name, description, authors, manual section).
man_pages = [
    (
        "index",
        "prompt_toolkit",
        "prompt_toolkit Documentation",
        ["Jonathan Slenders"],
        1,
    )
]

# If true, show URL addresses after external links.
# man_show_urls = False


# -- Options for Texinfo output -------------------------------------------

# Grouping the document tree into Texinfo files. List of tuples
# (source start file, target name, title, author,
#  dir menu entry, description, category)
texinfo_documents = [
    (
        "index",
        "prompt_toolkit",
        "prompt_toolkit Documentation",
        "Jonathan Slenders",
        "prompt_toolkit",
        "One line description of project.",
        "Miscellaneous",
    ),
]

# Documents to append as an appendix to all manuals.
# texinfo_appendices = []

# If false, no module index is generated.
# texinfo_domain_indices = True

# How to display URL addresses: 'footnote', 'no', or 'inline'.
# texinfo_show_urls = 'footnote'

# If true, do not generate a @detailmenu in the "Top" node's menu.
# texinfo_no_detailmenu = False


================================================
FILE: docs/index.rst
================================================
Python Prompt Toolkit 3.0
=========================

`prompt_toolkit` is a library for building powerful interactive command line
and terminal applications in Python.


It can be a very advanced pure Python replacement for `GNU readline
<https://tiswww.case.edu/php/chet/readline/rltop.html>`_, but it can also be
used for building full screen applications.

.. image:: images/ptpython-2.png

Some features:

- Syntax highlighting of the input while typing. (For instance, with a Pygments lexer.)
- Multi-line input editing.
- Advanced code completion.
- Selecting text for copy/paste. (Both Emacs and Vi style.)
- Mouse support for cursor positioning and scrolling.
- Auto suggestions. (Like `fish shell <http://fishshell.com/>`_.)
- No global state.

Like readline:

- Both Emacs and Vi key bindings.
- Reverse and forward incremental search.
- Works well with Unicode double width characters. (Chinese input.)

Works everywhere:

- Pure Python. Runs on all Python versions starting at Python 3.6.
  (Python 2.6 - 3.x is supported in prompt_toolkit 2.0; not 3.0).
- Runs on Linux, OS X, OpenBSD and Windows systems.
- Lightweight, the only dependencies are Pygments and wcwidth.
- No assumptions about I/O are made. Every prompt_toolkit application should
  also run in a telnet/ssh server or an `asyncio
  <https://docs.python.org/3/library/asyncio.html>`_ process.

Have a look at :ref:`the gallery <gallery>` to get an idea of what is possible.

Getting started
---------------

Go to :ref:`getting started <getting_started>` and build your first prompt.
Issues are tracked `on the Github project
<https://github.com/prompt-toolkit/python-prompt-toolkit>`_.


Thanks to:
----------

A special thanks to `all the contributors
<https://github.com/prompt-toolkit/python-prompt-toolkit/graphs/contributors>`_
for making prompt_toolkit possible.

Also, a special thanks to the `Pygments <http://pygments.org/>`_ and `wcwidth
<https://github.com/jquast/wcwidth>`_ libraries.


Table of contents
-----------------

.. toctree::
   :maxdepth: 2

   pages/gallery
   pages/getting_started
   pages/upgrading/index
   pages/printing_text
   pages/asking_for_input
   pages/asking_for_a_choice
   pages/dialogs
   pages/progress_bars
   pages/full_screen_apps
   pages/tutorials/index
   pages/advanced_topics/index
   pages/reference
   pages/related_projects


Indices and tables
==================

* :ref:`genindex`
* :ref:`modindex`
* :ref:`search`

Prompt_toolkit was created by `Jonathan Slenders
<http://github.com/prompt-toolkit/>`_.


================================================
FILE: docs/make.bat
================================================
@ECHO OFF

REM Command file for Sphinx documentation

if "%SPHINXBUILD%" == "" (
	set SPHINXBUILD=sphinx-build
)
set BUILDDIR=_build
set ALLSPHINXOPTS=-d %BUILDDIR%/doctrees %SPHINXOPTS% .
set I18NSPHINXOPTS=%SPHINXOPTS% .
if NOT "%PAPER%" == "" (
	set ALLSPHINXOPTS=-D latex_paper_size=%PAPER% %ALLSPHINXOPTS%
	set I18NSPHINXOPTS=-D latex_paper_size=%PAPER% %I18NSPHINXOPTS%
)

if "%1" == "" goto help

if "%1" == "help" (
	:help
	echo.Please use `make ^<target^>` where ^<target^> is one of
	echo.  html       to make standalone HTML files
	echo.  dirhtml    to make HTML files named index.html in directories
	echo.  singlehtml to make a single large HTML file
	echo.  pickle     to make pickle files
	echo.  json       to make JSON files
	echo.  htmlhelp   to make HTML files and a HTML help project
	echo.  qthelp     to make HTML files and a qthelp project
	echo.  devhelp    to make HTML files and a Devhelp project
	echo.  epub       to make an epub
	echo.  latex      to make LaTeX files, you can set PAPER=a4 or PAPER=letter
	echo.  text       to make text files
	echo.  man        to make manual pages
	echo.  texinfo    to make Texinfo files
	echo.  gettext    to make PO message catalogs
	echo.  changes    to make an overview over all changed/added/deprecated items
	echo.  xml        to make Docutils-native XML files
	echo.  pseudoxml  to make pseudoxml-XML files for display purposes
	echo.  linkcheck  to check all external links for integrity
	echo.  doctest    to run all doctests embedded in the documentation if enabled
	goto end
)

if "%1" == "clean" (
	for /d %%i in (%BUILDDIR%\*) do rmdir /q /s %%i
	del /q /s %BUILDDIR%\*
	goto end
)


%SPHINXBUILD% 2> nul
if errorlevel 9009 (
	echo.
	echo.The 'sphinx-build' command was not found. Make sure you have Sphinx
	echo.installed, then set the SPHINXBUILD environment variable to point
	echo.to the full path of the 'sphinx-build' executable. Alternatively you
	echo.may add the Sphinx directory to PATH.
	echo.
	echo.If you don't have Sphinx installed, grab it from
	echo.http://sphinx-doc.org/
	exit /b 1
)

if "%1" == "html" (
	%SPHINXBUILD% -b html %ALLSPHINXOPTS% %BUILDDIR%/html
	if errorlevel 1 exit /b 1
	echo.
	echo.Build finished. The HTML pages are in %BUILDDIR%/html.
	goto end
)

if "%1" == "dirhtml" (
	%SPHINXBUILD% -b dirhtml %ALLSPHINXOPTS% %BUILDDIR%/dirhtml
	if errorlevel 1 exit /b 1
	echo.
	echo.Build finished. The HTML pages are in %BUILDDIR%/dirhtml.
	goto end
)

if "%1" == "singlehtml" (
	%SPHINXBUILD% -b singlehtml %ALLSPHINXOPTS% %BUILDDIR%/singlehtml
	if errorlevel 1 exit /b 1
	echo.
	echo.Build finished. The HTML pages are in %BUILDDIR%/singlehtml.
	goto end
)

if "%1" == "pickle" (
	%SPHINXBUILD% -b pickle %ALLSPHINXOPTS% %BUILDDIR%/pickle
	if errorlevel 1 exit /b 1
	echo.
	echo.Build finished; now you can process the pickle files.
	goto end
)

if "%1" == "json" (
	%SPHINXBUILD% -b json %ALLSPHINXOPTS% %BUILDDIR%/json
	if errorlevel 1 exit /b 1
	echo.
	echo.Build finished; now you can process the JSON files.
	goto end
)

if "%1" == "htmlhelp" (
	%SPHINXBUILD% -b htmlhelp %ALLSPHINXOPTS% %BUILDDIR%/htmlhelp
	if errorlevel 1 exit /b 1
	echo.
	echo.Build finished; now you can run HTML Help Workshop with the ^
.hhp project file in %BUILDDIR%/htmlhelp.
	goto end
)

if "%1" == "qthelp" (
	%SPHINXBUILD% -b qthelp %ALLSPHINXOPTS% %BUILDDIR%/qthelp
	if errorlevel 1 exit /b 1
	echo.
	echo.Build finished; now you can run "qcollectiongenerator" with the ^
.qhcp project file in %BUILDDIR%/qthelp, like this:
	echo.^> qcollectiongenerator %BUILDDIR%\qthelp\xline.qhcp
	echo.To view the help file:
	echo.^> assistant -collectionFile %BUILDDIR%\qthelp\xline.ghc
	goto end
)

if "%1" == "devhelp" (
	%SPHINXBUILD% -b devhelp %ALLSPHINXOPTS% %BUILDDIR%/devhelp
	if errorlevel 1 exit /b 1
	echo.
	echo.Build finished.
	goto end
)

if "%1" == "epub" (
	%SPHINXBUILD% -b epub %ALLSPHINXOPTS% %BUILDDIR%/epub
	if errorlevel 1 exit /b 1
	echo.
	echo.Build finished. The epub file is in %BUILDDIR%/epub.
	goto end
)

if "%1" == "latex" (
	%SPHINXBUILD% -b latex %ALLSPHINXOPTS% %BUILDDIR%/latex
	if errorlevel 1 exit /b 1
	echo.
	echo.Build finished; the LaTeX files are in %BUILDDIR%/latex.
	goto end
)

if "%1" == "latexpdf" (
	%SPHINXBUILD% -b latex %ALLSPHINXOPTS% %BUILDDIR%/latex
	cd %BUILDDIR%/latex
	make all-pdf
	cd %BUILDDIR%/..
	echo.
	echo.Build finished; the PDF files are in %BUILDDIR%/latex.
	goto end
)

if "%1" == "latexpdfja" (
	%SPHINXBUILD% -b latex %ALLSPHINXOPTS% %BUILDDIR%/latex
	cd %BUILDDIR%/latex
	make all-pdf-ja
	cd %BUILDDIR%/..
	echo.
	echo.Build finished; the PDF files are in %BUILDDIR%/latex.
	goto end
)

if "%1" == "text" (
	%SPHINXBUILD% -b text %ALLSPHINXOPTS% %BUILDDIR%/text
	if errorlevel 1 exit /b 1
	echo.
	echo.Build finished. The text files are in %BUILDDIR%/text.
	goto end
)

if "%1" == "man" (
	%SPHINXBUILD% -b man %ALLSPHINXOPTS% %BUILDDIR%/man
	if errorlevel 1 exit /b 1
	echo.
	echo.Build finished. The manual pages are in %BUILDDIR%/man.
	goto end
)

if "%1" == "texinfo" (
	%SPHINXBUILD% -b texinfo %ALLSPHINXOPTS% %BUILDDIR%/texinfo
	if errorlevel 1 exit /b 1
	echo.
	echo.Build finished. The Texinfo files are in %BUILDDIR%/texinfo.
	goto end
)

if "%1" == "gettext" (
	%SPHINXBUILD% -b gettext %I18NSPHINXOPTS% %BUILDDIR%/locale
	if errorlevel 1 exit /b 1
	echo.
	echo.Build finished. The message catalogs are in %BUILDDIR%/locale.
	goto end
)

if "%1" == "changes" (
	%SPHINXBUILD% -b changes %ALLSPHINXOPTS% %BUILDDIR%/changes
	if errorlevel 1 exit /b 1
	echo.
	echo.The overview file is in %BUILDDIR%/changes.
	goto end
)

if "%1" == "linkcheck" (
	%SPHINXBUILD% -b linkcheck %ALLSPHINXOPTS% %BUILDDIR%/linkcheck
	if errorlevel 1 exit /b 1
	echo.
	echo.Link check complete; look for any errors in the above output ^
or in %BUILDDIR%/linkcheck/output.txt.
	goto end
)

if "%1" == "doctest" (
	%SPHINXBUILD% -b doctest %ALLSPHINXOPTS% %BUILDDIR%/doctest
	if errorlevel 1 exit /b 1
	echo.
	echo.Testing of doctests in the sources finished, look at the ^
results in %BUILDDIR%/doctest/output.txt.
	goto end
)

if "%1" == "xml" (
	%SPHINXBUILD% -b xml %ALLSPHINXOPTS% %BUILDDIR%/xml
	if errorlevel 1 exit /b 1
	echo.
	echo.Build finished. The XML files are in %BUILDDIR%/xml.
	goto end
)

if "%1" == "pseudoxml" (
	%SPHINXBUILD% -b pseudoxml %ALLSPHINXOPTS% %BUILDDIR%/pseudoxml
	if errorlevel 1 exit /b 1
	echo.
	echo.Build finished. The pseudo-XML files are in %BUILDDIR%/pseudoxml.
	goto end
)

:end


================================================
FILE: docs/pages/advanced_topics/architecture.rst
================================================
.. _architecture:


Architecture
============

TODO: this is a little outdated.

::

    +---------------------------------------------------------------+
    |     InputStream                                               |
    |     ===========                                               |
    |          - Parses the input stream coming from a VT100        |
    |            compatible terminal. Translates it into data input |
    |            and control characters. Calls the corresponding    |
    |            handlers of the `InputStreamHandler` instance.     |
    |                                                               |
    |          e.g. Translate '\x1b[6~' into "Keys.PageDown", call  |
    |               the `feed_key` method of `InputProcessor`.      |
    +---------------------------------------------------------------+
               |
               v
    +---------------------------------------------------------------+
    |     InputStreamHandler                                        |
    |     ==================                                        |
    |          - Has a `Registry` of key bindings, it calls the     |
    |            bindings according to the received keys and the    |
    |            input mode.                                        |
    |                                                               |
    |         We have Vi and Emacs bindings.
    +---------------------------------------------------------------+
               |
               v
    +---------------------------------------------------------------+
    |     Key bindings                                              |
    |     ============                                              |
    |          - Every key binding consists of a function that      |
    |            receives an `Event` and usually it operates on     |
    |            the `Buffer` object. (It could insert data or      |
    |            move the cursor for example.)                      |
    +---------------------------------------------------------------+
        |
        | Most of the key bindings operate on a `Buffer` object, but
        | they don't have to. They could also change the visibility
        | of a menu for instance, or change the color scheme.
        |
        v
    +---------------------------------------------------------------+
    |     Buffer                                                    |
    |     ======                                                    |
    |          - Contains a data structure to hold the current      |
    |            input (text and cursor position). This class       |
    |            implements all text manipulations and cursor       |
    |            movements (Like e.g. cursor_forward, insert_char   |
    |            or delete_word.)                                   |
    |                                                               |
    |            +-----------------------------------------------+  |
    |            | Document (text, cursor_position)              |  |
    |            | ================================              |  |
    |            | Accessed as the `document` property of the    |  |
    |            | `Buffer` class. This is a wrapper around the  |  |
    |            | text and cursor position, and contains        |  |
    |            | methods for querying this data , e.g. to give |  |
    |            | the text before the cursor.                   |  |
    |            +-----------------------------------------------+  |
    +---------------------------------------------------------------+
        |
        |  Normally after every key press, the output will be
        |  rendered again. This happens in the event loop of
        |  the `Application` where `Renderer.render` is called.
        v
    +---------------------------------------------------------------+
    |     Layout                                                    |
    |     ======                                                    |
    |          - When the renderer should redraw, the renderer      |
    |            asks the layout what the output should look like.  |
    |          - The layout operates on a `Screen` object that he   |
    |            received from the `Renderer` and will put the      |
    |            toolbars, menus, highlighted content and prompt    |
    |            in place.                                          |
    |                                                               |
    |            +-----------------------------------------------+  |
    |            | Menus, toolbars, prompt                       |  |
    |            | =======================                       |  |
    |            |                                               |  |
    |            +-----------------------------------------------+  |
    +---------------------------------------------------------------+
        |
        v
    +---------------------------------------------------------------+
    |     Renderer                                                  |
    |     ========                                                  |
    |          - Calculates the difference between the last output  |
    |            and the new one and writes it to the terminal      |
    |            output.                                            |
    +---------------------------------------------------------------+


================================================
FILE: docs/pages/advanced_topics/asyncio.rst
================================================
.. _asyncio:

Running on top of the `asyncio` event loop
==========================================

.. note::

    New in prompt_toolkit 3.0. (In prompt_toolkit 2.0 this was possible using a
    work-around).

Prompt_toolkit 3.0 uses asyncio natively. Calling ``Application.run()`` will
automatically run the asyncio event loop.

If however you want to run a prompt_toolkit ``Application`` within an asyncio
environment, you have to call the ``run_async`` method, like this:

.. code:: python

    from prompt_toolkit.application import Application

    async def main():
        # Define application.
        application = Application(
            ...
        )

        result = await application.run_async()
        print(result)

    asyncio.get_event_loop().run_until_complete(main())


================================================
FILE: docs/pages/advanced_topics/filters.rst
================================================
.. _filters:

Filters
=======

Many places in `prompt_toolkit` require a boolean value that can change over
time. For instance:

- to specify whether a part of the layout needs to be visible or not;
- or to decide whether a certain key binding needs to be active or not;
- or the ``wrap_lines`` option of
  :class:`~prompt_toolkit.layout.BufferControl`;
- etcetera.

These booleans are often dynamic and can change at runtime. For instance, the
search toolbar should only be visible when the user is actually searching (when
the search buffer has the focus). The ``wrap_lines`` option could be changed
with a certain key binding. And that key binding could only work when the
default buffer got the focus.

In `prompt_toolkit`, we decided to reduce the amount of state in the whole
framework, and apply a simple kind of reactive programming to describe the flow
of these booleans as expressions. (It's one-way only: if a key binding needs to
know whether it's active or not, it can follow this flow by evaluating an
expression.)

The (abstract) base class is :class:`~prompt_toolkit.filters.Filter`, which
wraps an expression that takes no input and evaluates to a boolean. Getting the
state of a filter is done by simply calling it.


An example
----------

The most obvious way to create such a :class:`~prompt_toolkit.filters.Filter`
instance is by creating a :class:`~prompt_toolkit.filters.Condition` instance
from a function. For instance, the following condition will evaluate to
``True`` when the user is searching:

.. code:: python

    from prompt_toolkit.application.current import get_app
    from prompt_toolkit.filters import Condition

    is_searching = Condition(lambda: get_app().is_searching)

A different way of writing this, is by using the decorator syntax:

.. code:: python

    from prompt_toolkit.application.current import get_app
    from prompt_toolkit.filters import Condition

    @Condition
    def is_searching():
        return get_app().is_searching

This filter can then be used in a key binding, like in the following snippet:

.. code:: python

    from prompt_toolkit.key_binding import KeyBindings

    kb = KeyBindings()

    @kb.add('c-t', filter=is_searching)
    def _(event):
        # Do, something, but only when searching.
        pass

If we want to know the boolean value of this filter, we have to call it like a
function:

.. code:: python

    print(is_searching())


Built-in filters
----------------

There are many built-in filters, ready to use. All of them have a lowercase
name, because they represent the wrapped function underneath, and can be called
as a function.

- :class:`~prompt_toolkit.filters.app.has_arg`
- :class:`~prompt_toolkit.filters.app.has_completions`
- :class:`~prompt_toolkit.filters.app.has_focus`
- :class:`~prompt_toolkit.filters.app.buffer_has_focus`
- :class:`~prompt_toolkit.filters.app.has_selection`
- :class:`~prompt_toolkit.filters.app.has_validation_error`
- :class:`~prompt_toolkit.filters.app.is_aborting`
- :class:`~prompt_toolkit.filters.app.is_done`
- :class:`~prompt_toolkit.filters.app.is_read_only`
- :class:`~prompt_toolkit.filters.app.is_multiline`
- :class:`~prompt_toolkit.filters.app.renderer_height_is_known`
- :class:`~prompt_toolkit.filters.app.in_editing_mode`
- :class:`~prompt_toolkit.filters.app.in_paste_mode`

- :class:`~prompt_toolkit.filters.app.vi_mode`
- :class:`~prompt_toolkit.filters.app.vi_navigation_mode`
- :class:`~prompt_toolkit.filters.app.vi_insert_mode`
- :class:`~prompt_toolkit.filters.app.vi_insert_multiple_mode`
- :class:`~prompt_toolkit.filters.app.vi_replace_mode`
- :class:`~prompt_toolkit.filters.app.vi_selection_mode`
- :class:`~prompt_toolkit.filters.app.vi_waiting_for_text_object_mode`
- :class:`~prompt_toolkit.filters.app.vi_digraph_mode`

- :class:`~prompt_toolkit.filters.app.emacs_mode`
- :class:`~prompt_toolkit.filters.app.emacs_insert_mode`
- :class:`~prompt_toolkit.filters.app.emacs_selection_mode`

- :class:`~prompt_toolkit.filters.app.is_searching`
- :class:`~prompt_toolkit.filters.app.control_is_searchable`
- :class:`~prompt_toolkit.filters.app.vi_search_direction_reversed`


Combining filters
-----------------

Filters can be chained with the ``&`` (AND) and ``|`` (OR) operators and
negated with the ``~`` (negation) operator.

Some examples:

.. code:: python

    from prompt_toolkit.key_binding import KeyBindings
    from prompt_toolkit.filters import has_selection, has_selection

    kb = KeyBindings()

    @kb.add('c-t', filter=~is_searching)
    def _(event):
        " Do something, but not while searching. "
        pass

    @kb.add('c-t', filter=has_search | has_selection)
    def _(event):
        " Do something, but only when searching or when there is a selection. "
        pass


to_filter
---------

Finally, in many situations you want your code to expose an API that is able to
deal with both booleans as well as filters. For instance, when for most users a
boolean works fine because they don't need to change the value over time, while
some advanced users want to be able this value to a certain setting or event
that does changes over time.

In order to handle both use cases, there is a utility called
:func:`~prompt_toolkit.filters.utils.to_filter`.

This is a function that takes
either a boolean or an actual :class:`~prompt_toolkit.filters.Filter`
instance, and always returns a :class:`~prompt_toolkit.filters.Filter`.

.. code:: python

    from prompt_toolkit.filters.utils import to_filter

    # In each of the following three examples, 'f' will be a `Filter`
    # instance.
    f = to_filter(True)
    f = to_filter(False)
    f = to_filter(Condition(lambda: True))
    f = to_filter(has_search | has_selection)


================================================
FILE: docs/pages/advanced_topics/index.rst
================================================
.. _advanced_topics:

Advanced topics
===============

.. toctree::
    :caption: Contents:
    :maxdepth: 1

    key_bindings
    styling
    filters
    rendering_flow
    asyncio
    unit_testing
    input_hooks
    architecture
    rendering_pipeline


================================================
FILE: docs/pages/advanced_topics/input_hooks.rst
================================================
.. _input_hooks:


Input hooks
===========

Input hooks are a tool for inserting an external event loop into the
prompt_toolkit event loop, so that the other loop can run as long as
prompt_toolkit (actually asyncio) is idle. This is used in applications like
`IPython <https://ipython.org/>`_, so that GUI toolkits can display their
windows while we wait at the prompt for user input.

As a consequence, we will "trampoline" back and forth between two event loops.

.. note::

    This will use a :class:`~asyncio.SelectorEventLoop`, not the :class:
    :class:`~asyncio.ProactorEventLoop` (on Windows) due to the way the
    implementation works (contributions are welcome to make that work).


.. code:: python

    from prompt_toolkit.eventloop.inputhook import set_eventloop_with_inputhook

    def inputhook(inputhook_context):
        # At this point, we run the other loop. This loop is supposed to run
        # until either `inputhook_context.fileno` becomes ready for reading or
        # `inputhook_context.input_is_ready()` returns True.

        # A good way is to register this file descriptor in this other event
        # loop with a callback that stops this loop when this FD becomes ready.
        # There is no need to actually read anything from the FD.

        while True:
            ...

    set_eventloop_with_inputhook(inputhook)

    # Any asyncio code at this point will now use this new loop, with input
    # hook installed.


================================================
FILE: docs/pages/advanced_topics/key_bindings.rst
================================================
.. _key_bindings:

More about key bindings
=======================

This page contains a few additional notes about key bindings.


Key bindings can be defined as follows by creating a
:class:`~prompt_toolkit.key_binding.KeyBindings` instance:


.. code:: python

    from prompt_toolkit.key_binding import KeyBindings

    bindings = KeyBindings()

    @bindings.add('a')
    def _(event):
        " Do something if 'a' has been pressed. "
        ...


    @bindings.add('c-t')
    def _(event):
        " Do something if Control-T has been pressed. "
        ...

.. note::

    :kbd:`c-q` (control-q) and :kbd:`c-s` (control-s) are often captured by the
    terminal, because they were used traditionally for software flow control.
    When this is enabled, the application will automatically freeze when
    :kbd:`c-s` is pressed, until :kbd:`c-q` is pressed. It won't be possible to
    bind these keys.

    In order to disable this, execute the following command in your shell, or even
    add it to your `.bashrc`.

    .. code::

        stty -ixon

Key bindings can even consist of a sequence of multiple keys. The binding is
only triggered when all the keys in this sequence are pressed.

.. code:: python

    @bindings.add('a', 'b')
    def _(event):
        " Do something if 'a' is pressed and then 'b' is pressed. "
        ...

If the user presses only `a`, then nothing will happen until either a second
key (like `b`) has been pressed or until the timeout expires (see later).


List of special keys
--------------------

Besides literal characters, any of the following keys can be used in a key
binding:

+-------------------+-----------------------------------------+
| Name              + Possible keys                           |
+===================+=========================================+
| Escape            | :kbd:`escape`                           |
| Shift + escape    | :kbd:`s-escape`                         |
+-------------------+-----------------------------------------+
| Arrows            | :kbd:`left`,                            |
|                   | :kbd:`right`,                           |
|                   | :kbd:`up`,                              |
|                   | :kbd:`down`                             |
+-------------------+-----------------------------------------+
| Navigation        | :kbd:`home`,                            |
|                   | :kbd:`end`,                             |
|                   | :kbd:`delete`,                          |
|                   | :kbd:`pageup`,                          |
|                   | :kbd:`pagedown`,                        |
|                   | :kbd:`insert`                           |
+-------------------+-----------------------------------------+
| Control+letter    | :kbd:`c-a`, :kbd:`c-b`, :kbd:`c-c`,     |
|                   | :kbd:`c-d`, :kbd:`c-e`, :kbd:`c-f`,     |
|                   | :kbd:`c-g`, :kbd:`c-h`, :kbd:`c-i`,     |
|                   | :kbd:`c-j`, :kbd:`c-k`, :kbd:`c-l`,     |
|                   |                                         |
|                   | :kbd:`c-m`, :kbd:`c-n`, :kbd:`c-o`,     |
|                   | :kbd:`c-p`, :kbd:`c-q`, :kbd:`c-r`,     |
|                   | :kbd:`c-s`, :kbd:`c-t`, :kbd:`c-u`,     |
|                   | :kbd:`c-v`, :kbd:`c-w`, :kbd:`c-x`,     |
|                   |                                         |
|                   | :kbd:`c-y`, :kbd:`c-z`                  |
+-------------------+-----------------------------------------+
| Control + number  | :kbd:`c-1`, :kbd:`c-2`, :kbd:`c-3`,     |
|                   | :kbd:`c-4`, :kbd:`c-5`, :kbd:`c-6`,     |
|                   | :kbd:`c-7`, :kbd:`c-8`, :kbd:`c-9`,     |
|                   | :kbd:`c-0`                              |
+-------------------+-----------------------------------------+
| Control + arrow   | :kbd:`c-left`,                          |
|                   | :kbd:`c-right`,                         |
|                   | :kbd:`c-up`,                            |
|                   | :kbd:`c-down`                           |
+-------------------+-----------------------------------------+
| Other control     | :kbd:`c-@`,                             |
| keys              | :kbd:`c-\\`,                            |
|                   | :kbd:`c-]`,                             |
|                   | :kbd:`c-^`,                             |
|                   | :kbd:`c-_`,                             |
|                   | :kbd:`c-delete`                         |
+-------------------+-----------------------------------------+
| Shift + arrow     | :kbd:`s-left`,                          |
|                   | :kbd:`s-right`,                         |
|                   | :kbd:`s-up`,                            |
|                   | :kbd:`s-down`                           |
+-------------------+-----------------------------------------+
| Control + Shift + | :kbd:`c-s-left`,                        |
| arrow             | :kbd:`c-s-right`,                       |
|                   | :kbd:`c-s-up`,                          |
|                   | :kbd:`c-s-down`                         |
+-------------------+-----------------------------------------+
| Other shift       | :kbd:`s-delete`,                        |
| keys              | :kbd:`s-tab`                            |
+-------------------+-----------------------------------------+
| F-keys            | :kbd:`f1`, :kbd:`f2`, :kbd:`f3`,        |
|                   | :kbd:`f4`, :kbd:`f5`, :kbd:`f6`,        |
|                   | :kbd:`f7`, :kbd:`f8`, :kbd:`f9`,        |
|                   | :kbd:`f10`, :kbd:`f11`, :kbd:`f12`,     |
|                   |                                         |
|                   | :kbd:`f13`, :kbd:`f14`, :kbd:`f15`,     |
|                   | :kbd:`f16`, :kbd:`f17`, :kbd:`f18`,     |
|                   | :kbd:`f19`, :kbd:`f20`, :kbd:`f21`,     |
|                   | :kbd:`f22`, :kbd:`f23`, :kbd:`f24`      |
+-------------------+-----------------------------------------+

There are a couple of useful aliases as well:

+-------------------+-------------------+
| :kbd:`c-h`        | :kbd:`backspace`  |
+-------------------+-------------------+
| :kbd:`c-@`        | :kbd:`c-space`    |
+-------------------+-------------------+
| :kbd:`c-m`        | :kbd:`enter`      |
+-------------------+-------------------+
| :kbd:`c-i`        | :kbd:`tab`        |
+-------------------+-------------------+

.. note::

    Note that the supported keys are limited to what typical VT100 terminals
    offer. Binding :kbd:`c-7` (control + number 7) for instance is not
    supported.


Binding alt+something, option+something or meta+something
---------------------------------------------------------

Vt100 terminals translate the alt key into a leading :kbd:`escape` key.
For instance, in order to handle :kbd:`alt-f`, we have to handle
:kbd:`escape` + :kbd:`f`. Notice that we receive this as two individual keys.
This means that it's exactly the same as first typing :kbd:`escape` and then
typing :kbd:`f`. Something this alt-key is also known as option or meta.

In code that looks as follows:

.. code:: python

    @bindings.add('escape', 'f')
    def _(event):
        " Do something if alt-f or meta-f have been pressed. "


Wildcards
---------

Sometimes you want to catch any key that follows after a certain key stroke.
This is possible by binding the '<any>' key:

.. code:: python

    @bindings.add('a', '<any>')
    def _(event):
        ...

This will handle `aa`, `ab`, `ac`, etcetera. The key binding can check the
`event` object for which keys exactly have been pressed.


Attaching a filter (condition)
------------------------------

In order to enable a key binding according to a certain condition, we have to
pass it a :class:`~prompt_toolkit.filters.Filter`, usually a
:class:`~prompt_toolkit.filters.Condition` instance. (:ref:`Read more about
filters <filters>`.)

.. code:: python

    from prompt_toolkit.filters import Condition

    @Condition
    def is_active():
        " Only activate key binding on the second half of each minute. "
        return datetime.datetime.now().second > 30

    @bindings.add('c-t', filter=is_active)
    def _(event):
        # ...
        pass

The key binding will be ignored when this condition is not satisfied.


ConditionalKeyBindings: Disabling a set of key bindings
-------------------------------------------------------

Sometimes you want to enable or disable a whole set of key bindings according
to a certain condition. This is possible by wrapping it in a
:class:`~prompt_toolkit.key_binding.ConditionalKeyBindings` object.

.. code:: python

    from prompt_toolkit.key_binding import ConditionalKeyBindings

    @Condition
    def is_active():
        " Only activate key binding on the second half of each minute. "
        return datetime.datetime.now().second > 30

     bindings = ConditionalKeyBindings(
         key_bindings=my_bindings,
         filter=is_active)

If the condition is not satisfied, all the key bindings in `my_bindings` above
will be ignored.


Merging key bindings
--------------------

Sometimes you have different parts of your application generate a collection of
key bindings. It is possible to merge them together through the
:func:`~prompt_toolkit.key_binding.merge_key_bindings` function. This is
preferred above passing a :class:`~prompt_toolkit.key_binding.KeyBindings`
object around and having everyone populate it.

.. code:: python

    from prompt_toolkit.key_binding import merge_key_bindings

    bindings = merge_key_bindings([
        bindings1,
        bindings2,
    ])


Eager
-----

Usually not required, but if ever you have to override an existing key binding,
the `eager` flag can be useful.

Suppose that there is already an active binding for `ab` and you'd like to add
a second binding that only handles `a`. When the user presses only `a`,
prompt_toolkit has to wait for the next key press in order to know which
handler to call.

By passing the `eager` flag to this second binding, we are actually saying that
prompt_toolkit shouldn't wait for longer matches when all the keys in this key
binding are matched. So, if `a` has been pressed, this second binding will be
called, even if there's an active `ab` binding.

.. code:: python

    @bindings.add('a', 'b')
    def binding_1(event):
        ...

    @bindings.add('a', eager=True)
    def binding_2(event):
        ...

This is mainly useful in order to conditionally override another binding.

Asyncio coroutines
------------------

Key binding handlers can be asyncio coroutines.

.. code:: python

    from prompt_toolkit.application import in_terminal

    @bindings.add('x')
    async def print_hello(event):
        """
        Pressing 'x' will print 5 times "hello" in the background above the
        prompt.
        """
        for i in range(5):
            # Print hello above the current prompt.
            async with in_terminal():
                print('hello')

            # Sleep, but allow further input editing in the meantime.
            await asyncio.sleep(1)

If the user accepts the input on the prompt, while this coroutine is not yet
finished , an `asyncio.CancelledError` exception will be thrown in this
coroutine.


Timeouts
--------

There are two timeout settings that effect the handling of keys.

- ``Application.ttimeoutlen``: Like Vim's `ttimeoutlen` option.
  When to flush the input (For flushing escape keys.) This is important on
  terminals that use vt100 input. We can't distinguish the escape key from for
  instance the left-arrow key, if we don't know what follows after "\x1b". This
  little timer will consider "\x1b" to be escape if nothing did follow in this
  time span.  This seems to work like the `ttimeoutlen` option in Vim.

- ``KeyProcessor.timeoutlen``: like Vim's `timeoutlen` option.
  This can be `None` or a float.  For instance, suppose that we have a key
  binding AB and a second key binding A. If the uses presses A and then waits,
  we don't handle this binding yet (unless it was marked 'eager'), because we
  don't know what will follow. This timeout is the maximum amount of time that
  we wait until we call the handlers anyway. Pass `None` to disable this
  timeout.


Recording macros
----------------

Both Emacs and Vi mode allow macro recording. By default, all key presses are
recorded during a macro, but it is possible to exclude certain keys by setting
the `record_in_macro` parameter to `False`:

.. code:: python

    @bindings.add('c-t', record_in_macro=False)
    def _(event):
        # ...
        pass


Creating new Vi text objects and operators
------------------------------------------

We tried very hard to ship prompt_toolkit with as many as possible Vi text
objects and operators, so that text editing feels as natural as possible to Vi
users.

If you wish to create a new text object or key binding, that is actually
possible. Check the `custom-vi-operator-and-text-object.py` example for more
information.


Handling SIGINT
---------------

The SIGINT Unix signal can be handled by binding ``<sigint>``. For instance:

.. code:: python

    @bindings.add('<sigint>')
    def _(event):
        # ...
        pass

This will handle a SIGINT that was sent by an external application into the
process. Handling control-c should be done by binding ``c-c``. (The terminal
input is set to raw mode, which means that a ``c-c`` won't be translated into a
SIGINT.)

For a ``PromptSession``, there is a default binding for ``<sigint>`` that
corresponds to ``c-c``: it will exit the prompt, raising a
``KeyboardInterrupt`` exception.


Processing `.inputrc`
---------------------

GNU readline can be configured using an `.inputrc` configuration file. This file
contains key bindings as well as certain settings. Right now, prompt_toolkit
doesn't support `.inputrc`, but it should be possible in the future.


================================================
FILE: docs/pages/advanced_topics/rendering_flow.rst
================================================
.. _rendering_flow:

The rendering flow
==================

Understanding the rendering flow is important for understanding how
:class:`~prompt_toolkit.layout.Container` and
:class:`~prompt_toolkit.layout.UIControl` objects interact. We will demonstrate
it by explaining the flow around a
:class:`~prompt_toolkit.layout.BufferControl`.

.. note::

    A :class:`~prompt_toolkit.layout.BufferControl` is a
    :class:`~prompt_toolkit.layout.UIControl` for displaying the content of a
    :class:`~prompt_toolkit.buffer.Buffer`. A buffer is the object that holds
    any editable region of text. Like all controls, it has to be wrapped into a
    :class:`~prompt_toolkit.layout.Window`.

Let's take the following code:

.. code:: python

    from prompt_toolkit.enums import DEFAULT_BUFFER
    from prompt_toolkit.layout.containers import Window
    from prompt_toolkit.layout.controls import BufferControl
    from prompt_toolkit.buffer import Buffer

    b = Buffer(name=DEFAULT_BUFFER)
    Window(content=BufferControl(buffer=b))

What happens when a :class:`~prompt_toolkit.renderer.Renderer` objects wants a
:class:`~prompt_toolkit.layout.Container` to be rendered on a certain
:class:`~prompt_toolkit.layout.screen.Screen`?

The visualization happens in several steps:

1. The :class:`~prompt_toolkit.renderer.Renderer` calls the
   :meth:`~prompt_toolkit.layout.Container.write_to_screen` method
   of a :class:`~prompt_toolkit.layout.Container`.
   This is a request to paint the layout in a rectangle of a certain size.

   The :class:`~prompt_toolkit.layout.Window` object then requests
   the :class:`~prompt_toolkit.layout.UIControl` to create a
   :class:`~prompt_toolkit.layout.UIContent` instance (by calling
   :meth:`~prompt_toolkit.layout.UIControl.create_content`).
   The user control receives the dimensions of the window, but can still
   decide to create more or less content.

   Inside the :meth:`~prompt_toolkit.layout.UIControl.create_content`
   method of :class:`~prompt_toolkit.layout.UIControl`, there are several
   steps:

   2. First, the buffer's text is passed to the
      :meth:`~prompt_toolkit.lexers.Lexer.lex_document` method of a
      :class:`~prompt_toolkit.lexers.Lexer`. This returns a function which
      for a given line number, returns a "formatted text list" for that line
      (that's a list of ``(style_string, text)`` tuples).

   3. This list is passed through a list of
      :class:`~prompt_toolkit.layout.processors.Processor` objects.
      Each processor can do a transformation for each line.
      (For instance, they can insert or replace some text, highlight the
      selection or search string, etc...)

   4. The :class:`~prompt_toolkit.layout.UIControl` returns a
      :class:`~prompt_toolkit.layout.UIContent` instance which
      generates such a token lists for each lines.

The :class:`~prompt_toolkit.layout.Window` receives the
:class:`~prompt_toolkit.layout.UIContent` and then:

5. It calculates the horizontal and vertical scrolling, if applicable
   (if the content would take more space than what is available).

6. The content is copied to the correct absolute position
   :class:`~prompt_toolkit.layout.screen.Screen`, as requested by the
   :class:`~prompt_toolkit.renderer.Renderer`. While doing this, the
   :class:`~prompt_toolkit.layout.Window` can possible wrap the
   lines, if line wrapping was configured.

Note that this process is lazy: if a certain line is not displayed in the
:class:`~prompt_toolkit.layout.Window`, then it is not requested
from the :class:`~prompt_toolkit.layout.UIContent`. And from there, the line is
not passed through the processors or even asked from the
:class:`~prompt_toolkit.lexers.Lexer`.


================================================
FILE: docs/pages/advanced_topics/rendering_pipeline.rst
================================================
The rendering pipeline
======================

This document is an attempt to describe how prompt_toolkit applications are
rendered. It's a complex but logical process that happens more or less after
every key stroke. We'll go through all the steps from the point where the user
hits a key, until the character appears on the screen.


Waiting for user input
----------------------

Most of the time when a prompt_toolkit application is running, it is idle. It's
sitting in the event loop, waiting for some I/O to happen. The most important
kind of I/O we're waiting for is user input. So, within the event loop, we have
one file descriptor that represents the input device from where we receive key
presses. The details are a little different between operating systems, but it
comes down to a selector (like select or epoll) which waits for one or more
file descriptor. The event loop is then responsible for calling the appropriate
feedback when one of the file descriptors becomes ready.

It is like that when the user presses a key: the input device becomes ready for
reading, and the appropriate callback is called. This is the `read_from_input`
function somewhere in `application.py`. It will read the input from the
:class:`~prompt_toolkit.input.Input` object, by calling
:meth:`~prompt_toolkit.input.Input.read_keys`.


Reading the user input
----------------------

The actual reading is also operating system dependent. For instance, on a Linux
machine with a vt100 terminal, we read the input from the pseudo terminal
device, by calling `os.read`. This however returns a sequence of bytes. There
are two difficulties:

- The input could be UTF-8 encoded, and there is always the possibility that we
  receive only a portion of a multi-byte character.
- vt100 key presses consist of multiple characters. For instance the "left
  arrow" would generate something like ``\x1b[D``. It could be that when we
  read this input stream, that at some point we only get the first part of such
  a key press, and we have to wait for the rest to arrive.

Both problems are implemented using state machines.

- The UTF-8 problem is solved using `codecs.getincrementaldecoder`, which is an
  object in which we can feed the incoming bytes, and it will only return the
  complete UTF-8 characters that we have so far. The rest is buffered for the
  next read operation.
- Vt100 parsing is solved by the
  :class:`~prompt_toolkit.input.vt100_parser.Vt100Parser` state machine. The
  state machine itself is implemented using a generator. We feed the incoming
  characters to the generator, and it will call the appropriate callback for
  key presses once they arrive. One thing here to keep in mind is that the
  characters for some key presses are a prefix of other key presses, like for
  instance, escape (``\x1b``) is a prefix of the left arrow key (``\x1b[D``).
  So for those, we don't know what key is pressed until more data arrives or
  when the input is flushed because of a timeout.

For Windows systems, it's a little different. Here we use Win32 syscalls for
reading the console input.


Processing the key presses
--------------------------

The ``Key`` objects that we receive are then passed to the
:class:`~prompt_toolkit.key_binding.key_processor.KeyProcessor` for matching
against the currently registered and active key bindings.

This is another state machine, because key bindings are linked to a sequence of
key presses. We cannot call the handler until all of these key presses arrive
and until we're sure that this combination is not a prefix of another
combination. For instance, sometimes people bind ``jj`` (a double ``j`` key
press) to ``esc`` in Vi mode. This is convenient, but we want to make sure that
pressing ``j`` once only, followed by a different key will still insert the
``j`` character as usual.

Now, there are hundreds of key bindings in prompt_toolkit (in ptpython, right
now we have 585 bindings). This is mainly caused by the way that Vi key
bindings are generated. In order to make this efficient, we keep a cache of
handlers which match certain sequences of keys.

Of course, key bindings also have filters attached for enabling/disabling them.
So, if at some point, we get a list of handlers from that cache, we still have
to discard the inactive bindings. Luckily, many bindings share exactly the same
filter, and we have to check every filter only once.

:ref:`Read more about key bindings ...<key_bindings>`


The key handlers
----------------

Once a key sequence is matched, the handler is called. This can do things like
text manipulation, changing the focus or anything else.

After the handler is called, the user interface is invalidated and rendered
again.


Rendering the user interface
----------------------------

The rendering is pretty complex for several reasons:

- We have to compute the dimensions of all user interface elements. Sometimes
  they are given, but sometimes this requires calculating the size of
  :class:`~prompt_toolkit.layout.UIControl` objects.
- It needs to be very efficient, because it's something that happens on every
  single key stroke.
- We should output as little as possible on stdout in order to reduce latency
  on slow network connections and older terminals.


Calculating the total UI height
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

Unless the application is a full screen application, we have to know how much
vertical space is going to be consumed. The total available width is given, but
the vertical space is more dynamic. We do this by asking the root
:class:`~prompt_toolkit.layout.Container` object to calculate its preferred
height. If this is a :class:`~prompt_toolkit.layout.VSplit` or
:class:`~prompt_toolkit.layout.HSplit` then this involves recursively querying
the child objects for their preferred widths and heights and either summing it
up, or taking maximum values depending on the actual layout.
In the end, we get the preferred height, for which we make sure it's at least
the distance from the cursor position to the bottom of the screen.


Painting to the screen
^^^^^^^^^^^^^^^^^^^^^^

Then we create a :class:`~prompt_toolkit.layout.screen.Screen` object. This is
like a canvas on which user controls can paint their content. The
:meth:`~prompt_toolkit.layout.Container.write_to_screen` method of the root
`Container` is called with the screen dimensions. This will call recursively
:meth:`~prompt_toolkit.layout.Container.write_to_screen` methods of nested
child containers, each time passing smaller dimensions while we traverse what
is a tree of `Container` objects.

The most inner containers are :class:`~prompt_toolkit.layout.Window` objects,
they will do the actual painting of the
:class:`~prompt_toolkit.layout.UIControl` to the screen. This involves line
wrapping the `UIControl`'s text and maybe scrolling the content horizontally or
vertically.


Rendering to stdout
^^^^^^^^^^^^^^^^^^^

Finally, when we have painted the screen, this needs to be rendered to stdout.
This is done by taking the difference of the previously rendered screen and the
new one. The algorithm that we have is heavily optimized to compute this
difference as quickly as possible, and call the appropriate output functions of
the :class:`~prompt_toolkit.output.Output` back-end. At the end, it will
position the cursor in the right place.


================================================
FILE: docs/pages/advanced_topics/styling.rst
================================================
.. _styling:

More about styling
==================

This page will attempt to explain in more detail how to use styling in
prompt_toolkit.

To some extent, it is very similar to how `Pygments <http://pygments.org/>`_
styling works.


Style strings
-------------

Many user interface controls, like :class:`~prompt_toolkit.layout.Window`
accept a ``style`` argument which can be used to pass the formatting as a
string. For instance, we can select a foreground color:

- ``"fg:ansired"``  (ANSI color palette)
- ``"fg:ansiblue"`` (ANSI color palette)
- ``"fg:#ffaa33"``  (hexadecimal notation)
- ``"fg:darkred"``  (named color)

Or a background color:

- ``"bg:ansired"``  (ANSI color palette)
- ``"bg:#ffaa33"``  (hexadecimal notation)

Or we can add one of the following flags:

- ``"bold"``
- ``"italic"``
- ``"underline"``
- ``"blink"``
- ``"reverse"``  (reverse foreground and background on the terminal.)
- ``"hidden"``

Or their negative variants:

- ``"nobold"``
- ``"noitalic"``
- ``"nounderline"``
- ``"noblink"``
- ``"noreverse"``
- ``"nohidden"``

All of these formatting options can be combined as well:

- ``"fg:ansiyellow bg:black bold underline"``

The style string can be given to any user control directly, or to a
:class:`~prompt_toolkit.layout.Container` object from where it will propagate
to all its children. A style defined by a parent user control can be overridden
by any of its children. The parent can for instance say ``style="bold
underline"`` where a child overrides this style partly by specifying
``style="nobold bg:ansired"``.

.. note::

    These styles are actually compatible with
    `Pygments <http://pygments.org/>`_ styles, with additional support for
    `reverse` and `blink`. Further, we ignore flags like `roman`, `sans`,
    `mono` and `border`.

The following ANSI colors are available (both for foreground and background):

.. code::

    # Low intensity, dark.  (One or two components 0x80, the other 0x00.)
    ansiblack, ansired, ansigreen, ansiyellow, ansiblue
    ansimagenta, ansicyan, ansigray

    # High intensity, bright.
    ansibrightblack, ansibrightred, ansibrightgreen, ansibrightyellow
    ansibrightblue, ansibrightmagenta, ansibrightcyan, ansiwhite

In order to know which styles are actually used in an application, it is
possible to call :meth:`~Application.get_used_style_strings`, when the
application is done.


Class names
-----------

Like we do for web design, it is not a good habit to specify all styling
inline. Instead, we can attach class names to UI controls and have a style
sheet that refers to these class names. The
:class:`~prompt_toolkit.styles.Style` can be passed as an argument to the
:class:`~prompt_toolkit.application.Application`.

.. code:: python

    from prompt_toolkit.layout import VSplit, Window
    from prompt_toolkit.styles import Style

    layout = VSplit([
        Window(BufferControl(...), style='class:left'),
        HSplit([
            Window(BufferControl(...), style='class:top'),
            Window(BufferControl(...), style='class:bottom'),
        ], style='class:right')
    ])

    style = Style([
         ('left', 'bg:ansired'),
         ('top', 'fg:#00aaaa'),
         ('bottom', 'underline bold'),
     ])

It is possible to add multiple class names to an element. That way we'll
combine the styling for these class names. Multiple classes can be passed by
using a comma separated list, or by using the ``class:`` prefix twice.

.. code:: python

   Window(BufferControl(...), style='class:left,bottom'),
   Window(BufferControl(...), style='class:left class:bottom'),

It is possible to combine class names and inline styling. The order in which
the class names and inline styling is specified determines the order of
priority. In the following example for instance, we'll take first the style of
the "header" class, and then override that with a red background color.

.. code:: python

    Window(BufferControl(...), style='class:header bg:red'),


Dot notation in class names
---------------------------

The dot operator has a special meaning in a class name. If we write:
``style="class:a.b.c"``, then this will actually expand to the following:
``style="class:a class:a.b class:a.b.c"``.

This is mainly added for `Pygments <http://pygments.org/>`_ lexers, which
specify "Tokens" like this, but it's useful in other situations as well.


Multiple classes in a style sheet
---------------------------------

A style sheet can be more complex as well. We can for instance specify two
class names. The following will underline the left part within the header, or
whatever has both the class "left" and the class "header" (the order doesn't
matter).

.. code:: python

    style = Style([
         ('header left', 'underline'),
     ])


If you have a dotted class, then it's required to specify the whole path in the
style sheet (just typing ``c`` or ``b.c`` doesn't work if the class is
``a.b.c``):

.. code:: python

    style = Style([
         ('a.b.c', 'underline'),
     ])

It is possible to combine this:

.. code:: python

    style = Style([
         ('header body left.text', 'underline'),
     ])


Evaluation order of rules in a style sheet
------------------------------------------

The style is determined as follows:

- First, we concatenate all the style strings from the root control through all
  the parents to the child in one big string. (Things at the right take
  precedence anyway.)

  E.g: ``class:body bg:#aaaaaa #000000 class:header.focused class:left.text.highlighted underline``

- Then we go through this style from left to right, starting from the default
  style. Inline styling is applied directly.

  If we come across a class name, then we generate all combinations of the
  class names that we collected so far (this one and all class names to the
  left), and for each combination which includes the new class name, we look
  for matching rules in our style sheet.  All these rules are then applied
  (later rules have higher priority).

  If we find a dotted class name, this will be expanded in the individual names
  (like ``class:left class:left.text class:left.text.highlighted``), and all
  these are applied like any class names.

- Then this final style is applied to this user interface element.


Using a dictionary as a style sheet
-----------------------------------

The order of the rules in a style sheet is meaningful, so typically, we use a
list of tuples to specify the style. But is also possible to use a dictionary
as a style sheet. This makes sense for Python 3.6, where dictionaries remember
their ordering. An ``OrderedDict`` works as well.

.. code:: python

    from prompt_toolkit.styles import Style

    style = Style.from_dict({
         'header body left.text': 'underline',
    })


Loading a style from Pygments
-----------------------------

`Pygments <http://pygments.org/>`_ has a slightly different notation for
specifying styles, because it maps styling to Pygments "Tokens". A Pygments
style can however be loaded and used as follows:

.. code:: python

    from prompt_toolkit.styles.pygments import style_from_pygments_cls
    from pygments.styles import get_style_by_name

    style = style_from_pygments_cls(get_style_by_name('monokai'))


Merging styles together
-----------------------

Multiple :class:`~prompt_toolkit.styles.Style` objects can be merged together as
follows:

.. code:: python

    from prompt_toolkit.styles import merge_styles

    style = merge_styles([
        style1,
        style2,
        style3
    ])


Color depths
------------

There are four different levels of color depths available:

+--------+-----------------+-----------------------------+---------------------------------+
| 1 bit  | Black and white | ``ColorDepth.DEPTH_1_BIT``  | ``ColorDepth.MONOCHROME``       |
+--------+-----------------+-----------------------------+---------------------------------+
| 4 bit  | ANSI colors     | ``ColorDepth.DEPTH_4_BIT``  | ``ColorDepth.ANSI_COLORS_ONLY`` |
+--------+-----------------+-----------------------------+---------------------------------+
| 8 bit  | 256 colors      | ``ColorDepth.DEPTH_8_BIT``  | ``ColorDepth.DEFAULT``          |
+--------+-----------------+-----------------------------+---------------------------------+
| 24 bit | True colors     | ``ColorDepth.DEPTH_24_BIT`` | ``ColorDepth.TRUE_COLOR``       |
+--------+-----------------+-----------------------------+---------------------------------+

By default, 256 colors are used, because this is what most terminals support
these days. If the ``TERM`` environment variable is set to ``linux`` or
``eterm-color``, then only ANSI colors are used, because of these terminals. The 24
bit true color output needs to be enabled explicitly. When 4 bit color output
is chosen, all colors will be mapped to the closest ANSI color.

Setting the default color depth for any prompt_toolkit application can be done
by setting the ``PROMPT_TOOLKIT_COLOR_DEPTH`` environment variable. You could
for instance copy the following into your `.bashrc` file.

.. code:: shell

    # export PROMPT_TOOLKIT_COLOR_DEPTH=DEPTH_1_BIT
    export PROMPT_TOOLKIT_COLOR_DEPTH=DEPTH_4_BIT
    # export PROMPT_TOOLKIT_COLOR_DEPTH=DEPTH_8_BIT
    # export PROMPT_TOOLKIT_COLOR_DEPTH=DEPTH_24_BIT

An application can also decide to set the color depth manually by passing a
:class:`~prompt_toolkit.output.ColorDepth` value to the
:class:`~prompt_toolkit.application.Application` object:

.. code:: python

    from prompt_toolkit.output.color_depth import ColorDepth

    app = Application(
        color_depth=ColorDepth.ANSI_COLORS_ONLY,
        # ...
    )


Style transformations
---------------------

Prompt_toolkit supports a way to apply certain transformations to the styles
near the end of the rendering pipeline. This can be used for instance to change
certain colors to improve the rendering in some terminals.

One useful example is the
:class:`~prompt_toolkit.styles.AdjustBrightnessStyleTransformation` class,
which takes `min_brightness` and `max_brightness` as arguments which by default
have 0.0 and 1.0 as values. In the following code snippet, we increase the
minimum brightness to improve rendering on terminals with a dark background.

.. code:: python

    from prompt_toolkit.styles import AdjustBrightnessStyleTransformation

    app = Application(
        style_transformation=AdjustBrightnessStyleTransformation(
            min_brightness=0.5,  # Increase the minimum brightness.
            max_brightness=1.0,
        )
        # ...
    )


================================================
FILE: docs/pages/advanced_topics/unit_testing.rst
================================================
.. _unit_testing:

Unit testing
============

Testing user interfaces is not always obvious. Here are a few tricks for
testing prompt_toolkit applications.


`PosixPipeInput` and `DummyOutput`
----------------------------------

During the creation of a prompt_toolkit
:class:`~prompt_toolkit.application.Application`, we can specify what input and
output device to be used. By default, these are output objects that correspond
with `sys.stdin` and `sys.stdout`. In unit tests however, we want to replace
these.

- For the input, we want a "pipe input". This is an input device, in which we
  can programmatically send some input. It can be created with
  :func:`~prompt_toolkit.input.create_pipe_input`, and that return either a
  :class:`~prompt_toolkit.input.posix_pipe.PosixPipeInput` or a
  :class:`~prompt_toolkit.input.win32_pipe.Win32PipeInput` depending on the
  platform.
- For the output, we want a :class:`~prompt_toolkit.output.DummyOutput`. This is
  an output device that doesn't render anything. We don't want to render
  anything to `sys.stdout` in the unit tests.

.. note::

    Typically, we don't want to test the bytes that are written to
    `sys.stdout`, because these can change any time when the rendering
    algorithm changes, and are not so meaningful anyway. Instead, we want to
    test the return value from the
    :class:`~prompt_toolkit.application.Application` or test how data
    structures (like text buffers) change over time.

So we programmatically feed some input to the input pipe, have the key
bindings process the input and then test what comes out of it.

In the following example we use a
:class:`~prompt_toolkit.shortcuts.PromptSession`, but the same works for any
:class:`~prompt_toolkit.application.Application`.

.. code:: python

    from prompt_toolkit.shortcuts import PromptSession
    from prompt_toolkit.input import create_pipe_input
    from prompt_toolkit.output import DummyOutput

    def test_prompt_session():
        with create_pipe_input() as inp:
            inp.send_text("hello\n")
            session = PromptSession(
                input=inp,
                output=DummyOutput(),
            )

            result = session.prompt()

        assert result == "hello"

In the above example, don't forget to send the `\\n` character to accept the
prompt, otherwise the :class:`~prompt_toolkit.application.Application` will
wait forever for some more input to receive.

Using an :class:`~prompt_toolkit.application.current.AppSession`
----------------------------------------------------------------

Sometimes it's not convenient to pass input or output objects to the
:class:`~prompt_toolkit.application.Application`, and in some situations it's
not even possible at all.
This happens when these parameters are not passed down the call stack, through
all function calls.

An easy way to specify which input/output to use for all applications, is by
creating an :class:`~prompt_toolkit.application.current.AppSession` with this
input/output and running all code in that
:class:`~prompt_toolkit.application.current.AppSession`. This way, we don't
need to inject it into every :class:`~prompt_toolkit.application.Application`
or :func:`~prompt_toolkit.shortcuts.print_formatted_text` call.

Here is an example where we use
:func:`~prompt_toolkit.application.create_app_session`:

.. code:: python

    from prompt_toolkit.application import create_app_session
    from prompt_toolkit.shortcuts import print_formatted_text
    from prompt_toolkit.output import DummyOutput

    def test_something():
        with create_app_session(output=DummyOutput()):
            ...
            print_formatted_text('Hello world')
            ...

Pytest fixtures
---------------

In order to get rid of the boilerplate of creating the input, the
:class:`~prompt_toolkit.output.DummyOutput`, and the
:class:`~prompt_toolkit.application.current.AppSession`, we create a
single fixture that does it for every test. Something like this:

.. code:: python

    import pytest
    from prompt_toolkit.application import create_app_session
    from prompt_toolkit.input import create_pipe_input
    from prompt_toolkit.output import DummyOutput

    @pytest.fixture(autouse=True, scope="function")
    def mock_input():
        with create_pipe_input() as pipe_input:
            with create_app_session(input=pipe_input, output=DummyOutput()):
                yield pipe_input

For compatibility with pytest's ``capsys`` fixture, we have to create a new
:class:`~prompt_toolkit.application.current.AppSession` for every test. This
can be done in an autouse fixture. Pytest replaces ``sys.stdout`` with a new
object in every test that uses ``capsys`` and the following will ensure that
the new :class:`~prompt_toolkit.application.current.AppSession` will each time
refer to the latest output.

.. code:: python

    from prompt_toolkit.application import create_app_session

    @fixture(autouse=True, scope="function")
    def _pt_app_session()
        with create_app_session():
            yield

Type checking
-------------

Prompt_toolkit 3.0 is fully type annotated. This means that if a
prompt_toolkit application is typed too, it can be verified with mypy. This is
complementary to unit tests, but also great for testing for correctness.


================================================
FILE: docs/pages/asking_for_a_choice.rst
================================================
.. _asking_for_input:

Asking for a choice
===================

Similar to how the :func:`~prompt_toolkit.shortcuts.prompt` function allows for
text input, prompt_toolkit has a
:func:`~prompt_toolkit.shortcuts.choice` function to ask for a choice
from a list of options:

.. code:: python

    from prompt_toolkit.shortcuts import choice

    result = choice(
        message="Please choose a dish:",
        options=[
            ("pizza", "Pizza with mushrooms"),
            ("salad", "Salad with tomatoes"),
            ("sushi", "Sushi"),
        ],
        default="salad",
    )
    print(f"You have chosen: {result}")

.. image:: ../images/choice-input.png


Coloring the options
--------------------

It is possible to customize the colors and styles. The ``message`` parameter
takes any :ref:`formatted text <formatted_text>`, and the labels (2nd argument
from the options) can be :ref:`formatted text <formatted_text>` as well.
Further, we can pass a :class:`~prompt_toolkit.styles.Style` instance using the
:meth:`~prompt_toolkit.styles.Style.from_dict` function:

.. code:: python

    from prompt_toolkit.formatted_text import HTML
    from prompt_toolkit.shortcuts import choice
    from prompt_toolkit.styles import Style

    style = Style.from_dict(
        {
            "input-selection": "fg:#ff0000",
            "number": "fg:#884444 bold",
            "selected-option": "underline",
        }
    )

    result = choice(
        message=HTML("<u>Please select a dish</u>:"),
        options=[
            ("pizza", "Pizza with mushrooms"),
            (
                "salad",
                HTML("<ansigreen>Salad</ansigreen> with <ansired>tomatoes</ansired>"),
            ),
            ("sushi", "Sushi"),
        ],
        style=style,
    )
    print(f"You have chosen: {result}")

.. image:: ../images/colored-choice.png


Adding a frame
--------------

The :func:`~prompt_toolkit.shortcuts.choice` function takes a
``show_frame`` argument. When ``True``, the input is displayed within a frame.
It is also possible to pass a :ref:`filter <filters>`, like ``~is_done``, so
that the frame is only displayed when asking for input, but hidden once the
input is accepted.

.. code:: python

    from prompt_toolkit.shortcuts import choice
    from prompt_toolkit.filters import is_done
    from prompt_toolkit.styles import Style

    style = Style.from_dict(
        {
            "frame.border": "#884444",
            "selected-option": "bold",
        }
    )
    result = choice(
        message="Please select a dish:",
        options=[
            ("pizza", "Pizza with mushrooms"),
            ("salad", "Salad with tomatoes"),
            ("sushi", "Sushi"),
        ],
        style=style,
        show_frame=~is_done,
    )
    print(f"You have chosen: {result}")

.. image:: ../images/choice-with-frame.png


Adding a bottom toolbar
-----------------------

Adding a bottom toolbar can be done by passing a ``bottom_toolbar`` argument to
:func:`~prompt_toolkit.shortcuts.choice`. This argument can be plain text,
:ref:`formatted text <formatted_text>` or a callable that returns plain or
formatted text.


.. code:: python

    from prompt_toolkit.filters import is_done
    from prompt_toolkit.formatted_text import HTML
    from prompt_toolkit.shortcuts import choice
    from prompt_toolkit.styles import Style

    style = Style.from_dict(
        {
            "frame.border": "#ff4444",
            "selected-option": "bold",
            # ('noreverse' because the default toolbar style uses 'reverse')
            "bottom-toolbar": "#ffffff bg:#333333 noreverse",
        }
    )

    result = choice(
        message=HTML("<u>Please select a dish</u>:"),
        options=[
            ("pizza", "Pizza with mushrooms"),
            ("salad", "Salad with tomatoes"),
            ("sushi", "Sushi"),
        ],
        style=style,
        bottom_toolbar=HTML(
            " Press <b>[Up]</b>/<b>[Down]</b> to select, <b>[Enter]</b> to accept."
        ),
        show_frame=~is_done,
    )
    print(f"You have chosen: {result}")

.. image:: ../images/choice-with-frame-and-bottom-toolbar.png


================================================
FILE: docs/pages/asking_for_input.rst
================================================
.. _asking_for_input:

Asking for input (prompts)
==========================

This page is about building prompts. Pieces of code that we can embed in a
program for asking the user for input. Even if you want to use `prompt_toolkit`
for building full screen terminal applications, it is probably still a good
idea to read this first, before heading to the :ref:`building full screen
applications <full_screen_applications>` page.

In this page, we will cover autocompletion, syntax highlighting, key bindings,
and so on.


Hello world
-----------

The following snippet is the most simple example, it uses the
:func:`~prompt_toolkit.shortcuts.prompt` function to ask the user for input
and returns the text. Just like ``(raw_)input``.

.. code:: python

    from prompt_toolkit import prompt

    text = prompt("Give me some input: ")
    print(f"You said: {text}")

.. image:: ../images/hello-world-prompt.png

What we get here is a simple prompt that supports the Emacs key bindings like
readline, but further nothing special. However,
:func:`~prompt_toolkit.shortcuts.prompt` has a lot of configuration options.
In the following sections, we will discover all these parameters.


The `PromptSession` object
--------------------------

Instead of calling the :func:`~prompt_toolkit.shortcuts.prompt` function, it's
also possible to create a :class:`~prompt_toolkit.shortcuts.PromptSession`
instance followed by calling its
:meth:`~prompt_toolkit.shortcuts.PromptSession.prompt` method for every input
call. This creates a kind of an input session.

.. code:: python

    from prompt_toolkit import PromptSession

    # Create prompt object.
    session = PromptSession()

    # Do multiple input calls.
    text1 = session.prompt()
    text2 = session.prompt()

This has mainly two advantages:

- The input history will be kept between consecutive
  :meth:`~prompt_toolkit.shortcuts.PromptSession.prompt` calls.

- The :func:`~prompt_toolkit.shortcuts.PromptSession` instance and its
  :meth:`~prompt_toolkit.shortcuts.PromptSession.prompt` method take about the
  same arguments, like all the options described below (highlighting,
  completion, etc...). So if you want to ask for multiple inputs, but each
  input call needs about the same arguments, they can be passed to the
  :func:`~prompt_toolkit.shortcuts.PromptSession` instance as well, and they
  can be overridden by passing values to the
  :meth:`~prompt_toolkit.shortcuts.PromptSession.prompt` method.


Syntax highlighting
-------------------

Adding syntax highlighting is as simple as adding a lexer. All of the `Pygments
<http://pygments.org/>`_ lexers can be used after wrapping them in a
:class:`~prompt_toolkit.lexers.PygmentsLexer`. It is also possible to create a
custom lexer by implementing the :class:`~prompt_toolkit.lexers.Lexer` abstract
base class.

.. code:: python

    from pygments.lexers.html import HtmlLexer
    from prompt_toolkit.shortcuts import prompt
    from prompt_toolkit.lexers import PygmentsLexer

    text = prompt("Enter HTML: ", lexer=PygmentsLexer(HtmlLexer))
    print(f"You said: {text}")

.. image:: ../images/html-input.png

The default Pygments colorscheme is included as part of the default style in
prompt_toolkit. If you want to use another Pygments style along with the lexer,
you can do the following:

.. code:: python

    from pygments.lexers.html import HtmlLexer
    from pygments.styles import get_style_by_name
    from prompt_toolkit.shortcuts import prompt
    from prompt_toolkit.lexers import PygmentsLexer
    from prompt_toolkit.styles.pygments import style_from_pygments_cls

    style = style_from_pygments_cls(get_style_by_name("monokai"))
    text = prompt(
        "Enter HTML: ",
        lexer=PygmentsLexer(HtmlLexer),
        style=style,
        include_default_pygments_style=False
    )
    print(f"You said: {text}")

We pass ``include_default_pygments_style=False``, because otherwise, both
styles will be merged, possibly giving slightly different colors in the outcome
for cases where where our custom Pygments style doesn't specify a color.

.. _colors:

Colors
------

The colors for syntax highlighting are defined by a
:class:`~prompt_toolkit.styles.Style` instance. By default, a neutral
built-in style is used, but any style instance can be passed to the
:func:`~prompt_toolkit.shortcuts.prompt` function. A simple way to create a
style, is by using the :meth:`~prompt_toolkit.styles.Style.from_dict`
function:

.. code:: python

    from pygments.lexers.html import HtmlLexer
    from prompt_toolkit.shortcuts import prompt
    from prompt_toolkit.styles import Style
    from prompt_toolkit.lexers import PygmentsLexer

    our_style = Style.from_dict({
        "pygments.comment": "#888888 bold",
        "pygments.keyword": "#ff88ff bold",
    })

    text = prompt(
        "Enter HTML: ",
        lexer=PygmentsLexer(HtmlLexer),
        style=our_style
    )


The style dictionary is very similar to the Pygments ``styles`` dictionary,
with a few differences:

- The `roman`, `sans`, `mono` and `border` options are ignored.
- The style has a few additions: ``blink``, ``noblink``, ``reverse`` and ``noreverse``.
- Colors can be in the ``#ff0000`` format, but they can be one of the built-in
  ANSI color names as well. In that case, they map directly to the 16 color
  palette of the terminal.

:ref:`Read more about styling <styling>`.


Using a Pygments style
^^^^^^^^^^^^^^^^^^^^^^

All Pygments style classes can be used as well, when they are wrapped through
:func:`~prompt_toolkit.styles.style_from_pygments_cls`.

Suppose we'd like to use a Pygments style, for instance
``pygments.styles.tango.TangoStyle``, that is possible like this:

.. code:: python

    from prompt_toolkit.shortcuts import prompt
    from prompt_toolkit.styles import style_from_pygments_cls
    from prompt_toolkit.lexers import PygmentsLexer
    from pygments.styles.tango import TangoStyle
    from pygments.lexers.html import HtmlLexer

    tango_style = style_from_pygments_cls(TangoStyle)

    text = prompt(
        "Enter HTML: ",
        lexer=PygmentsLexer(HtmlLexer),
        style=tango_style
    )

Creating a custom style could be done like this:

.. code:: python

    from prompt_toolkit.shortcuts import prompt
    from prompt_toolkit.styles import Style, style_from_pygments_cls, merge_styles
    from prompt_toolkit.lexers import PygmentsLexer

    from pygments.styles.tango import TangoStyle
    from pygments.lexers.html import HtmlLexer

    our_style = merge_styles([
        style_from_pygments_cls(TangoStyle),
        Style.from_dict({
            "pygments.comment": "#888888 bold",
            "pygments.keyword": "#ff88ff bold",
        })
    ])

    text = prompt(
        "Enter HTML: ",
        lexer=PygmentsLexer(HtmlLexer),
        style=our_style
    )


Coloring the prompt itself
^^^^^^^^^^^^^^^^^^^^^^^^^^

It is possible to add some colors to the prompt itself. For this, we need to
build some :ref:`formatted text <formatted_text>`. One way of doing this is by
creating a list of style/text tuples. In the following example, we use class
names to refer to the style.

.. code:: python

    from prompt_toolkit.shortcuts import prompt
    from prompt_toolkit.styles import Style

    style = Style.from_dict({
        # User input (default text).
        "":          "#ff0066",

        # Prompt.
        "username": "#884444",
        "at":       "#00aa00",
        "colon":    "#0000aa",
        "pound":    "#00aa00",
        "host":     "#00ffff bg:#444400",
        "path":     "ansicyan underline",
    })

    message = [
        ("class:username", "john"),
        ("class:at",       "@"),
        ("class:host",     "localhost"),
        ("class:colon",    ":"),
        ("class:path",     "/user/john"),
        ("class:pound",    "# "),
    ]

    text = prompt(message, style=style)

.. image:: ../images/colored-prompt.png

The `message` can be any kind of formatted text, as discussed :ref:`here
<formatted_text>`. It can also be a callable that returns some formatted text.

By default, colors are taken from the 256 color palette. If you want to have
24bit true color, this is possible by adding the
``color_depth=ColorDepth.TRUE_COLOR`` option to the
:func:`~prompt_toolkit.shortcuts.prompt.prompt` function.

.. code:: python

    from prompt_toolkit.output import ColorDepth

    text = prompt(message, style=style, color_depth=ColorDepth.TRUE_COLOR)


Autocompletion
--------------

Autocompletion can be added by passing a ``completer`` parameter. This should
be an instance of the :class:`~prompt_toolkit.completion.Completer` abstract
base class. :class:`~prompt_toolkit.completion.WordCompleter` is an example of
a completer that implements that interface.

.. code:: python

    from prompt_toolkit import prompt
    from prompt_toolkit.completion import WordCompleter

    html_completer = WordCompleter(["<html>", "<body>", "<head>", "<title>"])
    text = prompt("Enter HTML: ", completer=html_completer)
    print(f"You said: {text}")

:class:`~prompt_toolkit.completion.WordCompleter` is a simple completer that
completes the last word before the cursor with any of the given words.

.. image:: ../images/html-completion.png

.. note::

    Note that in prompt_toolkit 2.0, the auto completion became synchronous. This
    means that if it takes a long time to compute the completions, that this
    will block the event loop and the input processing.

    For heavy completion algorithms, it is recommended to wrap the completer in
    a :class:`~prompt_toolkit.completion.ThreadedCompleter` in order to run it
    in a background thread.


Nested completion
^^^^^^^^^^^^^^^^^

Sometimes you have a command line interface where the completion depends on the
previous words from the input. Examples are the CLIs from routers and switches.
A simple :class:`~prompt_toolkit.completion.WordCompleter` is not enough in
that case. We want to to be able to define completions at multiple hierarchical
levels. :class:`~prompt_toolkit.completion.NestedCompleter` solves this issue:

.. code:: python

    from prompt_toolkit import prompt
    from prompt_toolkit.completion import NestedCompleter

    completer = NestedCompleter.from_nested_dict({
        "show": {
            "version": None,
            "clock": None,
            "ip": {
                "interface": {"brief"}
            }
        },
        "exit": None,
    })

    text = prompt("# ", completer=completer)
    print(f"You said: {text}")

Whenever there is a ``None`` value in the dictionary, it means that there is no
further nested completion at that point. When all values of a dictionary would
be ``None``, it can also be replaced with a set.


A custom completer
^^^^^^^^^^^^^^^^^^

For more complex examples, it makes sense to create a custom completer. For
instance:

.. code:: python

    from prompt_toolkit import prompt
    from prompt_toolkit.completion import Completer, Completion

    class MyCustomCompleter(Completer):
        def get_completions(self, document, complete_event):
            yield Completion("completion", start_position=0)

    text = prompt("> ", completer=MyCustomCompleter())

A :class:`~prompt_toolkit.completion.Completer` class has to implement a
generator named :meth:`~prompt_toolkit.completion.Completer.get_completions`
that takes a :class:`~prompt_toolkit.document.Document` and yields the current
:class:`~prompt_toolkit.completion.Completion` instances. Each completion
contains a portion of text, and a position.

The position is used for fixing text before the cursor. Pressing the tab key
could for instance turn parts of the input from lowercase to uppercase. This
makes sense for a case insensitive completer. Or in case of a fuzzy completion,
it could fix typos. When ``start_position`` is something negative, this amount
of characters will be deleted and replaced.


Styling individual completions
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

Each completion can provide a custom style, which is used when it is rendered
in the completion menu or toolbar. This is possible by passing a style to each
:class:`~prompt_toolkit.completion.Completion` instance.

.. code:: python

    from prompt_toolkit.completion import Completer, Completion

    class MyCustomCompleter(Completer):
        def get_completions(self, document, complete_event):
            # Display this completion, black on yellow.
            yield Completion(
                "completion1",
                start_position=0,
                style="bg:ansiyellow fg:ansiblack"
            )

            # Underline completion.
            yield Completion(
                "completion2",
                start_position=0,
                style="underline"
            )

            # Specify class name, which will be looked up in the style sheet.
            yield Completion(
                "completion3",
                start_position=0,
                style="class:special-completion"
            )

The "colorful-prompts.py" example uses completion styling:

.. image:: ../images/colorful-completions.png

Finally, it is possible to pass :ref:`formatted text <formatted_text>` for the
``display`` attribute of a :class:`~prompt_toolkit.completion.Completion`. This
provides all the freedom you need to display the text in any possible way. It
can also be combined with the ``style`` attribute. For instance:

.. code:: python


    from prompt_toolkit.completion import Completer, Completion
    from prompt_toolkit.formatted_text import HTML

    class MyCustomCompleter(Completer):
        def get_completions(self, document, complete_event):
            yield Completion(
                "completion1",
                start_position=0,
                display=HTML("<b>completion</b><ansired>1</ansired>"),
                style="bg:ansiyellow"
            )


Fuzzy completion
^^^^^^^^^^^^^^^^

If one possible completions is "django_migrations", a fuzzy completer would
allow you to get this by typing "djm" only, a subset of characters for this
string.

Prompt_toolkit ships with a :class:`~prompt_toolkit.completion.FuzzyCompleter`
and :class:`~prompt_toolkit.completion.FuzzyWordCompleter` class. These provide
the means for doing this kind of "fuzzy completion". The first one can take any
completer instance and wrap it so that it becomes a fuzzy completer. The second
one behaves like a :class:`~prompt_toolkit.completion.WordCompleter` wrapped
into a :class:`~prompt_toolkit.completion.FuzzyCompleter`.


Complete while typing
^^^^^^^^^^^^^^^^^^^^^

Autcompletions can be generated automatically while typing or when the user
presses the tab key. This can be configured with the ``complete_while_typing``
option:

.. code:: python

    text = prompt(
        "Enter HTML: ",
        completer=my_completer,
        complete_while_typing=True
    )

Notice that this setting is incompatible with the ``enable_history_search``
option. The reason for this is that the up and down key bindings would conflict
otherwise. So, make sure to disable history search for this.


Asynchronous completion
^^^^^^^^^^^^^^^^^^^^^^^

When generating the completions takes a lot of time, it's better to do this in
a background thread. This is possible by wrapping the completer in a
:class:`~prompt_toolkit.completion.ThreadedCompleter`, but also by passing the
`complete_in_thread=True` argument.


.. code:: python

    text = prompt("> ", completer=MyCustomCompleter(), complete_in_thread=True)


Input validation
----------------

A prompt can have a validator attached. This is some code that will check
whether the given input is acceptable and it will only return it if that's the
case. Otherwise it will show an error message and move the cursor to a given
position.

A validator should implements the :class:`~prompt_toolkit.validation.Validator`
abstract base class. This requires only one method, named ``validate`` that
takes a :class:`~prompt_toolkit.document.Document` as input and raises
:class:`~prompt_toolkit.validation.ValidationError` when the validation fails.

.. code:: python

    from prompt_toolkit.validation import Validator, ValidationError
    from prompt_toolkit import prompt

    class NumberValidator(Validator):
        def validate(self, document):
            text = document.text

            if text and not text.isdigit():
                i = 0

                # Get index of first non numeric character.
                # We want to move the cursor here.
                for i, c in enumerate(text):
                    if not c.isdigit():
                        break

                raise ValidationError(
                    message="This input contains non-numeric characters",
                    cursor_position=i
                )

    number = int(prompt("Give a number: ", validator=NumberValidator()))
    print(f"You said: {number}")

.. image:: ../images/number-validator.png

By default, the input is validated in real-time while the user is typing, but
prompt_toolkit can also validate after the user presses the enter key:

.. code:: python

    prompt(
        "Give a number: ",
        validator=NumberValidator(),
        validate_while_typing=False
    )

If the input validation contains some heavy CPU intensive code, but you don't
want to block the event loop, then it's recommended to wrap the validator class
in a :class:`~prompt_toolkit.validation.ThreadedValidator`.

Validator from a callable
^^^^^^^^^^^^^^^^^^^^^^^^^

Instead of implementing the :class:`~prompt_toolkit.validation.Validator`
abstract base class, it is also possible to start from a simple function and
use the :meth:`~prompt_toolkit.validation.Validator.from_callable` classm
Download .txt
gitextract_htk8glhs/

├── .codecov.yml
├── .github/
│   └── workflows/
│       └── test.yaml
├── .gitignore
├── .pre-commit-config.yaml
├── .readthedocs.yml
├── AUTHORS.rst
├── CHANGELOG
├── LICENSE
├── MANIFEST.in
├── PROJECTS.rst
├── README.rst
├── appveyor.yml
├── docs/
│   ├── conf.py
│   ├── index.rst
│   ├── make.bat
│   ├── pages/
│   │   ├── advanced_topics/
│   │   │   ├── architecture.rst
│   │   │   ├── asyncio.rst
│   │   │   ├── filters.rst
│   │   │   ├── index.rst
│   │   │   ├── input_hooks.rst
│   │   │   ├── key_bindings.rst
│   │   │   ├── rendering_flow.rst
│   │   │   ├── rendering_pipeline.rst
│   │   │   ├── styling.rst
│   │   │   └── unit_testing.rst
│   │   ├── asking_for_a_choice.rst
│   │   ├── asking_for_input.rst
│   │   ├── dialogs.rst
│   │   ├── full_screen_apps.rst
│   │   ├── gallery.rst
│   │   ├── getting_started.rst
│   │   ├── printing_text.rst
│   │   ├── progress_bars.rst
│   │   ├── reference.rst
│   │   ├── related_projects.rst
│   │   ├── tutorials/
│   │   │   ├── index.rst
│   │   │   └── repl.rst
│   │   └── upgrading/
│   │       ├── 2.0.rst
│   │       ├── 3.0.rst
│   │       └── index.rst
│   └── requirements.txt
├── examples/
│   ├── choices/
│   │   ├── color.py
│   │   ├── default.py
│   │   ├── frame-and-bottom-toolbar.py
│   │   ├── gray-frame-on-accept.py
│   │   ├── many-choices.py
│   │   ├── mouse-support.py
│   │   ├── simple-selection.py
│   │   └── with-frame.py
│   ├── dialogs/
│   │   ├── button_dialog.py
│   │   ├── checkbox_dialog.py
│   │   ├── input_dialog.py
│   │   ├── messagebox.py
│   │   ├── password_dialog.py
│   │   ├── progress_dialog.py
│   │   ├── radio_dialog.py
│   │   ├── styled_messagebox.py
│   │   └── yes_no_dialog.py
│   ├── full-screen/
│   │   ├── ansi-art-and-textarea.py
│   │   ├── buttons.py
│   │   ├── calculator.py
│   │   ├── dummy-app.py
│   │   ├── full-screen-demo.py
│   │   ├── hello-world.py
│   │   ├── no-layout.py
│   │   ├── pager.py
│   │   ├── scrollable-panes/
│   │   │   ├── simple-example.py
│   │   │   └── with-completion-menu.py
│   │   ├── simple-demos/
│   │   │   ├── alignment.py
│   │   │   ├── autocompletion.py
│   │   │   ├── colorcolumn.py
│   │   │   ├── cursorcolumn-cursorline.py
│   │   │   ├── float-transparency.py
│   │   │   ├── floats.py
│   │   │   ├── focus.py
│   │   │   ├── horizontal-align.py
│   │   │   ├── horizontal-split.py
│   │   │   ├── line-prefixes.py
│   │   │   ├── margins.py
│   │   │   ├── vertical-align.py
│   │   │   └── vertical-split.py
│   │   ├── split-screen.py
│   │   └── text-editor.py
│   ├── gevent-get-input.py
│   ├── print-text/
│   │   ├── ansi-colors.py
│   │   ├── ansi.py
│   │   ├── html.py
│   │   ├── named-colors.py
│   │   ├── print-formatted-text.py
│   │   ├── print-frame.py
│   │   ├── prompt-toolkit-logo-ansi-art.py
│   │   ├── pygments-tokens.py
│   │   └── true-color-demo.py
│   ├── progress-bar/
│   │   ├── a-lot-of-parallel-tasks.py
│   │   ├── colored-title-and-label.py
│   │   ├── custom-key-bindings.py
│   │   ├── many-parallel-tasks.py
│   │   ├── nested-progress-bars.py
│   │   ├── scrolling-task-name.py
│   │   ├── simple-progress-bar.py
│   │   ├── styled-1.py
│   │   ├── styled-2.py
│   │   ├── styled-apt-get-install.py
│   │   ├── styled-rainbow.py
│   │   ├── styled-tqdm-1.py
│   │   ├── styled-tqdm-2.py
│   │   ├── two-tasks.py
│   │   └── unknown-length.py
│   ├── prompts/
│   │   ├── accept-default.py
│   │   ├── asyncio-prompt.py
│   │   ├── auto-completion/
│   │   │   ├── autocomplete-with-control-space.py
│   │   │   ├── autocompletion-like-readline.py
│   │   │   ├── autocompletion.py
│   │   │   ├── colored-completions-with-formatted-text.py
│   │   │   ├── colored-completions.py
│   │   │   ├── combine-multiple-completers.py
│   │   │   ├── fuzzy-custom-completer.py
│   │   │   ├── fuzzy-word-completer.py
│   │   │   ├── multi-column-autocompletion-with-meta.py
│   │   │   ├── multi-column-autocompletion.py
│   │   │   ├── nested-autocompletion.py
│   │   │   └── slow-completions.py
│   │   ├── auto-suggestion.py
│   │   ├── autocorrection.py
│   │   ├── bottom-toolbar.py
│   │   ├── clock-input.py
│   │   ├── colored-prompt.py
│   │   ├── confirmation-prompt.py
│   │   ├── cursor-shapes.py
│   │   ├── custom-key-binding.py
│   │   ├── custom-lexer.py
│   │   ├── custom-vi-operator-and-text-object.py
│   │   ├── enforce-tty-input-output.py
│   │   ├── fancy-zsh-prompt.py
│   │   ├── finalterm-shell-integration.py
│   │   ├── get-input-vi-mode.py
│   │   ├── get-input-with-default.py
│   │   ├── get-input.py
│   │   ├── get-multiline-input.py
│   │   ├── get-password-with-toggle-display-shortcut.py
│   │   ├── get-password.py
│   │   ├── history/
│   │   │   ├── persistent-history.py
│   │   │   └── slow-history.py
│   │   ├── html-input.py
│   │   ├── input-validation.py
│   │   ├── inputhook.py
│   │   ├── mouse-support.py
│   │   ├── multiline-autosuggest.py
│   │   ├── multiline-prompt.py
│   │   ├── no-wrapping.py
│   │   ├── operate-and-get-next.py
│   │   ├── patch-stdout.py
│   │   ├── placeholder-text.py
│   │   ├── regular-language.py
│   │   ├── rprompt.py
│   │   ├── swap-light-and-dark-colors.py
│   │   ├── switch-between-vi-emacs.py
│   │   ├── system-clipboard-integration.py
│   │   ├── system-prompt.py
│   │   ├── terminal-title.py
│   │   ├── up-arrow-partial-string-matching.py
│   │   └── with-frames/
│   │       ├── frame-and-autocompletion.py
│   │       ├── gray-frame-on-accept.py
│   │       └── with-frame.py
│   ├── ssh/
│   │   └── asyncssh-server.py
│   ├── telnet/
│   │   ├── chat-app.py
│   │   ├── dialog.py
│   │   ├── hello-world.py
│   │   └── toolbar.py
│   └── tutorial/
│       ├── README.md
│       └── sqlite-cli.py
├── pyproject.toml
├── src/
│   └── prompt_toolkit/
│       ├── __init__.py
│       ├── application/
│       │   ├── __init__.py
│       │   ├── application.py
│       │   ├── current.py
│       │   ├── dummy.py
│       │   └── run_in_terminal.py
│       ├── auto_suggest.py
│       ├── buffer.py
│       ├── cache.py
│       ├── clipboard/
│       │   ├── __init__.py
│       │   ├── base.py
│       │   ├── in_memory.py
│       │   └── pyperclip.py
│       ├── completion/
│       │   ├── __init__.py
│       │   ├── base.py
│       │   ├── deduplicate.py
│       │   ├── filesystem.py
│       │   ├── fuzzy_completer.py
│       │   ├── nested.py
│       │   └── word_completer.py
│       ├── contrib/
│       │   ├── __init__.py
│       │   ├── completers/
│       │   │   ├── __init__.py
│       │   │   └── system.py
│       │   ├── regular_languages/
│       │   │   ├── __init__.py
│       │   │   ├── compiler.py
│       │   │   ├── completion.py
│       │   │   ├── lexer.py
│       │   │   ├── regex_parser.py
│       │   │   └── validation.py
│       │   ├── ssh/
│       │   │   ├── __init__.py
│       │   │   └── server.py
│       │   └── telnet/
│       │       ├── __init__.py
│       │       ├── log.py
│       │       ├── protocol.py
│       │       └── server.py
│       ├── cursor_shapes.py
│       ├── data_structures.py
│       ├── document.py
│       ├── enums.py
│       ├── eventloop/
│       │   ├── __init__.py
│       │   ├── async_generator.py
│       │   ├── inputhook.py
│       │   ├── utils.py
│       │   └── win32.py
│       ├── filters/
│       │   ├── __init__.py
│       │   ├── app.py
│       │   ├── base.py
│       │   ├── cli.py
│       │   └── utils.py
│       ├── formatted_text/
│       │   ├── __init__.py
│       │   ├── ansi.py
│       │   ├── base.py
│       │   ├── html.py
│       │   ├── pygments.py
│       │   └── utils.py
│       ├── history.py
│       ├── input/
│       │   ├── __init__.py
│       │   ├── ansi_escape_sequences.py
│       │   ├── base.py
│       │   ├── defaults.py
│       │   ├── posix_pipe.py
│       │   ├── posix_utils.py
│       │   ├── typeahead.py
│       │   ├── vt100.py
│       │   ├── vt100_parser.py
│       │   ├── win32.py
│       │   └── win32_pipe.py
│       ├── key_binding/
│       │   ├── __init__.py
│       │   ├── bindings/
│       │   │   ├── __init__.py
│       │   │   ├── auto_suggest.py
│       │   │   ├── basic.py
│       │   │   ├── completion.py
│       │   │   ├── cpr.py
│       │   │   ├── emacs.py
│       │   │   ├── focus.py
│       │   │   ├── mouse.py
│       │   │   ├── named_commands.py
│       │   │   ├── open_in_editor.py
│       │   │   ├── page_navigation.py
│       │   │   ├── scroll.py
│       │   │   ├── search.py
│       │   │   └── vi.py
│       │   ├── defaults.py
│       │   ├── digraphs.py
│       │   ├── emacs_state.py
│       │   ├── key_bindings.py
│       │   ├── key_processor.py
│       │   └── vi_state.py
│       ├── keys.py
│       ├── layout/
│       │   ├── __init__.py
│       │   ├── containers.py
│       │   ├── controls.py
│       │   ├── dimension.py
│       │   ├── dummy.py
│       │   ├── layout.py
│       │   ├── margins.py
│       │   ├── menus.py
│       │   ├── mouse_handlers.py
│       │   ├── processors.py
│       │   ├── screen.py
│       │   ├── scrollable_pane.py
│       │   └── utils.py
│       ├── lexers/
│       │   ├── __init__.py
│       │   ├── base.py
│       │   └── pygments.py
│       ├── log.py
│       ├── mouse_events.py
│       ├── output/
│       │   ├── __init__.py
│       │   ├── base.py
│       │   ├── color_depth.py
│       │   ├── conemu.py
│       │   ├── defaults.py
│       │   ├── flush_stdout.py
│       │   ├── plain_text.py
│       │   ├── vt100.py
│       │   ├── win32.py
│       │   └── windows10.py
│       ├── patch_stdout.py
│       ├── py.typed
│       ├── renderer.py
│       ├── search.py
│       ├── selection.py
│       ├── shortcuts/
│       │   ├── __init__.py
│       │   ├── choice_input.py
│       │   ├── dialogs.py
│       │   ├── progress_bar/
│       │   │   ├── __init__.py
│       │   │   ├── base.py
│       │   │   └── formatters.py
│       │   ├── prompt.py
│       │   └── utils.py
│       ├── styles/
│       │   ├── __init__.py
│       │   ├── base.py
│       │   ├── defaults.py
│       │   ├── named_colors.py
│       │   ├── pygments.py
│       │   ├── style.py
│       │   └── style_transformation.py
│       ├── token.py
│       ├── utils.py
│       ├── validation.py
│       ├── widgets/
│       │   ├── __init__.py
│       │   ├── base.py
│       │   ├── dialogs.py
│       │   ├── menus.py
│       │   └── toolbars.py
│       └── win32_types.py
├── tests/
│   ├── test_async_generator.py
│   ├── test_buffer.py
│   ├── test_cli.py
│   ├── test_completion.py
│   ├── test_document.py
│   ├── test_filter.py
│   ├── test_formatted_text.py
│   ├── test_history.py
│   ├── test_inputstream.py
│   ├── test_key_binding.py
│   ├── test_layout.py
│   ├── test_memory_leaks.py
│   ├── test_print_formatted_text.py
│   ├── test_regular_languages.py
│   ├── test_shortcuts.py
│   ├── test_style.py
│   ├── test_style_transformation.py
│   ├── test_utils.py
│   ├── test_vt100_output.py
│   ├── test_widgets.py
│   └── test_yank_nth_arg.py
├── tools/
│   ├── debug_input_cross_platform.py
│   └── debug_vt100_input.py
└── tox.ini
Download .txt
SYMBOL INDEX (2418 symbols across 250 files)

FILE: examples/choices/color.py
  function main (line 8) | def main() -> None:

FILE: examples/choices/default.py
  function main (line 7) | def main() -> None:

FILE: examples/choices/frame-and-bottom-toolbar.py
  function main (line 9) | def main() -> None:

FILE: examples/choices/gray-frame-on-accept.py
  function main (line 8) | def main() -> None:

FILE: examples/choices/many-choices.py
  function main (line 6) | def main() -> None:

FILE: examples/choices/mouse-support.py
  function main (line 7) | def main() -> None:

FILE: examples/choices/simple-selection.py
  function main (line 6) | def main() -> None:

FILE: examples/choices/with-frame.py
  function main (line 9) | def main() -> None:

FILE: examples/dialogs/button_dialog.py
  function main (line 9) | def main():

FILE: examples/dialogs/input_dialog.py
  function main (line 9) | def main():

FILE: examples/dialogs/messagebox.py
  function main (line 9) | def main():

FILE: examples/dialogs/password_dialog.py
  function main (line 9) | def main():

FILE: examples/dialogs/progress_dialog.py
  function worker (line 12) | def worker(set_percentage, log_text):
  function main (line 38) | def main():

FILE: examples/dialogs/radio_dialog.py
  function main (line 10) | def main():

FILE: examples/dialogs/styled_messagebox.py
  function main (line 26) | def main():

FILE: examples/dialogs/yes_no_dialog.py
  function main (line 9) | def main():

FILE: examples/full-screen/ansi-art-and-textarea.py
  function main (line 10) | def main():

FILE: examples/full-screen/buttons.py
  function button1_clicked (line 16) | def button1_clicked():
  function button2_clicked (line 20) | def button2_clicked():
  function button3_clicked (line 24) | def button3_clicked():
  function exit_clicked (line 28) | def exit_clicked():
  function main (line 87) | def main():

FILE: examples/full-screen/calculator.py
  function main (line 21) | def main():

FILE: examples/full-screen/full-screen-demo.py
  function accept_yes (line 32) | def accept_yes():
  function accept_no (line 36) | def accept_no():
  function do_exit (line 40) | def do_exit():
  function run (line 219) | def run():

FILE: examples/full-screen/hello-world.py
  function _ (line 30) | def _(event):
  function main (line 39) | def main():

FILE: examples/full-screen/pager.py
  function get_statusbar_text (line 27) | def get_statusbar_text():
  function _ (line 78) | def _(event):
  function run (line 104) | def run():

FILE: examples/full-screen/scrollable-panes/simple-example.py
  function main (line 14) | def main():

FILE: examples/full-screen/scrollable-panes/with-completion-menu.py
  function main (line 23) | def main():

FILE: examples/full-screen/simple-demos/alignment.py
  function _ (line 47) | def _(event):
  function run (line 56) | def run():

FILE: examples/full-screen/simple-demos/autocompletion.py
  function _ (line 87) | def _(event):
  function run (line 96) | def run():

FILE: examples/full-screen/simple-demos/colorcolumn.py
  function _ (line 50) | def _(event):
  function run (line 59) | def run():

FILE: examples/full-screen/simple-demos/cursorcolumn-cursorline.py
  function _ (line 46) | def _(event):
  function run (line 55) | def run():

FILE: examples/full-screen/simple-demos/float-transparency.py
  function _ (line 74) | def _(event):
  function run (line 83) | def run():

FILE: examples/full-screen/simple-demos/floats.py
  function _ (line 103) | def _(event):
  function run (line 112) | def run():

FILE: examples/full-screen/simple-demos/focus.py
  function _ (line 55) | def _(event):
  function _ (line 61) | def _(event):
  function _ (line 66) | def _(event):
  function _ (line 71) | def _(event):
  function _ (line 76) | def _(event):
  function _ (line 81) | def _(event):
  function _ (line 86) | def _(event):
  function run (line 94) | def run():

FILE: examples/full-screen/simple-demos/horizontal-align.py
  function _ (line 195) | def _(event):
  function run (line 204) | def run():

FILE: examples/full-screen/simple-demos/horizontal-split.py
  function _ (line 31) | def _(event):
  function run (line 40) | def run():

FILE: examples/full-screen/simple-demos/line-prefixes.py
  function get_line_prefix (line 34) | def get_line_prefix(lineno, wrap_count):
  function _ (line 88) | def _(event):
  function _ (line 94) | def _(event):
  function run (line 106) | def run():

FILE: examples/full-screen/simple-demos/margins.py
  function _ (line 58) | def _(event):
  function run (line 67) | def run():

FILE: examples/full-screen/simple-demos/vertical-align.py
  function _ (line 154) | def _(event):
  function run (line 163) | def run():

FILE: examples/full-screen/simple-demos/vertical-split.py
  function _ (line 31) | def _(event):
  function run (line 40) | def run():

FILE: examples/full-screen/split-screen.py
  function get_titlebar_text (line 49) | def get_titlebar_text():
  function _ (line 103) | def _(event):
  function default_buffer_changed (line 120) | def default_buffer_changed(_):
  function run (line 151) | def run():

FILE: examples/full-screen/text-editor.py
  class ApplicationState (line 40) | class ApplicationState:
  function get_statusbar_text (line 52) | def get_statusbar_text():
  function get_statusbar_right_text (line 56) | def get_statusbar_right_text():
  class TextInputDialog (line 73) | class TextInputDialog:
    method __init__ (line 74) | def __init__(self, title="", label_text="", completer=None):
    method __pt_container__ (line 106) | def __pt_container__(self):
  class MessageDialog (line 110) | class MessageDialog:
    method __init__ (line 111) | def __init__(self, title, text):
    method __pt_container__ (line 127) | def __pt_container__(self):
  function _ (line 161) | def _(event):
  function do_open_file (line 171) | def do_open_file():
  function do_about (line 192) | def do_about():
  function show_message (line 196) | def show_message(title, text):
  function show_dialog_as_float (line 204) | async def show_dialog_as_float(dialog):
  function do_new_file (line 222) | def do_new_file():
  function do_exit (line 226) | def do_exit():
  function do_time_date (line 230) | def do_time_date():
  function do_go_to (line 235) | def do_go_to():
  function do_undo (line 255) | def do_undo():
  function do_cut (line 259) | def do_cut():
  function do_copy (line 264) | def do_copy():
  function do_delete (line 269) | def do_delete():
  function do_find (line 273) | def do_find():
  function do_find_next (line 277) | def do_find_next():
  function do_paste (line 286) | def do_paste():
  function do_select_all (line 290) | def do_select_all():
  function do_status_bar (line 296) | def do_status_bar():
  function run (line 376) | def run():

FILE: examples/gevent-get-input.py
  function dummy_inputhook (line 17) | def dummy_inputhook(*a):

FILE: examples/print-text/ansi-colors.py
  function main (line 12) | def main():

FILE: examples/print-text/ansi.py
  function title (line 15) | def title(text):
  function main (line 19) | def main():

FILE: examples/print-text/html.py
  function title (line 11) | def title(text):
  function main (line 15) | def main():

FILE: examples/print-text/named-colors.py
  function main (line 14) | def main():

FILE: examples/print-text/print-formatted-text.py
  function main (line 13) | def main():

FILE: examples/print-text/pygments-tokens.py
  function main (line 16) | def main():

FILE: examples/print-text/true-color-demo.py
  function main (line 13) | def main():

FILE: examples/progress-bar/a-lot-of-parallel-tasks.py
  function main (line 14) | def main():

FILE: examples/progress-bar/colored-title-and-label.py
  function main (line 13) | def main():

FILE: examples/progress-bar/custom-key-bindings.py
  function main (line 17) | def main():

FILE: examples/progress-bar/many-parallel-tasks.py
  function main (line 13) | def main():

FILE: examples/progress-bar/nested-progress-bars.py
  function main (line 12) | def main():

FILE: examples/progress-bar/scrolling-task-name.py
  function main (line 12) | def main():

FILE: examples/progress-bar/simple-progress-bar.py
  function main (line 12) | def main():

FILE: examples/progress-bar/styled-1.py
  function main (line 28) | def main():

FILE: examples/progress-bar/styled-2.py
  function main (line 29) | def main():

FILE: examples/progress-bar/styled-apt-get-install.py
  function main (line 22) | def main():

FILE: examples/progress-bar/styled-rainbow.py
  function main (line 14) | def main():

FILE: examples/progress-bar/styled-tqdm-1.py
  function main (line 17) | def main():

FILE: examples/progress-bar/styled-tqdm-2.py
  function main (line 17) | def main():

FILE: examples/progress-bar/two-tasks.py
  function main (line 12) | def main():

FILE: examples/progress-bar/unknown-length.py
  function data (line 12) | def data():
  function main (line 20) | def main():

FILE: examples/prompts/asyncio-prompt.py
  function print_counter (line 22) | async def print_counter():
  function interactive_shell (line 36) | async def interactive_shell():
  function main (line 52) | async def main():

FILE: examples/prompts/auto-completion/autocomplete-with-control-space.py
  function _ (line 53) | def _(event):
  function main (line 65) | def main():

FILE: examples/prompts/auto-completion/autocompletion-like-readline.py
  function main (line 49) | def main():

FILE: examples/prompts/auto-completion/autocompletion.py
  function main (line 53) | def main():

FILE: examples/prompts/auto-completion/colored-completions-with-formatted-text.py
  class AnimalCompleter (line 90) | class AnimalCompleter(Completer):
    method get_completions (line 91) | def get_completions(self, document, complete_event):
  function main (line 117) | def main():

FILE: examples/prompts/auto-completion/colored-completions.py
  class ColorCompleter (line 24) | class ColorCompleter(Completer):
    method get_completions (line 25) | def get_completions(self, document, complete_event):
  function main (line 37) | def main():

FILE: examples/prompts/auto-completion/combine-multiple-completers.py
  function main (line 67) | def main():

FILE: examples/prompts/auto-completion/fuzzy-custom-completer.py
  class ColorCompleter (line 23) | class ColorCompleter(Completer):
    method get_completions (line 24) | def get_completions(self, document, complete_event):
  function main (line 36) | def main():

FILE: examples/prompts/auto-completion/fuzzy-word-completer.py
  function main (line 52) | def main():

FILE: examples/prompts/auto-completion/multi-column-autocompletion-with-meta.py
  function main (line 41) | def main():

FILE: examples/prompts/auto-completion/multi-column-autocompletion.py
  function main (line 48) | def main():

FILE: examples/prompts/auto-completion/nested-autocompletion.py
  function main (line 17) | def main():

FILE: examples/prompts/auto-completion/slow-completions.py
  class SlowCompleter (line 57) | class SlowCompleter(Completer):
    method __init__ (line 62) | def __init__(self):
    method get_completions (line 65) | def get_completions(self, document, complete_event):
  function main (line 82) | def main():

FILE: examples/prompts/auto-suggestion.py
  function main (line 16) | def main():

FILE: examples/prompts/autocorrection.py
  function main (line 18) | def main():

FILE: examples/prompts/bottom-toolbar.py
  function main (line 21) | def main():

FILE: examples/prompts/clock-input.py
  function get_prompt (line 11) | def get_prompt():
  function main (line 20) | def main():

FILE: examples/prompts/colored-prompt.py
  function example_1 (line 28) | def example_1():
  function example_2 (line 47) | def example_2():
  function example_3 (line 64) | def example_3():

FILE: examples/prompts/custom-key-binding.py
  function main (line 13) | def main():

FILE: examples/prompts/custom-lexer.py
  class RainbowLexer (line 11) | class RainbowLexer(Lexer):
    method lex_document (line 12) | def lex_document(self, document):
  function main (line 24) | def main():

FILE: examples/prompts/custom-vi-operator-and-text-object.py
  function main (line 17) | def main():

FILE: examples/prompts/fancy-zsh-prompt.py
  function get_prompt (line 39) | def get_prompt() -> HTML:
  function main (line 73) | def main() -> None:

FILE: examples/prompts/finalterm-shell-integration.py
  function get_prompt_text (line 20) | def get_prompt_text():

FILE: examples/prompts/get-multiline-input.py
  function prompt_continuation (line 6) | def prompt_continuation(width, line_number, wrap_count):

FILE: examples/prompts/get-password-with-toggle-display-shortcut.py
  function main (line 12) | def main():

FILE: examples/prompts/history/persistent-history.py
  function main (line 12) | def main():

FILE: examples/prompts/history/slow-history.py
  class SlowHistory (line 15) | class SlowHistory(History):
    method load_history_strings (line 20) | def load_history_strings(self):
    method store_string (line 25) | def store_string(self, string):
  function main (line 29) | def main():

FILE: examples/prompts/html-input.py
  function main (line 13) | def main():

FILE: examples/prompts/input-validation.py
  function is_valid_email (line 10) | def is_valid_email(text):
  function main (line 21) | def main():

FILE: examples/prompts/inputhook.py
  function hello_world_window (line 24) | def hello_world_window():
  function inputhook (line 47) | def inputhook(context):
  function main (line 65) | def main():

FILE: examples/prompts/multiline-autosuggest.py
  class FakeLLMAutoSuggest (line 46) | class FakeLLMAutoSuggest(AutoSuggest):
    method get_suggestion (line 47) | def get_suggestion(self, buffer, document):
  class AppendMultilineAutoSuggestionInAnyLine (line 68) | class AppendMultilineAutoSuggestionInAnyLine(Processor):
    method __init__ (line 69) | def __init__(self, style: str = "class:auto-suggestion") -> None:
    method apply_transformation (line 72) | def apply_transformation(self, ti: TransformationInput) -> Transformat...
  function main (line 112) | def main():

FILE: examples/prompts/operate-and-get-next.py
  function main (line 12) | def main():

FILE: examples/prompts/patch-stdout.py
  function main (line 16) | def main():

FILE: examples/prompts/regular-language.py
  function create_grammar (line 30) | def create_grammar():

FILE: examples/prompts/rprompt.py
  function get_rprompt_text (line 23) | def get_rprompt_text():
  function main (line 31) | def main():

FILE: examples/prompts/swap-light-and-dark-colors.py
  function main (line 42) | def main():

FILE: examples/prompts/switch-between-vi-emacs.py
  function run (line 13) | def run():

FILE: examples/prompts/up-arrow-partial-string-matching.py
  function main (line 13) | def main():

FILE: examples/prompts/with-frames/frame-and-autocompletion.py
  function main (line 50) | def main():

FILE: examples/prompts/with-frames/gray-frame-on-accept.py
  function main (line 50) | def main():

FILE: examples/prompts/with-frames/with-frame.py
  function example (line 16) | def example():

FILE: examples/ssh/asyncssh-server.py
  function interact (line 58) | async def interact(ssh_session: PromptToolkitSSHSession) -> None:
  function main (line 104) | async def main(port=8222):

FILE: examples/telnet/chat-app.py
  function interact (line 43) | async def interact(connection):
  function _send_to_everyone (line 80) | def _send_to_everyone(sender_connection, name, message, color):
  function main (line 95) | async def main():

FILE: examples/telnet/dialog.py
  function interact (line 17) | async def interact(connection):
  function main (line 26) | async def main():

FILE: examples/telnet/hello-world.py
  function interact (line 21) | async def interact(connection):
  function main (line 34) | async def main():

FILE: examples/telnet/toolbar.py
  function interact (line 19) | async def interact(connection):
  function main (line 39) | async def main():

FILE: examples/tutorial/sqlite-cli.py
  function main (line 152) | def main(database):

FILE: src/prompt_toolkit/__init__.py
  function _load_version (line 29) | def _load_version() -> None:
  function __getattr__ (line 56) | def __getattr__(name: str) -> Any:
  function __dir__ (line 63) | def __dir__() -> list[str]:

FILE: src/prompt_toolkit/application/application.py
  class Application (line 100) | class Application(Generic[_AppResult]):
    method __init__ (line 181) | def __init__(
    method _create_merged_style (line 334) | def _create_merged_style(self, include_default_pygments_style: Filter)...
    method color_depth (line 358) | def color_depth(self) -> ColorDepth:
    method current_buffer (line 382) | def current_buffer(self) -> Buffer:
    method current_search_state (line 395) | def current_search_state(self) -> SearchState:
    method reset (line 406) | def reset(self) -> None:
    method invalidate (line 438) | def invalidate(self) -> None:
    method invalidated (line 492) | def invalidated(self) -> bool:
    method _redraw (line 496) | def _redraw(self, render_as_done: bool = False) -> None:
    method _start_auto_refresh_task (line 540) | def _start_auto_refresh_task(self) -> None:
    method _update_invalidate_events (line 554) | def _update_invalidate_events(self) -> None:
    method _invalidate_handler (line 575) | def _invalidate_handler(self, sender: object) -> None:
    method _on_resize (line 585) | def _on_resize(self) -> None:
    method _pre_run (line 597) | def _pre_run(self, pre_run: Callable[[], None] | None = None) -> None:
    method run_async (line 615) | async def run_async(
    method run (line 897) | def run(
    method _handle_exception (line 1001) | def _handle_exception(
    method _enable_breakpointhook (line 1028) | def _enable_breakpointhook(self) -> Generator[None, None, None]:
    method _breakpointhook (line 1044) | def _breakpointhook(self, *a: object, **kw: object) -> None:
    method create_background_task (line 1129) | def create_background_task(
    method _on_background_task_done (line 1155) | def _on_background_task_done(self, task: asyncio.Task[None]) -> None:
    method cancel_and_wait_for_background_tasks (line 1176) | async def cancel_and_wait_for_background_tasks(self) -> None:
    method _poll_output_size (line 1208) | async def _poll_output_size(self) -> None:
    method cpr_not_supported_callback (line 1230) | def cpr_not_supported_callback(self) -> None:
    method exit (line 1246) | def exit(self) -> None:
    method exit (line 1250) | def exit(self, *, result: _AppResult, style: str = "") -> None:
    method exit (line 1254) | def exit(
    method exit (line 1259) | def exit(
    method _request_absolute_cursor_position (line 1298) | def _request_absolute_cursor_position(self) -> None:
    method run_system_command (line 1308) | async def run_system_command(
    method suspend_to_background (line 1350) | def suspend_to_background(self, suspend_group: bool = True) -> None:
    method print_text (line 1376) | def print_text(
    method is_running (line 1396) | def is_running(self) -> bool:
    method is_done (line 1401) | def is_done(self) -> bool:
    method get_used_style_strings (line 1406) | def get_used_style_strings(self) -> list[str]:
  class _CombinedRegistry (line 1422) | class _CombinedRegistry(KeyBindingsBase):
    method __init__ (line 1429) | def __init__(self, app: Application[_AppResult]) -> None:
    method _version (line 1436) | def _version(self) -> Hashable:
    method bindings (line 1442) | def bindings(self) -> list[Binding]:
    method _create_key_bindings (line 1447) | def _create_key_bindings(
    method _key_bindings (line 1502) | def _key_bindings(self) -> KeyBindingsBase:
    method get_bindings_for_keys (line 1511) | def get_bindings_for_keys(self, keys: KeysTuple) -> list[Binding]:
    method get_bindings_starting_with_keys (line 1514) | def get_bindings_starting_with_keys(self, keys: KeysTuple) -> list[Bin...
  function _do_wait_for_enter (line 1518) | async def _do_wait_for_enter(wait_text: AnyFormattedText) -> None:
  function attach_winch_signal_handler (line 1548) | def attach_winch_signal_handler(
  function _restore_sigint_from_ctypes (line 1593) | def _restore_sigint_from_ctypes() -> Generator[None, None, None]:

FILE: src/prompt_toolkit/application/current.py
  class AppSession (line 25) | class AppSession:
    method __init__ (line 42) | def __init__(
    method __repr__ (line 52) | def __repr__(self) -> str:
    method input (line 56) | def input(self) -> Input:
    method output (line 64) | def output(self) -> Output:
  function get_app_session (line 77) | def get_app_session() -> AppSession:
  function get_app (line 81) | def get_app() -> Application[Any]:
  function get_app_or_none (line 109) | def get_app_or_none() -> Application[Any] | None:
  function set_app (line 119) | def set_app(app: Application[Any]) -> Generator[None, None, None]:
  function create_app_session (line 141) | def create_app_session(
  function create_app_session_from_tty (line 174) | def create_app_session_from_tty() -> Generator[AppSession, None, None]:

FILE: src/prompt_toolkit/application/dummy.py
  class DummyApplication (line 17) | class DummyApplication(Application[None]):
    method __init__ (line 23) | def __init__(self) -> None:
    method run (line 26) | def run(
    method run_async (line 36) | async def run_async(
    method run_system_command (line 45) | async def run_system_command(
    method suspend_to_background (line 54) | def suspend_to_background(self, suspend_group: bool = True) -> None:

FILE: src/prompt_toolkit/application/run_in_terminal.py
  function run_in_terminal (line 24) | def run_in_terminal(
  function in_terminal (line 60) | async def in_terminal(render_cli_done: bool = False) -> AsyncGenerator[N...

FILE: src/prompt_toolkit/auto_suggest.py
  class Suggestion (line 40) | class Suggestion:
    method __init__ (line 47) | def __init__(self, text: str) -> None:
    method __repr__ (line 50) | def __repr__(self) -> str:
  class AutoSuggest (line 54) | class AutoSuggest(metaclass=ABCMeta):
    method get_suggestion (line 60) | def get_suggestion(self, buffer: Buffer, document: Document) -> Sugges...
    method get_suggestion_async (line 76) | async def get_suggestion_async(
  class ThreadedAutoSuggest (line 87) | class ThreadedAutoSuggest(AutoSuggest):
    method __init__ (line 94) | def __init__(self, auto_suggest: AutoSuggest) -> None:
    method get_suggestion (line 97) | def get_suggestion(self, buff: Buffer, document: Document) -> Suggesti...
    method get_suggestion_async (line 100) | async def get_suggestion_async(
  class DummyAutoSuggest (line 113) | class DummyAutoSuggest(AutoSuggest):
    method get_suggestion (line 118) | def get_suggestion(self, buffer: Buffer, document: Document) -> Sugges...
  class AutoSuggestFromHistory (line 122) | class AutoSuggestFromHistory(AutoSuggest):
    method get_suggestion (line 127) | def get_suggestion(self, buffer: Buffer, document: Document) -> Sugges...
  class ConditionalAutoSuggest (line 144) | class ConditionalAutoSuggest(AutoSuggest):
    method __init__ (line 149) | def __init__(self, auto_suggest: AutoSuggest, filter: bool | Filter) -...
    method get_suggestion (line 153) | def get_suggestion(self, buffer: Buffer, document: Document) -> Sugges...
  class DynamicAutoSuggest (line 160) | class DynamicAutoSuggest(AutoSuggest):
    method __init__ (line 167) | def __init__(self, get_auto_suggest: Callable[[], AutoSuggest | None])...
    method get_suggestion (line 170) | def get_suggestion(self, buff: Buffer, document: Document) -> Suggesti...
    method get_suggestion_async (line 174) | async def get_suggestion_async(

FILE: src/prompt_toolkit/buffer.py
  class EditReadOnlyBuffer (line 55) | class EditReadOnlyBuffer(Exception):
  class ValidationState (line 59) | class ValidationState(Enum):
  class CompletionState (line 67) | class CompletionState:
    method __init__ (line 72) | def __init__(
    method __repr__ (line 89) | def __repr__(self) -> str:
    method go_to_index (line 92) | def go_to_index(self, index: int | None) -> None:
    method new_text_and_position (line 102) | def new_text_and_position(self) -> tuple[str, int]:
    method current_completion (line 123) | def current_completion(self) -> Completion | None:
  class YankNthArgState (line 136) | class YankNthArgState:
    method __init__ (line 141) | def __init__(
    method __repr__ (line 148) | def __repr__(self) -> str:
  class Buffer (line 156) | class Buffer:
    method __init__ (line 216) | def __init__(
    method __repr__ (line 297) | def __repr__(self) -> str:
    method reset (line 305) | def reset(
    method load_history_if_not_yet_loaded (line 370) | def load_history_if_not_yet_loaded(self) -> None:
    method _set_text (line 425) | def _set_text(self, value: str) -> bool:
    method _set_cursor_position (line 445) | def _set_cursor_position(self, value: int) -> bool:
    method text (line 453) | def text(self) -> str:
    method text (line 457) | def text(self, value: str) -> None:
    method cursor_position (line 483) | def cursor_position(self) -> int:
    method cursor_position (line 487) | def cursor_position(self, value: int) -> None:
    method working_index (line 505) | def working_index(self) -> int:
    method working_index (line 509) | def working_index(self, value: int) -> None:
    method _text_changed (line 518) | def _text_changed(self) -> None:
    method _cursor_position_changed (line 538) | def _cursor_position_changed(self) -> None:
    method document (line 557) | def document(self) -> Document:
    method document (line 567) | def document(self, value: Document) -> None:
    method set_document (line 576) | def set_document(self, value: Document, bypass_readonly: bool = False)...
    method is_returnable (line 612) | def is_returnable(self) -> bool:
    method save_to_undo_stack (line 620) | def save_to_undo_stack(self, clear_redo_stack: bool = True) -> None:
    method transform_lines (line 636) | def transform_lines(
    method transform_current_line (line 668) | def transform_current_line(self, transform_callback: Callable[[str], s...
    method transform_region (line 683) | def transform_region(
    method cursor_left (line 704) | def cursor_left(self, count: int = 1) -> None:
    method cursor_right (line 707) | def cursor_right(self, count: int = 1) -> None:
    method cursor_up (line 710) | def cursor_up(self, count: int = 1) -> None:
    method cursor_down (line 720) | def cursor_down(self, count: int = 1) -> None:
    method auto_up (line 730) | def auto_up(
    method auto_down (line 748) | def auto_down(
    method delete_before_cursor (line 766) | def delete_before_cursor(self, count: int = 1) -> str:
    method delete (line 788) | def delete(self, count: int = 1) -> str:
    method join_next_line (line 802) | def join_next_line(self, separator: str = " ") -> None:
    method join_selected_lines (line 818) | def join_selected_lines(self, separator: str = " ") -> None:
    method swap_characters_before_cursor (line 842) | def swap_characters_before_cursor(self) -> None:
    method go_to_history (line 854) | def go_to_history(self, index: int) -> None:
    method complete_next (line 862) | def complete_next(self, count: int = 1, disable_wrap_around: bool = Fa...
    method complete_previous (line 885) | def complete_previous(
    method cancel_completion (line 907) | def cancel_completion(self) -> None:
    method _set_completions (line 915) | def _set_completions(self, completions: list[Completion]) -> Completio...
    method start_history_lines_completion (line 930) | def start_history_lines_completion(self) -> None:
    method go_to_completion (line 966) | def go_to_completion(self, index: int | None) -> None:
    method apply_completion (line 983) | def apply_completion(self, completion: Completion) -> None:
    method _set_history_search (line 996) | def _set_history_search(self) -> None:
    method _history_matches (line 1007) | def _history_matches(self, i: int) -> bool:
    method history_forward (line 1016) | def history_forward(self, count: int = 1) -> None:
    method history_backward (line 1040) | def history_backward(self, count: int = 1) -> None:
    method yank_nth_arg (line 1061) | def yank_nth_arg(self, n: int | None = None, _yank_last_arg: bool = Fa...
    method yank_last_arg (line 1112) | def yank_last_arg(self, n: int | None = None) -> None:
    method start_selection (line 1119) | def start_selection(
    method copy_selection (line 1127) | def copy_selection(self, _cut: bool = False) -> ClipboardData:
    method cut_selection (line 1146) | def cut_selection(self) -> ClipboardData:
    method paste_clipboard_data (line 1152) | def paste_clipboard_data(
    method newline (line 1173) | def newline(self, copy_margin: bool = True) -> None:
    method insert_line_above (line 1182) | def insert_line_above(self, copy_margin: bool = True) -> None:
    method insert_line_below (line 1195) | def insert_line_below(self, copy_margin: bool = True) -> None:
    method insert_text (line 1207) | def insert_text(
    method undo (line 1259) | def undo(self) -> None:
    method redo (line 1275) | def redo(self) -> None:
    method validate (line 1284) | def validate(self, set_cursor: bool = False) -> bool:
    method _validate_async (line 1315) | async def _validate_async(self) -> None:
    method append_to_history (line 1357) | def append_to_history(self) -> None:
    method _search (line 1368) | def _search(
    method document_for_search (line 1456) | def document_for_search(self, search_state: SearchState) -> Document:
    method get_search_position (line 1481) | def get_search_position(
    method apply_search (line 1502) | def apply_search(
    method exit_selection (line 1521) | def exit_selection(self) -> None:
    method _editor_simple_tempfile (line 1524) | def _editor_simple_tempfile(self) -> tuple[str, Callable[[], None]]:
    method _editor_complex_tempfile (line 1540) | def _editor_complex_tempfile(self) -> tuple[str, Callable[[], None]]:
    method open_in_editor (line 1569) | def open_in_editor(self, validate_and_handle: bool = False) -> asyncio...
    method _open_file_in_editor (line 1616) | def _open_file_in_editor(self, filename: str) -> bool:
    method start_completion (line 1652) | def start_completion(
    method _create_completer_coroutine (line 1676) | def _create_completer_coroutine(self) -> Callable[..., Coroutine[Any, ...
    method _create_auto_suggest_coroutine (line 1838) | def _create_auto_suggest_coroutine(self) -> Callable[[], Coroutine[Any...
    method _create_auto_validate_coroutine (line 1865) | def _create_auto_validate_coroutine(
    method validate_and_handle (line 1879) | def validate_and_handle(self) -> None:
  function _only_one_at_a_time (line 1901) | def _only_one_at_a_time(coroutine: _T) -> _T:
  class _Retry (line 1935) | class _Retry(Exception):
  function indent (line 1939) | def indent(buffer: Buffer, from_row: int, to_row: int, count: int = 1) -...
  function unindent (line 1958) | def unindent(buffer: Buffer, from_row: int, to_row: int, count: int = 1)...
  function reshape_text (line 1985) | def reshape_text(buffer: Buffer, from_row: int, to_row: int) -> None:

FILE: src/prompt_toolkit/cache.py
  class SimpleCache (line 18) | class SimpleCache(Generic[_T, _U]):
    method __init__ (line 26) | def __init__(self, maxsize: int = 8) -> None:
    method get (line 33) | def get(self, key: _T, getter_func: Callable[[], _U]) -> _U:
    method clear (line 56) | def clear(self) -> None:
  class FastDictCache (line 66) | class FastDictCache(dict[_K, _V]):
    method __init__ (line 87) | def __init__(self, get_value: Callable[..., _V], size: int = 1000000) ...
    method __missing__ (line 94) | def __missing__(self, key: _K) -> _V:
  function memoized (line 110) | def memoized(maxsize: int = 1024) -> Callable[[_F], _F]:

FILE: src/prompt_toolkit/clipboard/base.py
  class ClipboardData (line 20) | class ClipboardData:
    method __init__ (line 28) | def __init__(
  class Clipboard (line 35) | class Clipboard(metaclass=ABCMeta):
    method set_data (line 43) | def set_data(self, data: ClipboardData) -> None:
    method set_text (line 50) | def set_text(self, text: str) -> None:  # Not abstract.
    method rotate (line 56) | def rotate(self) -> None:
    method get_data (line 62) | def get_data(self) -> ClipboardData:
  class DummyClipboard (line 68) | class DummyClipboard(Clipboard):
    method set_data (line 73) | def set_data(self, data: ClipboardData) -> None:
    method set_text (line 76) | def set_text(self, text: str) -> None:
    method rotate (line 79) | def rotate(self) -> None:
    method get_data (line 82) | def get_data(self) -> ClipboardData:
  class DynamicClipboard (line 86) | class DynamicClipboard(Clipboard):
    method __init__ (line 93) | def __init__(self, get_clipboard: Callable[[], Clipboard | None]) -> N...
    method _clipboard (line 96) | def _clipboard(self) -> Clipboard:
    method set_data (line 99) | def set_data(self, data: ClipboardData) -> None:
    method set_text (line 102) | def set_text(self, text: str) -> None:
    method rotate (line 105) | def rotate(self) -> None:
    method get_data (line 108) | def get_data(self) -> ClipboardData:

FILE: src/prompt_toolkit/clipboard/in_memory.py
  class InMemoryClipboard (line 12) | class InMemoryClipboard(Clipboard):
    method __init__ (line 20) | def __init__(self, data: ClipboardData | None = None, max_size: int = ...
    method set_data (line 29) | def set_data(self, data: ClipboardData) -> None:
    method get_data (line 35) | def get_data(self) -> ClipboardData:
    method rotate (line 41) | def rotate(self) -> None:

FILE: src/prompt_toolkit/clipboard/pyperclip.py
  class PyperclipClipboard (line 14) | class PyperclipClipboard(Clipboard):
    method __init__ (line 20) | def __init__(self) -> None:
    method set_data (line 23) | def set_data(self, data: ClipboardData) -> None:
    method get_data (line 27) | def get_data(self) -> ClipboardData:

FILE: src/prompt_toolkit/completion/base.py
  class Completion (line 26) | class Completion:
    method __init__ (line 42) | def __init__(
    method __repr__ (line 67) | def __repr__(self) -> str:
    method __eq__ (line 73) | def __eq__(self, other: object) -> bool:
    method __hash__ (line 83) | def __hash__(self) -> int:
    method display_text (line 87) | def display_text(self) -> str:
    method display_meta (line 94) | def display_meta(self) -> StyleAndTextTuples:
    method display_meta_text (line 101) | def display_meta_text(self) -> str:
    method new_completion_from_position (line 107) | def new_completion_from_position(self, position: int) -> Completion:
  class CompleteEvent (line 123) | class CompleteEvent:
    method __init__ (line 138) | def __init__(
    method __repr__ (line 149) | def __repr__(self) -> str:
  class Completer (line 153) | class Completer(metaclass=ABCMeta):
    method get_completions (line 159) | def get_completions(
    method get_completions_async (line 177) | async def get_completions_async(
  class ThreadedCompleter (line 190) | class ThreadedCompleter(Completer):
    method __init__ (line 201) | def __init__(self, completer: Completer) -> None:
    method get_completions (line 204) | def get_completions(
    method get_completions_async (line 209) | async def get_completions_async(
    method __repr__ (line 271) | def __repr__(self) -> str:
  class DummyCompleter (line 275) | class DummyCompleter(Completer):
    method get_completions (line 280) | def get_completions(
    method __repr__ (line 285) | def __repr__(self) -> str:
  class DynamicCompleter (line 289) | class DynamicCompleter(Completer):
    method __init__ (line 296) | def __init__(self, get_completer: Callable[[], Completer | None]) -> N...
    method get_completions (line 299) | def get_completions(
    method get_completions_async (line 305) | async def get_completions_async(
    method __repr__ (line 315) | def __repr__(self) -> str:
  class ConditionalCompleter (line 319) | class ConditionalCompleter(Completer):
    method __init__ (line 328) | def __init__(self, completer: Completer, filter: FilterOrBool) -> None:
    method __repr__ (line 332) | def __repr__(self) -> str:
    method get_completions (line 335) | def get_completions(
    method get_completions_async (line 342) | async def get_completions_async(
  class _MergedCompleter (line 354) | class _MergedCompleter(Completer):
    method __init__ (line 359) | def __init__(self, completers: Sequence[Completer]) -> None:
    method get_completions (line 362) | def get_completions(
    method get_completions_async (line 369) | async def get_completions_async(
  function merge_completers (line 381) | def merge_completers(
  function get_common_complete_suffix (line 399) | def get_common_complete_suffix(
  function _commonprefix (line 425) | def _commonprefix(strings: Iterable[str]) -> str:

FILE: src/prompt_toolkit/completion/deduplicate.py
  class DeduplicateCompleter (line 12) | class DeduplicateCompleter(Completer):
    method __init__ (line 21) | def __init__(self, completer: Completer) -> None:
    method get_completions (line 24) | def get_completions(

FILE: src/prompt_toolkit/completion/filesystem.py
  class PathCompleter (line 15) | class PathCompleter(Completer):
    method __init__ (line 27) | def __init__(
    method get_completions (line 41) | def get_completions(
  class ExecutableCompleter (line 106) | class ExecutableCompleter(PathCompleter):
    method __init__ (line 111) | def __init__(self) -> None:

FILE: src/prompt_toolkit/completion/fuzzy_completer.py
  class FuzzyCompleter (line 20) | class FuzzyCompleter(Completer):
    method __init__ (line 49) | def __init__(
    method get_completions (line 64) | def get_completions(
    method _get_pattern (line 72) | def _get_pattern(self) -> str:
    method _get_fuzzy_completions (line 79) | def _get_fuzzy_completions(
    method _get_display (line 135) | def _get_display(
  class FuzzyWordCompleter (line 178) | class FuzzyWordCompleter(Completer):
    method __init__ (line 189) | def __init__(
    method get_completions (line 205) | def get_completions(
  class _FuzzyMatch (line 211) | class _FuzzyMatch(NamedTuple):

FILE: src/prompt_toolkit/completion/nested.py
  class NestedCompleter (line 20) | class NestedCompleter(Completer):
    method __init__ (line 32) | def __init__(
    method __repr__ (line 38) | def __repr__(self) -> str:
    method from_nested_dict (line 42) | def from_nested_dict(cls, data: NestedDict) -> NestedCompleter:
    method get_completions (line 80) | def get_completions(

FILE: src/prompt_toolkit/completion/word_completer.py
  class WordCompleter (line 15) | class WordCompleter(Completer):
    method __init__ (line 35) | def __init__(
    method get_completions (line 57) | def get_completions(

FILE: src/prompt_toolkit/contrib/completers/system.py
  class SystemCompleter (line 12) | class SystemCompleter(GrammarCompleter):
    method __init__ (line 17) | def __init__(self) -> None:

FILE: src/prompt_toolkit/contrib/regular_languages/compiler.py
  class _CompiledGrammar (line 73) | class _CompiledGrammar:
    method __init__ (line 83) | def __init__(
    method escape (line 128) | def escape(self, varname: str, value: str) -> str:
    method unescape (line 135) | def unescape(self, varname: str, value: str) -> str:
    method _transform (line 143) | def _transform(
    method _transform_prefix (line 199) | def _transform_prefix(
    method match (line 358) | def match(self, string: str) -> Match | None:
    method match_prefix (line 373) | def match_prefix(self, string: str) -> Match | None:
  class Match (line 396) | class Match:
    method __init__ (line 403) | def __init__(
    method _nodes_to_regs (line 415) | def _nodes_to_regs(self) -> list[tuple[str, tuple[int, int]]]:
    method _nodes_to_values (line 431) | def _nodes_to_values(self) -> list[tuple[str, str, tuple[int, int]]]:
    method _unescape (line 448) | def _unescape(self, varname: str, value: str) -> str:
    method variables (line 452) | def variables(self) -> Variables:
    method trailing_input (line 460) | def trailing_input(self) -> MatchVariable | None:
    method end_nodes (line 482) | def end_nodes(self) -> Iterable[MatchVariable]:
  class Variables (line 497) | class Variables:
    method __init__ (line 498) | def __init__(self, tuples: list[tuple[str, str, tuple[int, int]]]) -> ...
    method __repr__ (line 502) | def __repr__(self) -> str:
    method get (line 509) | def get(self, key: str) -> str | None: ...
    method get (line 512) | def get(self, key: str, default: str | _T) -> str | _T: ...
    method get (line 514) | def get(self, key: str, default: str | _T | None = None) -> str | _T |...
    method getall (line 518) | def getall(self, key: str) -> list[str]:
    method __getitem__ (line 521) | def __getitem__(self, key: str) -> str | None:
    method __iter__ (line 524) | def __iter__(self) -> Iterator[MatchVariable]:
  class MatchVariable (line 532) | class MatchVariable:
    method __init__ (line 542) | def __init__(self, varname: str, value: str, slice: tuple[int, int]) -...
    method __repr__ (line 550) | def __repr__(self) -> str:
  function compile (line 554) | def compile(
  function _compile_from_parse_tree (line 570) | def _compile_from_parse_tree(

FILE: src/prompt_toolkit/contrib/regular_languages/completion.py
  class GrammarCompleter (line 19) | class GrammarCompleter(Completer):
    method __init__ (line 29) | def __init__(
    method get_completions (line 35) | def get_completions(
    method _get_completions_for_match (line 45) | def _get_completions_for_match(
    method _remove_duplicates (line 83) | def _remove_duplicates(self, items: Iterable[Completion]) -> Iterable[...

FILE: src/prompt_toolkit/contrib/regular_languages/lexer.py
  class GrammarLexer (line 22) | class GrammarLexer(Lexer):
    method __init__ (line 37) | def __init__(
    method _get_text_fragments (line 47) | def _get_text_fragments(self, text: str) -> StyleAndTextTuples:
    method lex_document (line 85) | def lex_document(self, document: Document) -> Callable[[int], StyleAnd...

FILE: src/prompt_toolkit/contrib/regular_languages/regex_parser.py
  class Node (line 32) | class Node:
    method __add__ (line 38) | def __add__(self, other_node: Node) -> NodeSequence:
    method __or__ (line 41) | def __or__(self, other_node: Node) -> AnyNode:
  class AnyNode (line 45) | class AnyNode(Node):
    method __init__ (line 52) | def __init__(self, children: list[Node]) -> None:
    method __or__ (line 55) | def __or__(self, other_node: Node) -> AnyNode:
    method __repr__ (line 58) | def __repr__(self) -> str:
  class NodeSequence (line 62) | class NodeSequence(Node):
    method __init__ (line 68) | def __init__(self, children: list[Node]) -> None:
    method __add__ (line 71) | def __add__(self, other_node: Node) -> NodeSequence:
    method __repr__ (line 74) | def __repr__(self) -> str:
  class Regex (line 78) | class Regex(Node):
    method __init__ (line 83) | def __init__(self, regex: str) -> None:
    method __repr__ (line 88) | def __repr__(self) -> str:
  class Lookahead (line 92) | class Lookahead(Node):
    method __init__ (line 97) | def __init__(self, childnode: Node, negative: bool = False) -> None:
    method __repr__ (line 101) | def __repr__(self) -> str:
  class Variable (line 105) | class Variable(Node):
    method __init__ (line 114) | def __init__(self, childnode: Node, varname: str = "") -> None:
    method __repr__ (line 118) | def __repr__(self) -> str:
  class Repeat (line 122) | class Repeat(Node):
    method __init__ (line 123) | def __init__(
    method __repr__ (line 135) | def __repr__(self) -> str:
  function tokenize_regex (line 139) | def tokenize_regex(input: str) -> list[str]:
  function parse_regex (line 192) | def parse_regex(regex_tokens: list[str]) -> Node:

FILE: src/prompt_toolkit/contrib/regular_languages/validation.py
  class GrammarValidator (line 17) | class GrammarValidator(Validator):
    method __init__ (line 27) | def __init__(
    method validate (line 33) | def validate(self, document: Document) -> None:

FILE: src/prompt_toolkit/contrib/ssh/server.py
  class PromptToolkitSSHSession (line 23) | class PromptToolkitSSHSession(asyncssh.SSHServerSession):  # type: ignore
    method __init__ (line 24) | def __init__(
    method _get_size (line 65) | def _get_size(self) -> Size:
    method connection_made (line 75) | def connection_made(self, chan: Any) -> None:
    method shell_requested (line 78) | def shell_requested(self) -> bool:
    method session_started (line 81) | def session_started(self) -> None:
    method _interact (line 84) | async def _interact(self) -> None:
    method terminal_size_changed (line 112) | def terminal_size_changed(
    method data_received (line 119) | def data_received(self, data: str, datatype: object) -> None:
  class PromptToolkitSSHServer (line 127) | class PromptToolkitSSHServer(asyncssh.SSHServer):
    method __init__ (line 165) | def __init__(
    method begin_auth (line 174) | def begin_auth(self, username: str) -> bool:
    method session_requested (line 178) | def session_requested(self) -> PromptToolkitSSHSession:

FILE: src/prompt_toolkit/contrib/telnet/protocol.py
  function int2byte (line 20) | def int2byte(number: int) -> bytes:
  class TelnetProtocolParser (line 56) | class TelnetProtocolParser:
    method __init__ (line 71) | def __init__(
    method received_data (line 84) | def received_data(self, data: bytes) -> None:
    method do_received (line 87) | def do_received(self, data: bytes) -> None:
    method dont_received (line 91) | def dont_received(self, data: bytes) -> None:
    method will_received (line 95) | def will_received(self, data: bytes) -> None:
    method wont_received (line 99) | def wont_received(self, data: bytes) -> None:
    method command_received (line 103) | def command_received(self, command: bytes, data: bytes) -> None:
    method naws (line 119) | def naws(self, data: bytes) -> None:
    method ttype (line 132) | def ttype(self, data: bytes) -> None:
    method negotiate (line 143) | def negotiate(self, data: bytes) -> None:
    method _parse_coroutine (line 156) | def _parse_coroutine(self) -> Generator[None, bytes, None]:
    method feed (line 204) | def feed(self, data: bytes) -> None:

FILE: src/prompt_toolkit/contrib/telnet/server.py
  function int2byte (line 45) | def int2byte(number: int) -> bytes:
  function _initialize_telnet (line 49) | def _initialize_telnet(connection: socket.socket) -> None:
  class _ConnectionStdout (line 78) | class _ConnectionStdout:
    method __init__ (line 84) | def __init__(self, connection: socket.socket, encoding: str) -> None:
    method write (line 91) | def write(self, data: str) -> None:
    method isatty (line 96) | def isatty(self) -> bool:
    method flush (line 99) | def flush(self) -> None:
    method close (line 108) | def close(self) -> None:
    method encoding (line 112) | def encoding(self) -> str:
    method errors (line 116) | def errors(self) -> str:
  class TelnetConnection (line 120) | class TelnetConnection:
    method __init__ (line 125) | def __init__(
    method run_application (line 180) | async def run_application(self) -> None:
    method feed (line 207) | def feed(self, data: bytes) -> None:
    method close (line 213) | def close(self) -> None:
    method send (line 225) | def send(self, formatted_text: AnyFormattedText) -> None:
    method send_above_prompt (line 236) | def send_above_prompt(self, formatted_text: AnyFormattedText) -> None:
    method _run_in_terminal (line 244) | def _run_in_terminal(self, func: Callable[[], None]) -> None:
    method erase_screen (line 252) | def erase_screen(self) -> None:
  function _dummy_interact (line 263) | async def _dummy_interact(connection: TelnetConnection) -> None:
  class TelnetServer (line 267) | class TelnetServer:
    method __init__ (line 284) | def __init__(
    method _create_socket (line 308) | def _create_socket(cls, host: str, port: int) -> socket.socket:
    method run (line 317) | async def run(self, ready_cb: Callable[[], None] | None = None) -> None:
    method start (line 356) | def start(self) -> None:
    method stop (line 368) | async def stop(self) -> None:
    method _accept (line 382) | def _accept(self, listen_socket: socket.socket) -> None:

FILE: src/prompt_toolkit/cursor_shapes.py
  class CursorShape (line 24) | class CursorShape(Enum):
  class CursorShapeConfig (line 43) | class CursorShapeConfig(ABC):
    method get_cursor_shape (line 45) | def get_cursor_shape(self, application: Application[Any]) -> CursorShape:
  class SimpleCursorShapeConfig (line 54) | class SimpleCursorShapeConfig(CursorShapeConfig):
    method __init__ (line 59) | def __init__(self, cursor_shape: CursorShape = CursorShape._NEVER_CHAN...
    method get_cursor_shape (line 62) | def get_cursor_shape(self, application: Application[Any]) -> CursorShape:
  class ModalCursorShapeConfig (line 66) | class ModalCursorShapeConfig(CursorShapeConfig):
    method get_cursor_shape (line 71) | def get_cursor_shape(self, application: Application[Any]) -> CursorShape:
  class DynamicCursorShapeConfig (line 95) | class DynamicCursorShapeConfig(CursorShapeConfig):
    method __init__ (line 96) | def __init__(
    method get_cursor_shape (line 101) | def get_cursor_shape(self, application: Application[Any]) -> CursorShape:
  function to_cursor_shape_config (line 107) | def to_cursor_shape_config(value: AnyCursorShapeConfig) -> CursorShapeCo...

FILE: src/prompt_toolkit/data_structures.py
  class Point (line 11) | class Point(NamedTuple):
  class Size (line 16) | class Size(NamedTuple):

FILE: src/prompt_toolkit/document.py
  class _ImmutableLineList (line 50) | class _ImmutableLineList(list[str]):
    method _error (line 56) | def _error(self, *a: object, **kw: object) -> NoReturn:
  class _DocumentCache (line 70) | class _DocumentCache:
    method __init__ (line 71) | def __init__(self) -> None:
  class Document (line 79) | class Document:
    method __init__ (line 94) | def __init__(
    method __repr__ (line 133) | def __repr__(self) -> str:
    method __eq__ (line 136) | def __eq__(self, other: object) -> bool:
    method text (line 147) | def text(self) -> str:
    method cursor_position (line 152) | def cursor_position(self) -> int:
    method selection (line 157) | def selection(self) -> SelectionState | None:
    method current_char (line 162) | def current_char(self) -> str:
    method char_before_cursor (line 167) | def char_before_cursor(self) -> str:
    method text_before_cursor (line 172) | def text_before_cursor(self) -> str:
    method text_after_cursor (line 176) | def text_after_cursor(self) -> str:
    method current_line_before_cursor (line 180) | def current_line_before_cursor(self) -> str:
    method current_line_after_cursor (line 186) | def current_line_after_cursor(self) -> str:
    method lines (line 192) | def lines(self) -> list[str]:
    method _line_start_indexes (line 203) | def _line_start_indexes(self) -> list[int]:
    method lines_from_current (line 231) | def lines_from_current(self) -> list[str]:
    method line_count (line 238) | def line_count(self) -> int:
    method current_line (line 244) | def current_line(self) -> str:
    method leading_whitespace_in_current_line (line 250) | def leading_whitespace_in_current_line(self) -> str:
    method _get_char_relative_to_cursor (line 256) | def _get_char_relative_to_cursor(self, offset: int = 0) -> str:
    method on_first_line (line 266) | def on_first_line(self) -> bool:
    method on_last_line (line 273) | def on_last_line(self) -> bool:
    method cursor_position_row (line 280) | def cursor_position_row(self) -> int:
    method cursor_position_col (line 288) | def cursor_position_col(self) -> int:
    method _find_line_start_index (line 298) | def _find_line_start_index(self, index: int) -> tuple[int, int]:
    method translate_index_to_position (line 310) | def translate_index_to_position(self, index: int) -> tuple[int, int]:
    method translate_row_col_to_index (line 321) | def translate_row_col_to_index(self, row: int, col: int) -> int:
    method is_cursor_at_the_end (line 347) | def is_cursor_at_the_end(self) -> bool:
    method is_cursor_at_the_end_of_line (line 352) | def is_cursor_at_the_end_of_line(self) -> bool:
    method has_match_at_current_position (line 356) | def has_match_at_current_position(self, sub: str) -> bool:
    method find (line 362) | def find(
    method find_all (line 403) | def find_all(self, sub: str, ignore_case: bool = False) -> list[int]:
    method find_backwards (line 411) | def find_backwards(
    method get_word_before_cursor (line 440) | def get_word_before_cursor(
    method _is_word_before_cursor_complete (line 459) | def _is_word_before_cursor_complete(
    method find_start_of_previous_word (line 468) | def find_start_of_previous_word(
    method find_boundaries_of_current_word (line 501) | def find_boundaries_of_current_word(
    method get_word_under_cursor (line 544) | def get_word_under_cursor(self, WORD: bool = False) -> str:
    method find_next_word_beginning (line 552) | def find_next_word_beginning(
    method find_next_word_ending (line 577) | def find_next_word_ending(
    method find_previous_word_beginning (line 609) | def find_previous_word_beginning(
    method find_previous_word_ending (line 630) | def find_previous_word_ending(
    method find_next_matching_line (line 657) | def find_next_matching_line(
    method find_previous_matching_line (line 676) | def find_previous_matching_line(
    method get_cursor_left_position (line 695) | def get_cursor_left_position(self, count: int = 1) -> int:
    method get_cursor_right_position (line 704) | def get_cursor_right_position(self, count: int = 1) -> int:
    method get_cursor_up_position (line 713) | def get_cursor_up_position(
    method get_cursor_down_position (line 735) | def get_cursor_down_position(
    method find_enclosing_bracket_right (line 755) | def find_enclosing_bracket_right(
    method find_enclosing_bracket_left (line 788) | def find_enclosing_bracket_left(
    method find_matching_bracket_position (line 821) | def find_matching_bracket_position(
    method get_start_of_document_position (line 841) | def get_start_of_document_position(self) -> int:
    method get_end_of_document_position (line 845) | def get_end_of_document_position(self) -> int:
    method get_start_of_line_position (line 849) | def get_start_of_line_position(self, after_whitespace: bool = False) -...
    method get_end_of_line_position (line 861) | def get_end_of_line_position(self) -> int:
    method last_non_blank_of_current_line_position (line 865) | def last_non_blank_of_current_line_position(self) -> int:
    method get_column_cursor_position (line 871) | def get_column_cursor_position(self, column: int) -> int:
    method selection_range (line 883) | def selection_range(
    method selection_ranges (line 904) | def selection_ranges(self) -> Iterable[tuple[int, int]]:
    method selection_range_at_line (line 954) | def selection_range_at_line(self, row: int) -> tuple[int, int] | None:
    method cut_selection (line 1004) | def cut_selection(self) -> tuple[Document, ClipboardData]:
    method paste_clipboard_data (line 1040) | def paste_clipboard_data(
    method empty_line_count_at_the_end (line 1105) | def empty_line_count_at_the_end(self) -> int:
    method start_of_paragraph (line 1118) | def start_of_paragraph(self, count: int = 1, before: bool = False) -> ...
    method end_of_paragraph (line 1136) | def end_of_paragraph(self, count: int = 1, after: bool = False) -> int:
    method insert_after (line 1154) | def insert_after(self, text: str) -> Document:
    method insert_before (line 1165) | def insert_before(self, text: str) -> Document:

FILE: src/prompt_toolkit/enums.py
  class EditingMode (line 6) | class EditingMode(Enum):

FILE: src/prompt_toolkit/eventloop/async_generator.py
  function aclosing (line 24) | async def aclosing(
  class _Done (line 50) | class _Done:
  function generator_to_async_generator (line 54) | async def generator_to_async_generator(

FILE: src/prompt_toolkit/eventloop/inputhook.py
  class InputHookContext (line 55) | class InputHookContext:
    method __init__ (line 60) | def __init__(self, fileno: int, input_is_ready: Callable[[], bool]) ->...
    method fileno (line 64) | def fileno(self) -> int:
  function new_eventloop_with_inputhook (line 71) | def new_eventloop_with_inputhook(
  function set_eventloop_with_inputhook (line 82) | def set_eventloop_with_inputhook(
  class InputHookSelector (line 95) | class InputHookSelector(BaseSelector):
    method __init__ (line 104) | def __init__(
    method register (line 111) | def register(
    method unregister (line 116) | def unregister(self, fileobj: FileDescriptorLike) -> SelectorKey:
    method modify (line 119) | def modify(
    method select (line 124) | def select(
    method close (line 181) | def close(self) -> None:
    method get_map (line 192) | def get_map(self) -> Mapping[FileDescriptorLike, SelectorKey]:

FILE: src/prompt_toolkit/eventloop/utils.py
  function run_in_executor_with_context (line 21) | def run_in_executor_with_context(
  function call_soon_threadsafe (line 38) | def call_soon_threadsafe(
  function get_traceback_from_context (line 88) | def get_traceback_from_context(context: dict[str, Any]) -> TracebackType...

FILE: src/prompt_toolkit/eventloop/win32.py
  function wait_for_handles (line 27) | def wait_for_handles(handles: list[HANDLE], timeout: int = INFINITE) -> ...
  function create_win32_event (line 60) | def create_win32_event() -> HANDLE:

FILE: src/prompt_toolkit/filters/app.py
  function has_focus (line 58) | def has_focus(value: FocusableElement) -> Condition:
  function buffer_has_focus (line 110) | def buffer_has_focus() -> bool:
  function has_selection (line 118) | def has_selection() -> bool:
  function has_suggestion (line 126) | def has_suggestion() -> bool:
  function has_completions (line 135) | def has_completions() -> bool:
  function completion_is_selected (line 144) | def completion_is_selected() -> bool:
  function is_read_only (line 153) | def is_read_only() -> bool:
  function is_multiline (line 161) | def is_multiline() -> bool:
  function has_validation_error (line 169) | def has_validation_error() -> bool:
  function has_arg (line 175) | def has_arg() -> bool:
  function is_done (line 181) | def is_done() -> bool:
  function renderer_height_is_known (line 189) | def renderer_height_is_known() -> bool:
  function in_editing_mode (line 203) | def in_editing_mode(editing_mode: EditingMode) -> Condition:
  function in_paste_mode (line 216) | def in_paste_mode() -> bool:
  function vi_mode (line 221) | def vi_mode() -> bool:
  function vi_navigation_mode (line 226) | def vi_navigation_mode() -> bool:
  function vi_insert_mode (line 250) | def vi_insert_mode() -> bool:
  function vi_insert_multiple_mode (line 269) | def vi_insert_multiple_mode() -> bool:
  function vi_replace_mode (line 288) | def vi_replace_mode() -> bool:
  function vi_replace_single_mode (line 307) | def vi_replace_single_mode() -> bool:
  function vi_selection_mode (line 326) | def vi_selection_mode() -> bool:
  function vi_waiting_for_text_object_mode (line 335) | def vi_waiting_for_text_object_mode() -> bool:
  function vi_digraph_mode (line 344) | def vi_digraph_mode() -> bool:
  function vi_recording_macro (line 353) | def vi_recording_macro() -> bool:
  function emacs_mode (line 363) | def emacs_mode() -> bool:
  function emacs_insert_mode (line 369) | def emacs_insert_mode() -> bool:
  function emacs_selection_mode (line 381) | def emacs_selection_mode() -> bool:
  function shift_selection_mode (line 389) | def shift_selection_mode() -> bool:
  function is_searching (line 398) | def is_searching() -> bool:
  function control_is_searchable (line 405) | def control_is_searchable() -> bool:
  function vi_search_direction_reversed (line 417) | def vi_search_direction_reversed() -> bool:

FILE: src/prompt_toolkit/filters/base.py
  class Filter (line 9) | class Filter(metaclass=ABCMeta):
    method __init__ (line 17) | def __init__(self) -> None:
    method __call__ (line 23) | def __call__(self) -> bool:
    method __and__ (line 29) | def __and__(self, other: Filter) -> Filter:
    method __or__ (line 47) | def __or__(self, other: Filter) -> Filter:
    method __invert__ (line 65) | def __invert__(self) -> Filter:
    method __bool__ (line 74) | def __bool__(self) -> None:
  function _remove_duplicates (line 88) | def _remove_duplicates(filters: list[Filter]) -> list[Filter]:
  class _AndList (line 96) | class _AndList(Filter):
    method __init__ (line 101) | def __init__(self, filters: list[Filter]) -> None:
    method create (line 106) | def create(cls, filters: Iterable[Filter]) -> Filter:
    method __call__ (line 132) | def __call__(self) -> bool:
    method __repr__ (line 135) | def __repr__(self) -> str:
  class _OrList (line 139) | class _OrList(Filter):
    method __init__ (line 144) | def __init__(self, filters: list[Filter]) -> None:
    method create (line 149) | def create(cls, filters: Iterable[Filter]) -> Filter:
    method __call__ (line 175) | def __call__(self) -> bool:
    method __repr__ (line 178) | def __repr__(self) -> str:
  class _Invert (line 182) | class _Invert(Filter):
    method __init__ (line 187) | def __init__(self, filter: Filter) -> None:
    method __call__ (line 191) | def __call__(self) -> bool:
    method __repr__ (line 194) | def __repr__(self) -> str:
  class Always (line 198) | class Always(Filter):
    method __call__ (line 203) | def __call__(self) -> bool:
    method __or__ (line 206) | def __or__(self, other: Filter) -> Filter:
    method __and__ (line 209) | def __and__(self, other: Filter) -> Filter:
    method __invert__ (line 212) | def __invert__(self) -> Never:
  class Never (line 216) | class Never(Filter):
    method __call__ (line 221) | def __call__(self) -> bool:
    method __and__ (line 224) | def __and__(self, other: Filter) -> Filter:
    method __or__ (line 227) | def __or__(self, other: Filter) -> Filter:
    method __invert__ (line 230) | def __invert__(self) -> Always:
  class Condition (line 234) | class Condition(Filter):
    method __init__ (line 248) | def __init__(self, func: Callable[[], bool]) -> None:
    method __call__ (line 252) | def __call__(self) -> bool:
    method __repr__ (line 255) | def __repr__(self) -> str:

FILE: src/prompt_toolkit/filters/utils.py
  function to_filter (line 21) | def to_filter(bool_or_filter: FilterOrBool) -> Filter:
  function is_true (line 35) | def is_true(value: FilterOrBool) -> bool:

FILE: src/prompt_toolkit/formatted_text/ansi.py
  class ANSI (line 17) | class ANSI:
    method __init__ (line 32) | def __init__(self, value: str) -> None:
    method _parse_corot (line 54) | def _parse_corot(self) -> Generator[None, str, None]:
    method _select_graphic_rendition (line 139) | def _select_graphic_rendition(self, attrs: list[int]) -> None:
    method _create_style_string (line 227) | def _create_style_string(self) -> str:
    method __repr__ (line 255) | def __repr__(self) -> str:
    method __pt_formatted_text__ (line 258) | def __pt_formatted_text__(self) -> StyleAndTextTuples:
    method format (line 261) | def format(self, *args: str, **kwargs: str) -> ANSI:
    method __mod__ (line 268) | def __mod__(self, value: object) -> ANSI:
  function ansi_escape (line 290) | def ansi_escape(text: object) -> str:
  class ANSIFormatter (line 297) | class ANSIFormatter(Formatter):
    method format_field (line 298) | def format_field(self, value: object, format_spec: str) -> str:

FILE: src/prompt_toolkit/formatted_text/base.py
  class MagicFormattedText (line 37) | class MagicFormattedText(Protocol):
    method __pt_formatted_text__ (line 43) | def __pt_formatted_text__(self) -> StyleAndTextTuples: ...
  function to_formatted_text (line 55) | def to_formatted_text(
  function is_formatted_text (line 107) | def is_formatted_text(value: object) -> TypeGuard[AnyFormattedText]:
  class FormattedText (line 122) | class FormattedText(StyleAndTextTuples):
    method __pt_formatted_text__ (line 130) | def __pt_formatted_text__(self) -> StyleAndTextTuples:
    method __repr__ (line 133) | def __repr__(self) -> str:
  class Template (line 137) | class Template:
    method __init__ (line 148) | def __init__(self, text: str) -> None:
    method format (line 152) | def format(self, *values: AnyFormattedText) -> AnyFormattedText:
  function merge_formatted_text (line 168) | def merge_formatted_text(items: Iterable[AnyFormattedText]) -> AnyFormat...

FILE: src/prompt_toolkit/formatted_text/html.py
  class HTML (line 12) | class HTML:
    method __init__ (line 33) | def __init__(self, value: str) -> None:
    method __repr__ (line 102) | def __repr__(self) -> str:
    method __pt_formatted_text__ (line 105) | def __pt_formatted_text__(self) -> StyleAndTextTuples:
    method format (line 108) | def format(self, *args: object, **kwargs: object) -> HTML:
    method __mod__ (line 115) | def __mod__(self, value: object) -> HTML:
  class HTMLFormatter (line 126) | class HTMLFormatter(Formatter):
    method format_field (line 127) | def format_field(self, value: object, format_spec: str) -> str:
  function html_escape (line 131) | def html_escape(text: object) -> str:

FILE: src/prompt_toolkit/formatted_text/pygments.py
  class PygmentsTokens (line 17) | class PygmentsTokens:
    method __init__ (line 23) | def __init__(self, token_list: list[tuple[Token, str]]) -> None:
    method __pt_formatted_text__ (line 26) | def __pt_formatted_text__(self) -> StyleAndTextTuples:

FILE: src/prompt_toolkit/formatted_text/utils.py
  function to_plain_text (line 31) | def to_plain_text(value: AnyFormattedText) -> str:
  function fragment_list_len (line 38) | def fragment_list_len(fragments: StyleAndTextTuples) -> int:
  function fragment_list_width (line 49) | def fragment_list_width(fragments: StyleAndTextTuples) -> int:
  function fragment_list_to_text (line 66) | def fragment_list_to_text(fragments: StyleAndTextTuples) -> str:
  function split_lines (line 77) | def split_lines(

FILE: src/prompt_toolkit/history.py
  class History (line 30) | class History(metaclass=ABCMeta):
    method __init__ (line 37) | def __init__(self) -> None:
    method load (line 49) | async def load(self) -> AsyncGenerator[str, None]:
    method get_strings (line 67) | def get_strings(self) -> list[str]:
    method append_string (line 74) | def append_string(self, string: str) -> None:
    method load_history_strings (line 84) | def load_history_strings(self) -> Iterable[str]:
    method store_string (line 96) | def store_string(self, string: str) -> None:
  class ThreadedHistory (line 102) | class ThreadedHistory(History):
    method __init__ (line 112) | def __init__(self, history: History) -> None:
    method load (line 127) | async def load(self) -> AsyncGenerator[str, None]:
    method _in_load_thread (line 184) | def _in_load_thread(self) -> None:
    method append_string (line 203) | def append_string(self, string: str) -> None:
    method load_history_strings (line 210) | def load_history_strings(self) -> Iterable[str]:
    method store_string (line 213) | def store_string(self, string: str) -> None:
    method __repr__ (line 216) | def __repr__(self) -> str:
  class InMemoryHistory (line 220) | class InMemoryHistory(History):
    method __init__ (line 228) | def __init__(self, history_strings: Sequence[str] | None = None) -> None:
    method load_history_strings (line 236) | def load_history_strings(self) -> Iterable[str]:
    method store_string (line 239) | def store_string(self, string: str) -> None:
  class DummyHistory (line 243) | class DummyHistory(History):
    method load_history_strings (line 248) | def load_history_strings(self) -> Iterable[str]:
    method store_string (line 251) | def store_string(self, string: str) -> None:
    method append_string (line 254) | def append_string(self, string: str) -> None:
  class FileHistory (line 262) | class FileHistory(History):
    method __init__ (line 267) | def __init__(self, filename: _StrOrBytesPath) -> None:
    method load_history_strings (line 271) | def load_history_strings(self) -> Iterable[str]:
    method store_string (line 298) | def store_string(self, string: str) -> None:

FILE: src/prompt_toolkit/input/ansi_escape_sequences.py
  function _get_reverse_ansi_sequences (line 329) | def _get_reverse_ansi_sequences() -> dict[Keys, str]:

FILE: src/prompt_toolkit/input/base.py
  class Input (line 20) | class Input(metaclass=ABCMeta):
    method fileno (line 30) | def fileno(self) -> int:
    method typeahead_hash (line 36) | def typeahead_hash(self) -> str:
    method read_keys (line 42) | def read_keys(self) -> list[KeyPress]:
    method flush_keys (line 47) | def flush_keys(self) -> list[KeyPress]:
    method flush (line 54) | def flush(self) -> None:
    method closed (line 60) | def closed(self) -> bool:
    method raw_mode (line 65) | def raw_mode(self) -> AbstractContextManager[None]:
    method cooked_mode (line 71) | def cooked_mode(self) -> AbstractContextManager[None]:
    method attach (line 77) | def attach(
    method detach (line 86) | def detach(self) -> AbstractContextManager[None]:
    method close (line 92) | def close(self) -> None:
  class PipeInput (line 97) | class PipeInput(Input):
    method send_bytes (line 103) | def send_bytes(self, data: bytes) -> None:
    method send_text (line 107) | def send_text(self, data: str) -> None:
  class DummyInput (line 111) | class DummyInput(Input):
    method fileno (line 119) | def fileno(self) -> int:
    method typeahead_hash (line 122) | def typeahead_hash(self) -> str:
    method read_keys (line 125) | def read_keys(self) -> list[KeyPress]:
    method closed (line 129) | def closed(self) -> bool:
    method raw_mode (line 134) | def raw_mode(self) -> AbstractContextManager[None]:
    method cooked_mode (line 137) | def cooked_mode(self) -> AbstractContextManager[None]:
    method attach (line 140) | def attach(
    method detach (line 152) | def detach(self) -> AbstractContextManager[None]:
  function _dummy_context_manager (line 157) | def _dummy_context_manager() -> Generator[None, None, None]:

FILE: src/prompt_toolkit/input/defaults.py
  function create_input (line 16) | def create_input(stdin: TextIO | None = None, always_prefer_tty: bool = ...
  function create_pipe_input (line 60) | def create_pipe_input() -> AbstractContextManager[PipeInput]:

FILE: src/prompt_toolkit/input/posix_pipe.py
  class _Pipe (line 21) | class _Pipe:
    method __init__ (line 24) | def __init__(self) -> None:
    method close_read (line 29) | def close_read(self) -> None:
    method close_write (line 37) | def close_write(self) -> None:
    method close (line 45) | def close(self) -> None:
  class PosixPipeInput (line 51) | class PosixPipeInput(Vt100Input, PipeInput):
    method __init__ (line 65) | def __init__(self, _pipe: _Pipe, _text: str = "") -> None:
    method create (line 87) | def create(cls, text: str = "") -> Iterator[PosixPipeInput]:
    method send_bytes (line 94) | def send_bytes(self, data: bytes) -> None:
    method send_text (line 97) | def send_text(self, data: str) -> None:
    method raw_mode (line 101) | def raw_mode(self) -> AbstractContextManager[None]:
    method cooked_mode (line 104) | def cooked_mode(self) -> AbstractContextManager[None]:
    method close (line 107) | def close(self) -> None:
    method typeahead_hash (line 115) | def typeahead_hash(self) -> str:

FILE: src/prompt_toolkit/input/posix_utils.py
  class PosixStdinReader (line 12) | class PosixStdinReader:
    method __init__ (line 38) | def __init__(
    method read (line 53) | def read(self, count: int = 1024) -> str:

FILE: src/prompt_toolkit/input/typeahead.py
  function store_typeahead (line 51) | def store_typeahead(input_obj: Input, key_presses: list[KeyPress]) -> None:
  function get_typeahead (line 60) | def get_typeahead(input_obj: Input) -> list[KeyPress]:
  function clear_typeahead (line 72) | def clear_typeahead(input_obj: Input) -> None:

FILE: src/prompt_toolkit/input/vt100.py
  class Vt100Input (line 28) | class Vt100Input(Input):
    method __init__ (line 38) | def __init__(self, stdin: TextIO) -> None:
    method attach (line 79) | def attach(
    method detach (line 88) | def detach(self) -> AbstractContextManager[None]:
    method read_keys (line 95) | def read_keys(self) -> list[KeyPress]:
    method flush_keys (line 108) | def flush_keys(self) -> list[KeyPress]:
    method closed (line 123) | def closed(self) -> bool:
    method raw_mode (line 126) | def raw_mode(self) -> AbstractContextManager[None]:
    method cooked_mode (line 129) | def cooked_mode(self) -> AbstractContextManager[None]:
    method fileno (line 132) | def fileno(self) -> int:
    method typeahead_hash (line 135) | def typeahead_hash(self) -> str:
  function _attached_input (line 145) | def _attached_input(
  function _detached_input (line 195) | def _detached_input(input: Vt100Input) -> Generator[None, None, None]:
  class raw_mode (line 212) | class raw_mode:
    method __init__ (line 236) | def __init__(self, fileno: int) -> None:
    method __enter__ (line 245) | def __enter__(self) -> None:
    method _patch_lflag (line 265) | def _patch_lflag(cls, attrs: int) -> int:
    method _patch_iflag (line 269) | def _patch_iflag(cls, attrs: int) -> int:
    method __exit__ (line 283) | def __exit__(self, *a: object) -> None:
  class cooked_mode (line 294) | class cooked_mode(raw_mode):
    method _patch_lflag (line 304) | def _patch_lflag(cls, attrs: int) -> int:
    method _patch_iflag (line 308) | def _patch_iflag(cls, attrs: int) -> int:

FILE: src/prompt_toolkit/input/vt100_parser.py
  class _Flush (line 36) | class _Flush:
  class _IsPrefixOfLongerMatchCache (line 42) | class _IsPrefixOfLongerMatchCache(dict[str, bool]):
    method __missing__ (line 48) | def __missing__(self, prefix: str) -> bool:
  class Vt100Parser (line 70) | class Vt100Parser:
    method __init__ (line 89) | def __init__(self, feed_key_callback: Callable[[KeyPress], None]) -> N...
    method reset (line 93) | def reset(self, request: bool = False) -> None:
    method _start_parser (line 97) | def _start_parser(self) -> None:
    method _get_match (line 104) | def _get_match(self, prefix: str) -> None | Keys | tuple[Keys, ...]:
    method _input_parser_generator (line 123) | def _input_parser_generator(self) -> Generator[None, str | _Flush, None]:
    method _call_handler (line 173) | def _call_handler(
    method feed (line 193) | def feed(self, data: str) -> None:
    method flush (line 231) | def flush(self) -> None:
    method feed_and_flush (line 245) | def feed_and_flush(self, data: str) -> None:

FILE: src/prompt_toolkit/input/win32.py
  class _Win32InputBase (line 61) | class _Win32InputBase(Input):
    method __init__ (line 66) | def __init__(self) -> None:
    method handle (line 71) | def handle(self) -> HANDLE:
  class Win32Input (line 75) | class Win32Input(_Win32InputBase):
    method __init__ (line 80) | def __init__(self, stdin: TextIO | None = None) -> None:
    method attach (line 91) | def attach(
    method detach (line 100) | def detach(self) -> AbstractContextManager[None]:
    method read_keys (line 107) | def read_keys(self) -> list[KeyPress]:
    method flush_keys (line 110) | def flush_keys(self) -> list[KeyPress]:
    method closed (line 114) | def closed(self) -> bool:
    method raw_mode (line 117) | def raw_mode(self) -> AbstractContextManager[None]:
    method cooked_mode (line 122) | def cooked_mode(self) -> AbstractContextManager[None]:
    method fileno (line 125) | def fileno(self) -> int:
    method typeahead_hash (line 132) | def typeahead_hash(self) -> str:
    method close (line 135) | def close(self) -> None:
    method handle (line 139) | def handle(self) -> HANDLE:
  class ConsoleInputReader (line 143) | class ConsoleInputReader:
    method __init__ (line 221) | def __init__(self, recognize_paste: bool = True) -> None:
    method close (line 234) | def close(self) -> None:
    method read (line 239) | def read(self) -> Iterable[KeyPress]:
    method flush_keys (line 301) | def flush_keys(self) -> list[KeyPress]:
    method _insert_key_data (line 305) | def _insert_key_data(self, key_press: KeyPress) -> KeyPress:
    method _get_keys (line 319) | def _get_keys(
    method _merge_paired_surrogates (line 344) | def _merge_paired_surrogates(key_presses: list[KeyPress]) -> Iterator[...
    method _is_paste (line 377) | def _is_paste(keys: list[KeyPress]) -> bool:
    method _event_to_key_presses (line 398) | def _event_to_key_presses(self, ev: KEY_EVENT_RECORD) -> list[KeyPress]:
    method _handle_mouse (line 530) | def _handle_mouse(self, ev: MOUSE_EVENT_RECORD) -> list[KeyPress]:
  class Vt100ConsoleInputReader (line 578) | class Vt100ConsoleInputReader:
    method __init__ (line 591) | def __init__(self) -> None:
    method close (line 608) | def close(self) -> None:
    method read (line 613) | def read(self) -> Iterable[KeyPress]:
    method flush_keys (line 650) | def flush_keys(self) -> list[KeyPress]:
    method _get_keys (line 664) | def _get_keys(
  class _Win32Handles (line 688) | class _Win32Handles:
    method __init__ (line 704) | def __init__(self) -> None:
    method add_win32_handle (line 711) | def add_win32_handle(self, handle: HANDLE, callback: Callable[[], None...
    method remove_win32_handle (line 754) | def remove_win32_handle(self, handle: HANDLE) -> Callable[[], None] | ...
  function attach_win32_input (line 777) | def attach_win32_input(
  function detach_win32_input (line 806) | def detach_win32_input(input: _Win32InputBase) -> Iterator[None]:
  class raw_mode (line 822) | class raw_mode:
    method __init__ (line 833) | def __init__(
    method __enter__ (line 839) | def __enter__(self) -> None:
    method _patch (line 847) | def _patch(self) -> None:
    method __exit__ (line 862) | def __exit__(self, *a: object) -> None:
  class cooked_mode (line 867) | class cooked_mode(raw_mode):
    method _patch (line 875) | def _patch(self) -> None:
  function _is_win_vt100_input_enabled (line 888) | def _is_win_vt100_input_enabled() -> bool:

FILE: src/prompt_toolkit/input/win32_pipe.py
  class Win32PipeInput (line 23) | class Win32PipeInput(_Win32InputBase, PipeInput):
    method __init__ (line 41) | def __init__(self, _event: HANDLE) -> None:
    method create (line 62) | def create(cls) -> Iterator[Win32PipeInput]:
    method closed (line 70) | def closed(self) -> bool:
    method fileno (line 73) | def fileno(self) -> int:
    method handle (line 80) | def handle(self) -> HANDLE:
    method attach (line 84) | def attach(
    method detach (line 93) | def detach(self) -> AbstractContextManager[None]:
    method read_keys (line 100) | def read_keys(self) -> list[KeyPress]:
    method flush_keys (line 114) | def flush_keys(self) -> list[KeyPress]:
    method send_bytes (line 128) | def send_bytes(self, data: bytes) -> None:
    method send_text (line 132) | def send_text(self, text: str) -> None:
    method raw_mode (line 143) | def raw_mode(self) -> AbstractContextManager[None]:
    method cooked_mode (line 146) | def cooked_mode(self) -> AbstractContextManager[None]:
    method close (line 149) | def close(self) -> None:
    method typeahead_hash (line 154) | def typeahead_hash(self) -> str:

FILE: src/prompt_toolkit/key_binding/bindings/auto_suggest.py
  function load_auto_suggest_bindings (line 21) | def load_auto_suggest_bindings() -> KeyBindings:

FILE: src/prompt_toolkit/key_binding/bindings/basic.py
  function if_no_repeat (line 26) | def if_no_repeat(event: E) -> bool:
  function has_text_before_cursor (line 33) | def has_text_before_cursor() -> bool:
  function in_quoted_insert (line 38) | def in_quoted_insert() -> bool:
  function load_basic_bindings (line 42) | def load_basic_bindings() -> KeyBindings:

FILE: src/prompt_toolkit/key_binding/bindings/completion.py
  function generate_completions (line 35) | def generate_completions(event: E) -> None:
  function display_completions_like_readline (line 49) | def display_completions_like_readline(event: E) -> None:
  function _display_completions_like_readline (line 85) | def _display_completions_like_readline(
  function _create_more_session (line 177) | def _create_more_session(message: str = "--MORE--") -> PromptSession[bool]:

FILE: src/prompt_toolkit/key_binding/bindings/cpr.py
  function load_cpr_bindings (line 15) | def load_cpr_bindings() -> KeyBindings:

FILE: src/prompt_toolkit/key_binding/bindings/emacs.py
  function is_returnable (line 37) | def is_returnable() -> bool:
  function is_arg (line 42) | def is_arg() -> bool:
  function load_emacs_bindings (line 46) | def load_emacs_bindings() -> KeyBindingsBase:
  function load_emacs_search_bindings (line 344) | def load_emacs_search_bindings() -> KeyBindingsBase:
  function load_emacs_shift_selection_bindings (line 410) | def load_emacs_shift_selection_bindings() -> KeyBindingsBase:

FILE: src/prompt_toolkit/key_binding/bindings/focus.py
  function focus_next (line 13) | def focus_next(event: E) -> None:
  function focus_previous (line 21) | def focus_previous(event: E) -> None:

FILE: src/prompt_toolkit/key_binding/bindings/mouse.py
  function load_mouse_bindings (line 184) | def load_mouse_bindings() -> KeyBindings:

FILE: src/prompt_toolkit/key_binding/bindings/named_commands.py
  function register (line 39) | def register(name: str) -> Callable[[_T], _T]:
  function get_by_name (line 56) | def get_by_name(name: str) -> Binding:
  function beginning_of_buffer (line 73) | def beginning_of_buffer(event: E) -> None:
  function end_of_buffer (line 82) | def end_of_buffer(event: E) -> None:
  function beginning_of_line (line 91) | def beginning_of_line(event: E) -> None:
  function end_of_line (line 102) | def end_of_line(event: E) -> None:
  function forward_char (line 111) | def forward_char(event: E) -> None:
  function backward_char (line 120) | def backward_char(event: E) -> None:
  function forward_word (line 127) | def forward_word(event: E) -> None:
  function backward_word (line 140) | def backward_word(event: E) -> None:
  function clear_screen (line 153) | def clear_screen(event: E) -> None:
  function redraw_current_line (line 161) | def redraw_current_line(event: E) -> None:
  function accept_line (line 176) | def accept_line(event: E) -> None:
  function previous_history (line 184) | def previous_history(event: E) -> None:
  function next_history (line 192) | def next_history(event: E) -> None:
  function beginning_of_history (line 200) | def beginning_of_history(event: E) -> None:
  function end_of_history (line 208) | def end_of_history(event: E) -> None:
  function reverse_search_history (line 218) | def reverse_search_history(event: E) -> None:
  function end_of_file (line 236) | def end_of_file(event: E) -> None:
  function delete_char (line 244) | def delete_char(event: E) -> None:
  function backward_delete_char (line 254) | def backward_delete_char(event: E) -> None:
  function self_insert (line 270) | def self_insert(event: E) -> None:
  function transpose_chars (line 278) | def transpose_chars(event: E) -> None:
  function uppercase_word (line 297) | def uppercase_word(event: E) -> None:
  function downcase_word (line 310) | def downcase_word(event: E) -> None:
  function capitalize_word (line 323) | def capitalize_word(event: E) -> None:
  function quoted_insert (line 336) | def quoted_insert(event: E) -> None:
  function kill_line (line 350) | def kill_line(event: E) -> None:
  function kill_word (line 372) | def kill_word(event: E) -> None:
  function unix_word_rubout (line 390) | def unix_word_rubout(event: E, WORD: bool = True) -> None:
  function backward_kill_word (line 419) | def backward_kill_word(event: E) -> None:
  function delete_horizontal_space (line 428) | def delete_horizontal_space(event: E) -> None:
  function unix_line_discard (line 444) | def unix_line_discard(event: E) -> None:
  function yank (line 460) | def yank(event: E) -> None:
  function yank_nth_arg (line 470) | def yank_nth_arg(event: E) -> None:
  function yank_last_arg (line 480) | def yank_last_arg(event: E) -> None:
  function yank_pop (line 490) | def yank_pop(event: E) -> None:
  function complete (line 511) | def complete(event: E) -> None:
  function menu_complete (line 519) | def menu_complete(event: E) -> None:
  function menu_complete_backward (line 528) | def menu_complete_backward(event: E) -> None:
  function start_kbd_macro (line 541) | def start_kbd_macro(event: E) -> None:
  function end_kbd_macro (line 549) | def end_kbd_macro(event: E) -> None:
  function call_last_kbd_macro (line 559) | def call_last_kbd_macro(event: E) -> None:
  function print_last_kbd_macro (line 577) | def print_last_kbd_macro(event: E) -> None:
  function undo (line 600) | def undo(event: E) -> None:
  function insert_comment (line 608) | def insert_comment(event: E) -> None:
  function vi_editing_mode (line 636) | def vi_editing_mode(event: E) -> None:
  function emacs_editing_mode (line 644) | def emacs_editing_mode(event: E) -> None:
  function prefix_meta (line 652) | def prefix_meta(event: E) -> None:
  function operate_and_get_next (line 666) | def operate_and_get_next(event: E) -> None:
  function edit_and_execute (line 687) | def edit_and_execute(event: E) -> None:

FILE: src/prompt_toolkit/key_binding/bindings/open_in_editor.py
  function load_open_in_editor_bindings (line 19) | def load_open_in_editor_bindings() -> KeyBindingsBase:
  function load_emacs_open_in_editor_bindings (line 31) | def load_emacs_open_in_editor_bindings() -> KeyBindings:
  function load_vi_open_in_editor_bindings (line 44) | def load_vi_open_in_editor_bindings() -> KeyBindings:

FILE: src/prompt_toolkit/key_binding/bindings/page_navigation.py
  function load_page_navigation_bindings (line 34) | def load_page_navigation_bindings() -> KeyBindingsBase:
  function load_emacs_page_navigation_bindings (line 52) | def load_emacs_page_navigation_bindings() -> KeyBindingsBase:
  function load_vi_page_navigation_bindings (line 68) | def load_vi_page_navigation_bindings() -> KeyBindingsBase:

FILE: src/prompt_toolkit/key_binding/bindings/scroll.py
  function scroll_forward (line 25) | def scroll_forward(event: E, half: bool = False) -> None:
  function scroll_backward (line 56) | def scroll_backward(event: E, half: bool = False) -> None:
  function scroll_half_page_down (line 86) | def scroll_half_page_down(event: E) -> None:
  function scroll_half_page_up (line 93) | def scroll_half_page_up(event: E) -> None:
  function scroll_one_line_down (line 100) | def scroll_one_line_down(event: E) -> None:
  function scroll_one_line_up (line 119) | def scroll_one_line_up(event: E) -> None:
  function scroll_page_down (line 150) | def scroll_page_down(event: E) -> None:
  function scroll_page_up (line 168) | def scroll_page_up(event: E) -> None:

FILE: src/prompt_toolkit/key_binding/bindings/search.py
  function abort_search (line 28) | def abort_search(event: E) -> None:
  function accept_search (line 38) | def accept_search(event: E) -> None:
  function start_reverse_incremental_search (line 48) | def start_reverse_incremental_search(event: E) -> None:
  function start_forward_incremental_search (line 57) | def start_forward_incremental_search(event: E) -> None:
  function reverse_incremental_search (line 66) | def reverse_incremental_search(event: E) -> None:
  function forward_incremental_search (line 74) | def forward_incremental_search(event: E) -> None:
  function _previous_buffer_is_returnable (line 82) | def _previous_buffer_is_returnable() -> bool:
  function accept_search_and_accept_input (line 91) | def accept_search_and_accept_input(event: E) -> None:

FILE: src/prompt_toolkit/key_binding/bindings/vi.py
  class TextObjectType (line 61) | class TextObjectType(Enum):
  class TextObject (line 68) | class TextObject:
    method __init__ (line 74) | def __init__(
    method selection_type (line 82) | def selection_type(self) -> SelectionType:
    method sorted (line 90) | def sorted(self) -> tuple[int, int]:
    method operator_range (line 99) | def operator_range(self, document: Document) -> tuple[int, int]:
    method get_line_numbers (line 131) | def get_line_numbers(self, buffer: Buffer) -> tuple[int, int]:
    method cut (line 146) | def cut(self, buffer: Buffer) -> tuple[Document, ClipboardData]:
  function create_text_object_decorator (line 177) | def create_text_object_decorator(
  function create_operator_decorator (line 300) | def create_operator_decorator(
  function is_returnable (line 376) | def is_returnable() -> bool:
  function in_block_selection (line 381) | def in_block_selection() -> bool:
  function digraph_symbol_1_given (line 389) | def digraph_symbol_1_given() -> bool:
  function search_buffer_is_empty (line 394) | def search_buffer_is_empty() -> bool:
  function tilde_operator (line 400) | def tilde_operator() -> bool:
  function load_vi_bindings (line 404) | def load_vi_bindings() -> KeyBindingsBase:
  function load_vi_search_bindings (line 2193) | def load_vi_search_bindings() -> KeyBindingsBase:

FILE: src/prompt_toolkit/key_binding/defaults.py
  function load_key_bindings (line 34) | def load_key_bindings() -> KeyBindingsBase:

FILE: src/prompt_toolkit/key_binding/emacs_state.py
  class EmacsState (line 10) | class EmacsState:
    method __init__ (line 15) | def __init__(self) -> None:
    method reset (line 21) | def reset(self) -> None:
    method is_recording (line 25) | def is_recording(self) -> bool:
    method start_macro (line 29) | def start_macro(self) -> None:
    method end_macro (line 33) | def end_macro(self) -> None:

FILE: src/prompt_toolkit/key_binding/key_bindings.py
  class Binding (line 95) | class Binding:
    method __init__ (line 104) | def __init__(
    method call (line 122) | def call(self, event: KeyPressEvent) -> None:
    method __repr__ (line 139) | def __repr__(self) -> str:
  class KeyBindingsBase (line 149) | class KeyBindingsBase(metaclass=ABCMeta):
    method _version (line 156) | def _version(self) -> Hashable:
    method get_bindings_for_keys (line 164) | def get_bindings_for_keys(self, keys: KeysTuple) -> list[Binding]:
    method get_bindings_starting_with_keys (line 175) | def get_bindings_starting_with_keys(self, keys: KeysTuple) -> list[Bin...
    method bindings (line 188) | def bindings(self) -> list[Binding]:
  class KeyBindings (line 202) | class KeyBindings(KeyBindingsBase):
    method __init__ (line 224) | def __init__(self) -> None:
    method _clear_cache (line 234) | def _clear_cache(self) -> None:
    method bindings (line 240) | def bindings(self) -> list[Binding]:
    method _version (line 244) | def _version(self) -> Hashable:
    method add (line 247) | def add(
    method remove (line 319) | def remove(self, *args: Keys | str | KeyHandlerCallable) -> None:
    method get_bindings_for_keys (line 367) | def get_bindings_for_keys(self, keys: KeysTuple) -> list[Binding]:
    method get_bindings_starting_with_keys (line 402) | def get_bindings_starting_with_keys(self, keys: KeysTuple) -> list[Bin...
  function _parse_key (line 428) | def _parse_key(key: Keys | str) -> str | Keys:
  function key_binding (line 456) | def key_binding(
  class _Proxy (line 490) | class _Proxy(KeyBindingsBase):
    method __init__ (line 495) | def __init__(self) -> None:
    method _update_cache (line 500) | def _update_cache(self) -> None:
    method bindings (line 510) | def bindings(self) -> list[Binding]:
    method _version (line 515) | def _version(self) -> Hashable:
    method get_bindings_for_keys (line 519) | def get_bindings_for_keys(self, keys: KeysTuple) -> list[Binding]:
    method get_bindings_starting_with_keys (line 523) | def get_bindings_starting_with_keys(self, keys: KeysTuple) -> list[Bin...
  class ConditionalKeyBindings (line 528) | class ConditionalKeyBindings(_Proxy):
    method __init__ (line 546) | def __init__(
    method _update_cache (line 554) | def _update_cache(self) -> None:
  class _MergedKeyBindings (line 579) | class _MergedKeyBindings(_Proxy):
    method __init__ (line 589) | def __init__(self, registries: Sequence[KeyBindingsBase]) -> None:
    method _update_cache (line 593) | def _update_cache(self) -> None:
  function merge_key_bindings (line 610) | def merge_key_bindings(bindings: Sequence[KeyBindingsBase]) -> _MergedKe...
  class DynamicKeyBindings (line 621) | class DynamicKeyBindings(_Proxy):
    method __init__ (line 628) | def __init__(self, get_key_bindings: Callable[[], KeyBindingsBase | No...
    method _update_cache (line 634) | def _update_cache(self) -> None:
  class GlobalOnlyKeyBindings (line 643) | class GlobalOnlyKeyBindings(_Proxy):
    method __init__ (line 649) | def __init__(self, key_bindings: KeyBindingsBase) -> None:
    method _update_cache (line 653) | def _update_cache(self) -> None:

FILE: src/prompt_toolkit/key_binding/key_processor.py
  class KeyPress (line 37) | class KeyPress:
    method __init__ (line 43) | def __init__(self, key: Keys | str, data: str | None = None) -> None:
    method __repr__ (line 55) | def __repr__(self) -> str:
    method __eq__ (line 58) | def __eq__(self, other: object) -> bool:
  class KeyProcessor (line 71) | class KeyProcessor:
    method __init__ (line 93) | def __init__(self, key_bindings: KeyBindingsBase) -> None:
    method reset (line 103) | def reset(self) -> None:
    method _get_matches (line 122) | def _get_matches(self, key_presses: list[KeyPress]) -> list[Binding]:
    method _is_prefix_of_longer_match (line 132) | def _is_prefix_of_longer_match(self, key_presses: list[KeyPress]) -> b...
    method _process (line 150) | def _process(self) -> Generator[None, KeyPress, None]:
    method feed (line 209) | def feed(self, key_press: KeyPress, first: bool = False) -> None:
    method feed_multiple (line 221) | def feed_multiple(self, key_presses: list[KeyPress], first: bool = Fal...
    method process_keys (line 230) | def process_keys(self) -> None:
    method empty_queue (line 289) | def empty_queue(self) -> list[KeyPress]:
    method _call_handler (line 300) | def _call_handler(self, handler: Binding, key_sequence: list[KeyPress]...
    method _fix_vi_cursor_position (line 351) | def _fix_vi_cursor_position(self, event: KeyPressEvent) -> None:
    method _leave_vi_temp_navigation_mode (line 372) | def _leave_vi_temp_navigation_mode(self, event: KeyPressEvent) -> None:
    method _start_timeout (line 384) | def _start_timeout(self) -> None:
    method send_sigint (line 417) | def send_sigint(self) -> None:
  class KeyPressEvent (line 425) | class KeyPressEvent:
    method __init__ (line 436) | def __init__(
    method __repr__ (line 454) | def __repr__(self) -> str:
    method data (line 458) | def data(self) -> str:
    method key_processor (line 462) | def key_processor(self) -> KeyProcessor:
    method app (line 469) | def app(self) -> Application[Any]:
    method current_buffer (line 476) | def current_buffer(self) -> Buffer:
    method arg (line 483) | def arg(self) -> int:
    method arg_present (line 499) | def arg_present(self) -> bool:
    method append_to_arg_count (line 505) | def append_to_arg_count(self, data: str) -> None:
    method cli (line 525) | def cli(self) -> Application[Any]:

FILE: src/prompt_toolkit/key_binding/vi_state.py
  class InputMode (line 20) | class InputMode(str, Enum):
  class CharacterFind (line 30) | class CharacterFind:
    method __init__ (line 31) | def __init__(self, character: str, backwards: bool = False) -> None:
  class ViState (line 36) | class ViState:
    method __init__ (line 41) | def __init__(self) -> None:
    method input_mode (line 81) | def input_mode(self) -> InputMode:
    method input_mode (line 86) | def input_mode(self, value: InputMode) -> None:
    method reset (line 95) | def reset(self) -> None:

FILE: src/prompt_toolkit/keys.py
  class Keys (line 11) | class Keys(str, Enum):

FILE: src/prompt_toolkit/layout/containers.py
  class Container (line 83) | class Container(metaclass=ABCMeta):
    method reset (line 89) | def reset(self) -> None:
    method preferred_width (line 96) | def preferred_width(self, max_available_width: int) -> Dimension:
    method preferred_height (line 103) | def preferred_height(self, width: int, max_available_height: int) -> D...
    method write_to_screen (line 110) | def write_to_screen(
    method is_modal (line 131) | def is_modal(self) -> bool:
    method get_key_bindings (line 138) | def get_key_bindings(self) -> KeyBindingsBase | None:
    method get_children (line 147) | def get_children(self) -> list[Container]:
  class MagicContainer (line 156) | class MagicContainer(Protocol):
    method __pt_container__ (line 161) | def __pt_container__(self) -> AnyContainer: ...
  function _window_too_small (line 167) | def _window_too_small() -> Window:
  class VerticalAlign (line 174) | class VerticalAlign(Enum):
  class HorizontalAlign (line 183) | class HorizontalAlign(Enum):
  class _Split (line 192) | class _Split(Container):
    method __init__ (line 197) | def __init__(
    method is_modal (line 225) | def is_modal(self) -> bool:
    method get_key_bindings (line 228) | def get_key_bindings(self) -> KeyBindingsBase | None:
    method get_children (line 231) | def get_children(self) -> list[Container]:
  class HSplit (line 235) | class HSplit(_Split):
    method __init__ (line 269) | def __init__(
    method preferred_width (line 305) | def preferred_width(self, max_available_width: int) -> Dimension:
    method preferred_height (line 315) | def preferred_height(self, width: int, max_available_height: int) -> D...
    method reset (line 324) | def reset(self) -> None:
    method _all_children (line 329) | def _all_children(self) -> list[Container]:
    method write_to_screen (line 362) | def write_to_screen(
    method _divide_heights (line 419) | def _divide_heights(self, write_position: WritePosition) -> list[int] ...
  class VSplit (line 473) | class VSplit(_Split):
    method __init__ (line 506) | def __init__(
    method preferred_width (line 542) | def preferred_width(self, max_available_width: int) -> Dimension:
    method preferred_height (line 552) | def preferred_height(self, width: int, max_available_height: int) -> D...
    method reset (line 576) | def reset(self) -> None:
    method _all_children (line 581) | def _all_children(self) -> list[Container]:
    method _divide_widths (line 614) | def _divide_widths(self, width: int) -> list[int] | None:
    method write_to_screen (line 665) | def write_to_screen(
  class FloatContainer (line 736) | class FloatContainer(Container):
    method __init__ (line 755) | def __init__(
    method reset (line 772) | def reset(self) -> None:
    method preferred_width (line 778) | def preferred_width(self, max_available_width: int) -> Dimension:
    method preferred_height (line 781) | def preferred_height(self, width: int, max_available_height: int) -> D...
    method write_to_screen (line 789) | def write_to_screen(
    method _draw_float (line 846) | def _draw_float(
    method _area_is_empty (line 990) | def _area_is_empty(self, screen: Screen, write_position: WritePosition...
    method is_modal (line 1008) | def is_modal(self) -> bool:
    method get_key_bindings (line 1011) | def get_key_bindings(self) -> KeyBindingsBase | None:
    method get_children (line 1014) | def get_children(self) -> list[Container]:
  class Float (line 1020) | class Float:
    method __init__ (line 1046) | def __init__(
    method get_width (line 1086) | def get_width(self) -> int | None:
    method get_height (line 1091) | def get_height(self) -> int | None:
    method __repr__ (line 1096) | def __repr__(self) -> str:
  class WindowRenderInfo (line 1100) | class WindowRenderInfo:
    method __init__ (line 1127) | def __init__(
    method visible_line_to_input_line (line 1158) | def visible_line_to_input_line(self) -> dict[int, int]:
    method cursor_position (line 1165) | def cursor_position(self) -> Point:
    method applied_scroll_offsets (line 1181) | def applied_scroll_offsets(self) -> ScrollOffsets:
    method displayed_lines (line 1209) | def displayed_lines(self) -> list[int]:
    method input_line_to_visible_line (line 1217) | def input_line_to_visible_line(self) -> dict[int, int]:
    method first_visible_line (line 1231) | def first_visible_line(self, after_scroll_offset: bool = False) -> int:
    method last_visible_line (line 1241) | def last_visible_line(self, before_scroll_offset: bool = False) -> int:
    method center_visible_line (line 1250) | def center_visible_line(
    method content_height (line 1266) | def content_height(self) -> int:
    method full_height_visible (line 1273) | def full_height_visible(self) -> bool:
    method top_visible (line 1283) | def top_visible(self) -> bool:
    method bottom_visible (line 1290) | def bottom_visible(self) -> bool:
    method vertical_scroll_percentage (line 1297) | def vertical_scroll_percentage(self) -> int:
    method get_height_for_line (line 1307) | def get_height_for_line(self, lineno: int) -> int:
  class ScrollOffsets (line 1320) | class ScrollOffsets:
    method __init__ (line 1327) | def __init__(
    method top (line 1340) | def top(self) -> int:
    method bottom (line 1344) | def bottom(self) -> int:
    method left (line 1348) | def left(self) -> int:
    method right (line 1352) | def right(self) -> int:
    method __repr__ (line 1355) | def __repr__(self) -> str:
  class ColorColumn (line 1359) | class ColorColumn:
    method __init__ (line 1364) | def __init__(self, position: int, style: str = "class:color-column") -...
  class WindowAlign (line 1372) | class WindowAlign(Enum):
  class Window (line 1386) | class Window(Container):
    method __init__ (line 1448) | def __init__(
    method __repr__ (line 1512) | def __repr__(self) -> str:
    method reset (line 1515) | def reset(self) -> None:
    method _get_margin_width (line 1531) | def _get_margin_width(self, margin: Margin) -> int:
    method _get_total_margin_width (line 1547) | def _get_total_margin_width(self) -> int:
    method preferred_width (line 1555) | def preferred_width(self, max_available_width: int) -> Dimension:
    method preferred_height (line 1586) | def preferred_height(self, width: int, max_available_height: int) -> D...
    method _merge_dimensions (line 1614) | def _merge_dimensions(
    method _get_ui_content (line 1662) | def _get_ui_content(self, width: int, height: int) -> UIContent:
    method _get_digraph_char (line 1673) | def _get_digraph_char(self) -> str | None:
    method write_to_screen (line 1684) | def write_to_screen(
    method _write_to_screen_at_index (line 1741) | def _write_to_screen_at_index(
    method _copy_body (line 1924) | def _copy_body(
    method _fill_bg (line 2166) | def _fill_bg(
    method _apply_style (line 2188) | def _apply_style(
    method _highlight_digraph (line 2206) | def _highlight_digraph(self, new_screen: Screen) -> None:
    method _show_key_processor_key_buffer (line 2218) | def _show_key_processor_key_buffer(self, new_screen: Screen) -> None:
    method _highlight_cursorlines (line 2241) | def _highlight_cursorlines(
    method _copy_margin (line 2289) | def _copy_margin(
    method _scroll (line 2306) | def _scroll(self, ui_content: UIContent, width: int, height: int) -> N...
    method _scroll_when_linewrapping (line 2317) | def _scroll_when_linewrapping(
    method _scroll_without_linewrapping (line 2438) | def _scroll_without_linewrapping(
    method _mouse_handler (line 2543) | def _mouse_handler(self, mouse_event: MouseEvent) -> NotImplementedOrN...
    method _scroll_down (line 2560) | def _scroll_down(self) -> None:
    method _scroll_up (line 2573) | def _scroll_up(self) -> None:
    method get_key_bindings (line 2590) | def get_key_bindings(self) -> KeyBindingsBase | None:
    method get_children (line 2593) | def get_children(self) -> list[Container]:
  class ConditionalContainer (line 2597) | class ConditionalContainer(Container):
    method __init__ (line 2607) | def __init__(
    method __repr__ (line 2621) | def __repr__(self) -> str:
    method reset (line 2624) | def reset(self) -> None:
    method preferred_width (line 2627) | def preferred_width(self, max_available_width: int) -> Dimension:
    method preferred_height (line 2635) | def preferred_height(self, width: int, max_available_height: int) -> D...
    method write_to_screen (line 2645) | def write_to_screen(
    method get_children (line 2668) | def get_children(self) -> list[Container]:
  class DynamicContainer (line 2675) | class DynamicContainer(Container):
    method __init__ (line 2683) | def __init__(self, get_container: Callable[[], AnyContainer]) -> None:
    method _get_container (line 2686) | def _get_container(self) -> Container:
    method reset (line 2696) | def reset(self) -> None:
    method preferred_width (line 2699) | def preferred_width(self, max_available_width: int) -> Dimension:
    method preferred_height (line 2702) | def preferred_height(self, width: int, max_available_height: int) -> D...
    method write_to_screen (line 2705) | def write_to_screen(
    method is_modal (line 2718) | def is_modal(self) -> bool:
    method get_key_bindings (line 2721) | def get_key_bindings(self) -> KeyBindingsBase | None:
    method get_children (line 2726) | def get_children(self) -> list[Container]:
  function to_container (line 2734) | def to_container(container: AnyContainer) -> Container:
  function to_window (line 2746) | def to_window(container: AnyContainer) -> Window:
  function is_container (line 2758) | def is_container(value: object) -> TypeGuard[AnyContainer]:

FILE: src/prompt_toolkit/layout/controls.py
  class UIControl (line 64) | class UIControl(metaclass=ABCMeta):
    method reset (line 69) | def reset(self) -> None:
    method preferred_width (line 73) | def preferred_width(self, max_available_width: int) -> int | None:
    method preferred_height (line 76) | def preferred_height(
    method is_focusable (line 85) | def is_focusable(self) -> bool:
    method create_content (line 92) | def create_content(self, width: int, height: int) -> UIContent:
    method mouse_handler (line 99) | def mouse_handler(self, mouse_event: MouseEvent) -> NotImplementedOrNone:
    method move_cursor_down (line 111) | def move_cursor_down(self) -> None:
    method move_cursor_up (line 118) | def move_cursor_up(self) -> None:
    method get_key_bindings (line 123) | def get_key_bindings(self) -> KeyBindingsBase | None:
    method get_invalidate_events (line 131) | def get_invalidate_events(self) -> Iterable[Event[object]]:
  class UIContent (line 140) | class UIContent:
    method __init__ (line 153) | def __init__(
    method __getitem__ (line 170) | def __getitem__(self, lineno: int) -> StyleAndTextTuples:
    method get_height_for_line (line 177) | def get_height_for_line(
  class FormattedTextControl (line 251) | class FormattedTextControl(UIControl):
    method __init__ (line 294) | def __init__(
    method reset (line 324) | def reset(self) -> None:
    method is_focusable (line 327) | def is_focusable(self) -> bool:
    method __repr__ (line 330) | def __repr__(self) -> str:
    method _get_formatted_text_cached (line 333) | def _get_formatted_text_cached(self) -> StyleAndTextTuples:
    method preferred_width (line 343) | def preferred_width(self, max_available_width: int) -> int:
    method preferred_height (line 352) | def preferred_height(
    method create_content (line 373) | def create_content(self, width: int, height: int | None) -> UIContent:
    method mouse_handler (line 423) | def mouse_handler(self, mouse_event: MouseEvent) -> NotImplementedOrNone:
    method is_modal (line 462) | def is_modal(self) -> bool:
    method get_key_bindings (line 465) | def get_key_bindings(self) -> KeyBindingsBase | None:
  class DummyControl (line 469) | class DummyControl(UIControl):
    method create_content (line 478) | def create_content(self, width: int, height: int) -> UIContent:
    method is_focusable (line 484) | def is_focusable(self) -> bool:
  class _ProcessedLine (line 488) | class _ProcessedLine(NamedTuple):
  class BufferControl (line 494) | class BufferControl(UIControl):
    method __init__ (line 514) | def __init__(
    method __repr__ (line 560) | def __repr__(self) -> str:
    method search_buffer_control (line 564) | def search_buffer_control(self) -> SearchBufferControl | None:
    method search_buffer (line 576) | def search_buffer(self) -> Buffer | None:
    method search_state (line 583) | def search_state(self) -> SearchState:
    method is_focusable (line 596) | def is_focusable(self) -> bool:
    method preferred_width (line 599) | def preferred_width(self, max_available_width: int) -> int | None:
    method preferred_height (line 612) | def preferred_height(
    method _get_formatted_text_for_line_func (line 642) | def _get_formatted_text_for_line_func(
    method _create_get_processed_line_func (line 656) | def _create_get_processed_line_func(
    method create_content (line 720) | def create_content(
    method mouse_handler (line 825) | def mouse_handler(self, mouse_event: MouseEvent) -> NotImplementedOrNone:
    method move_cursor_down (line 904) | def move_cursor_down(self) -> None:
    method move_cursor_up (line 908) | def move_cursor_up(self) -> None:
    method get_key_bindings (line 912) | def get_key_bindings(self) -> KeyBindingsBase | None:
    method get_invalidate_events (line 918) | def get_invalidate_events(self) -> Iterable[Event[object]]:
  class SearchBufferControl (line 930) | class SearchBufferControl(BufferControl):
    method __init__ (line 938) | def __init__(

FILE: src/prompt_toolkit/layout/dimension.py
  class Dimension (line 25) | class Dimension:
    method __init__ (line 43) | def __init__(
    method exact (line 88) | def exact(cls, amount: int) -> Dimension:
    method zero (line 96) | def zero(cls) -> Dimension:
    method __repr__ (line 103) | def __repr__(self) -> str:
  function sum_layout_dimensions (line 117) | def sum_layout_dimensions(dimensions: list[Dimension]) -> Dimension:
  function max_layout_dimensions (line 128) | def max_layout_dimensions(dimensions: list[Dimension]) -> Dimension:
  function to_dimension (line 177) | def to_dimension(value: AnyDimension) -> Dimension:
  function is_dimension (line 193) | def is_dimension(value: object) -> TypeGuard[AnyDimension]:

FILE: src/prompt_toolkit/layout/dummy.py
  function create_dummy_layout (line 24) | def create_dummy_layout() -> Layout:

FILE: src/prompt_toolkit/layout/layout.py
  class Layout (line 29) | class Layout:
    method __init__ (line 40) | def __init__(
    method __repr__ (line 74) | def __repr__(self) -> str:
    method find_all_windows (line 77) | def find_all_windows(self) -> Generator[Window, None, None]:
    method find_all_controls (line 85) | def find_all_controls(self) -> Iterable[UIControl]:
    method focus (line 89) | def focus(self, value: FocusableElement) -> None:
    method has_focus (line 167) | def has_focus(self, value: FocusableElement) -> bool:
    method current_control (line 193) | def current_control(self) -> UIControl:
    method current_control (line 200) | def current_control(self, control: UIControl) -> None:
    method current_window (line 212) | def current_window(self) -> Window:
    method current_window (line 217) | def current_window(self, value: Window) -> None:
    method is_searching (line 222) | def is_searching(self) -> bool:
    method search_target_buffer_control (line 227) | def search_target_buffer_control(self) -> BufferControl | None:
    method get_focusable_windows (line 240) | def get_focusable_windows(self) -> Iterable[Window]:
    method get_visible_focusable_windows (line 249) | def get_visible_focusable_windows(self) -> list[Window]:
    method current_buffer (line 259) | def current_buffer(self) -> Buffer | None:
    method get_buffer_by_name (line 268) | def get_buffer_by_name(self, buffer_name: str) -> Buffer | None:
    method buffer_has_focus (line 280) | def buffer_has_focus(self) -> bool:
    method previous_control (line 290) | def previous_control(self) -> UIControl:
    method focus_last (line 299) | def focus_last(self) -> None:
    method focus_next (line 306) | def focus_next(self) -> None:
    method focus_previous (line 322) | def focus_previous(self) -> None:
    method walk (line 338) | def walk(self) -> Iterable[Container]:
    method walk_through_modal_area (line 344) | def walk_through_modal_area(self) -> Iterable[Container]:
    method update_parents_relations (line 357) | def update_parents_relations(self) -> None:
    method reset (line 372) | def reset(self) -> None:
    method get_parent (line 381) | def get_parent(self, container: Container) -> Container | None:
  class InvalidLayoutError (line 392) | class InvalidLayoutError(Exception):
  function walk (line 396) | def walk(container: Container, skip_hidden: bool = False) -> Iterable[Co...

FILE: src/prompt_toolkit/layout/margins.py
  class Margin (line 33) | class Margin(metaclass=ABCMeta):
    method get_width (line 39) | def get_width(self, get_ui_content: Callable[[], UIContent]) -> int:
    method create_margin (line 50) | def create_margin(
  class NumberedMargin (line 70) | class NumberedMargin(Margin):
    method __init__ (line 80) | def __init__(
    method get_width (line 86) | def get_width(self, get_ui_content: Callable[[], UIContent]) -> int:
    method create_margin (line 90) | def create_margin(
  class ConditionalMargin (line 138) | class ConditionalMargin(Margin):
    method __init__ (line 143) | def __init__(self, margin: Margin, filter: FilterOrBool) -> None:
    method get_width (line 147) | def get_width(self, get_ui_content: Callable[[], UIContent]) -> int:
    method create_margin (line 153) | def create_margin(
  class ScrollbarMargin (line 162) | class ScrollbarMargin(Margin):
    method __init__ (line 169) | def __init__(
    method get_width (line 179) | def get_width(self, get_ui_content: Callable[[], UIContent]) -> int:
    method create_margin (line 182) | def create_margin(
  class PromptMargin (line 248) | class PromptMargin(Margin):
    method __init__ (line 270) | def __init__(
    method get_width (line 279) | def get_width(self, get_ui_content: Callable[[], UIContent]) -> int:
    method create_margin (line 285) | def create_margin(

FILE: src/prompt_toolkit/layout/menus.py
  class CompletionsMenuControl (line 50) | class CompletionsMenuControl(UIControl):
    method has_focus (line 65) | def has_focus(self) -> bool:
    method preferred_width (line 68) | def preferred_width(self, max_available_width: int) -> int | None:
    method preferred_height (line 78) | def preferred_height(
    method create_content (line 91) | def create_content(self, width: int, height: int) -> UIContent:
    method _show_meta (line 128) | def _show_meta(self, complete_state: CompletionState) -> bool:
    method _get_menu_width (line 134) | def _get_menu_width(self, max_width: int, complete_state: CompletionSt...
    method _get_menu_meta_width (line 146) | def _get_menu_meta_width(
    method _get_menu_item_meta_fragments (line 167) | def _get_menu_item_meta_fragments(
    method mouse_handler (line 183) | def mouse_handler(self, mouse_event: MouseEvent) -> NotImplementedOrNone:
  function _get_menu_item_fragments (line 205) | def _get_menu_item_fragments(
  function _trim_formatted_text (line 232) | def _trim_formatted_text(
  class CompletionsMenu (line 262) | class CompletionsMenu(ConditionalContainer):
    method __init__ (line 266) | def __init__(
  class MultiColumnCompletionMenuControl (line 294) | class MultiColumnCompletionMenuControl(UIControl):
    method __init__ (line 319) | def __init__(self, min_rows: int = 3, suggested_max_column_width: int ...
    method reset (line 345) | def reset(self) -> None:
    method has_focus (line 348) | def has_focus(self) -> bool:
    method preferred_width (line 351) | def preferred_width(self, max_available_width: int) -> int | None:
    method preferred_height (line 376) | def preferred_height(
    method create_content (line 395) | def create_content(self, width: int, height: int) -> UIContent:
    method _get_column_width (line 512) | def _get_column_width(self, completion_state: CompletionState) -> int:
    method mouse_handler (line 533) | def mouse_handler(self, mouse_event: MouseEvent) -> NotImplementedOrNone:
    method get_key_bindings (line 577) | def get_key_bindings(self) -> KeyBindings:
  class MultiColumnCompletionsMenu (line 628) | class MultiColumnCompletionsMenu(HSplit):
    method __init__ (line 635) | def __init__(
  class _SelectedCompletionMetaControl (line 684) | class _SelectedCompletionMetaControl(UIControl):
    method preferred_width (line 689) | def preferred_width(self, max_available_width: int) -> int | None:
    method preferred_height (line 716) | def preferred_height(
    method create_content (line 725) | def create_content(self, width: int, height: int) -> UIContent:
    method _get_text_fragments (line 733) | def _get_text_fragments(self) -> StyleAndTextTuples:

FILE: src/prompt_toolkit/layout/mouse_handlers.py
  class MouseHandlers (line 21) | class MouseHandlers:
    method __init__ (line 26) | def __init__(self) -> None:
    method set_mouse_handler_for_range (line 42) | def set_mouse_handler_for_range(

FILE: src/prompt_toolkit/layout/processors.py
  class Processor (line 59) | class Processor(metaclass=ABCMeta):
    method apply_transformation (line 66) | def apply_transformation(
  class TransformationInput (line 81) | class TransformationInput:
    method __init__ (line 95) | def __init__(
    method unpack (line 115) | def unpack(
  class Transformation (line 131) | class Transformation:
    method __init__ (line 146) | def __init__(
  class DummyProcessor (line 157) | class DummyProcessor(Processor):
    method apply_transformation (line 162) | def apply_transformation(
  class HighlightSearchProcessor (line 168) | class HighlightSearchProcessor(Processor):
    method _get_search_text (line 180) | def _get_search_text(self, buffer_control: BufferControl) -> str:
    method apply_transformation (line 186) | def apply_transformation(
  class HighlightIncrementalSearchProcessor (line 242) | class HighlightIncrementalSearchProcessor(HighlightSearchProcessor):
    method _get_search_text (line 255) | def _get_search_text(self, buffer_control: BufferControl) -> str:
  class HighlightSelectionProcessor (line 266) | class HighlightSelectionProcessor(Processor):
    method apply_transformation (line 271) | def apply_transformation(
  class PasswordProcessor (line 311) | class PasswordProcessor(Processor):
    method __init__ (line 318) | def __init__(self, char: str = "*") -> None:
    method apply_transformation (line 321) | def apply_transformation(self, ti: TransformationInput) -> Transformat...
  class HighlightMatchingBracketProcessor (line 333) | class HighlightMatchingBracketProcessor(Processor):
    method __init__ (line 347) | def __init__(
    method _get_positions_to_highlight (line 357) | def _get_positions_to_highlight(self, document: Document) -> list[tupl...
    method apply_transformation (line 396) | def apply_transformation(
  class DisplayMultipleCursors (line 437) | class DisplayMultipleCursors(Processor):
    method apply_transformation (line 442) | def apply_transformation(
  class BeforeInput (line 486) | class BeforeInput(Processor):
    method __init__ (line 495) | def __init__(self, text: AnyFormattedText, style: str = "") -> None:
    method apply_transformation (line 499) | def apply_transformation(self, ti: TransformationInput) -> Transformat...
    method __repr__ (line 522) | def __repr__(self) -> str:
  class ShowArg (line 526) | class ShowArg(BeforeInput):
    method __init__ (line 534) | def __init__(self) -> None:
    method _get_text_fragments (line 537) | def _get_text_fragments(self) -> StyleAndTextTuples:
    method __repr__ (line 550) | def __repr__(self) -> str:
  class AfterInput (line 554) | class AfterInput(Processor):
    method __init__ (line 563) | def __init__(self, text: AnyFormattedText, style: str = "") -> None:
    method apply_transformation (line 567) | def apply_transformation(self, ti: TransformationInput) -> Transformat...
    method __repr__ (line 576) | def __repr__(self) -> str:
  class AppendAutoSuggestion (line 580) | class AppendAutoSuggestion(Processor):
    method __init__ (line 586) | def __init__(self, style: str = "class:auto-suggestion") -> None:
    method apply_transformation (line 589) | def apply_transformation(self, ti: TransformationInput) -> Transformat...
  class ShowLeadingWhiteSpaceProcessor (line 604) | class ShowLeadingWhiteSpaceProcessor(Processor):
    method __init__ (line 611) | def __init__(
    method apply_transformation (line 625) | def apply_transformation(self, ti: TransformationInput) -> Transformat...
  class ShowTrailingWhiteSpaceProcessor (line 642) | class ShowTrailingWhiteSpaceProcessor(Processor):
    method __init__ (line 649) | def __init__(
    method apply_transformation (line 663) | def apply_transformation(self, ti: TransformationInput) -> Transformat...
  class TabsProcessor (line 681) | class TabsProcessor(Processor):
    method __init__ (line 693) | def __init__(
    method apply_transformation (line 705) | def apply_transformation(self, ti: TransformationInput) -> Transformat...
  class ReverseSearchProcessor (line 764) | class ReverseSearchProcessor(Processor):
    method _get_main_buffer (line 780) | def _get_main_buffer(self, buffer_control: BufferControl) -> BufferCon...
    method _content (line 791) | def _content(
    method apply_transformation (line 848) | def apply_transformation(self, ti: TransformationInput) -> Transformat...
  class ConditionalProcessor (line 901) | class ConditionalProcessor(Processor):
    method __init__ (line 920) | def __init__(self, processor: Processor, filter: FilterOrBool) -> None:
    method apply_transformation (line 924) | def apply_transformation(
    method __repr__ (line 933) | def __repr__(self) -> str:
  class DynamicProcessor (line 937) | class DynamicProcessor(Processor):
    method __init__ (line 944) | def __init__(self, get_processor: Callable[[], Processor | None]) -> N...
    method apply_transformation (line 947) | def apply_transformation(self, ti: TransformationInput) -> Transformat...
  function merge_processors (line 952) | def merge_processors(processors: list[Processor]) -> Processor:
  class _MergedProcessor (line 965) | class _MergedProcessor(Processor):
    method __init__ (line 971) | def __init__(self, processors: list[Processor]):
    method apply_transformation (line 974) | def apply_transformation(self, ti: TransformationInput) -> Transformat...

FILE: src/prompt_toolkit/layout/screen.py
  class Char (line 21) | class Char:
    method __init__ (line 109) | def __init__(self, char: str = " ", style: str = "") -> None:
    method _equal (line 129) | def _equal(self, other: Char) -> bool:
    method _not_equal (line 132) | def _not_equal(self, other: Char) -> bool:
    method __repr__ (line 141) | def __repr__(self) -> str:
  class Screen (line 151) | class Screen:
    method __init__ (line 156) | def __init__(
    method visible_windows (line 205) | def visible_windows(self) -> list[Window]:
    method set_cursor_position (line 208) | def set_cursor_position(self, window: Window, position: Point) -> None:
    method set_menu_position (line 214) | def set_menu_position(self, window: Window, position: Point) -> None:
    method get_cursor_position (line 220) | def get_cursor_position(self, window: Window) -> Point:
    method get_menu_position (line 230) | def get_menu_position(self, window: Window) -> Point:
    method draw_with_z_index (line 243) | def draw_with_z_index(self, z_index: int, draw_func: Callable[[], None...
    method draw_all_floats (line 250) | def draw_all_floats(self) -> None:
    method append_style_to_content (line 265) | def append_style_to_content(self, style_str: str) -> None:
    method fill_area (line 279) | def fill_area(
  class WritePosition (line 312) | class WritePosition:
    method __init__ (line 313) | def __init__(self, xpos: int, ypos: int, width: int, height: int) -> N...
    method __repr__ (line 323) | def __repr__(self) -> str:

FILE: src/prompt_toolkit/layout/scrollable_pane.py
  class ScrollablePane (line 19) | class ScrollablePane(Container):
    method __init__ (line 52) | def __init__(
    method __repr__ (line 80) | def __repr__(self) -> str:
    method reset (line 83) | def reset(self) -> None:
    method preferred_width (line 86) | def preferred_width(self, max_available_width: int) -> Dimension:
    method preferred_height (line 100) | def preferred_height(self, width: int, max_available_height: int) -> D...
    method write_to_screen (line 115) | def write_to_screen(
    method _clip_point_to_visible_area (line 234) | def _clip_point_to_visible_area(
    method _copy_over_screen (line 251) | def _copy_over_screen(
    method _copy_over_mouse_handlers (line 278) | def _copy_over_mouse_handlers(
    method _copy_over_write_positions (line 329) | def _copy_over_write_positions(
    method is_modal (line 348) | def is_modal(self) -> bool:
    method get_key_bindings (line 351) | def get_key_bindings(self) -> KeyBindingsBase | None:
    method get_children (line 354) | def get_children(self) -> list[Container]:
    method _make_window_visible (line 357) | def _make_window_visible(
    method _draw_scrollbar (line 423) | def _draw_scrollbar(

FILE: src/prompt_toolkit/layout/utils.py
  class _ExplodedList (line 18) | class _ExplodedList(list[_T]):
    method append (line 28) | def append(self, item: _T) -> None:
    method extend (line 31) | def extend(self, lst: Iterable[_T]) -> None:
    method insert (line 34) | def insert(self, index: SupportsIndex, item: _T) -> None:
    method __setitem__ (line 40) | def __setitem__(self, index: SupportsIndex, value: _T) -> None: ...
    method __setitem__ (line 43) | def __setitem__(self, index: slice, value: Iterable[_T]) -> None: ...
    method __setitem__ (line 45) | def __setitem__(
  function explode_text_fragments (line 61) | def explode_text_fragments(fragments: Iterable[_T]) -> _ExplodedList[_T]:

FILE: src/prompt_toolkit/lexers/base.py
  class Lexer (line 20) | class Lexer(metaclass=ABCMeta):
    method lex_document (line 26) | def lex_document(self, document: Document) -> Callable[[int], StyleAnd...
    method invalidation_hash (line 36) | def invalidation_hash(self) -> Hashable:
  class SimpleLexer (line 44) | class SimpleLexer(Lexer):
    method __init__ (line 52) | def __init__(self, style: str = "") -> None:
    method lex_document (line 55) | def lex_document(self, document: Document) -> Callable[[int], StyleAnd...
  class DynamicLexer (line 68) | class DynamicLexer(Lexer):
    method __init__ (line 75) | def __init__(self, get_lexer: Callable[[], Lexer | None]) -> None:
    method lex_document (line 79) | def lex_document(self, document: Document) -> Callable[[int], StyleAnd...
    method invalidation_hash (line 83) | def invalidation_hash(self) -> Hashable:

FILE: src/prompt_toolkit/lexers/pygments.py
  class SyntaxSync (line 34) | class SyntaxSync(metaclass=ABCMeta):
    method get_sync_start_position (line 43) | def get_sync_start_position(
  class SyncFromStart (line 56) | class SyncFromStart(SyntaxSync):
    method get_sync_start_position (line 61) | def get_sync_start_position(
  class RegexSync (line 67) | class RegexSync(SyntaxSync):
    method __init__ (line 80) | def __init__(self, pattern: str) -> None:
    method get_sync_start_position (line 83) | def get_sync_start_position(
    method from_pygments_lexer_cls (line 108) | def from_pygments_lexer_cls(cls, lexer_cls: type[PygmentsLexerCls]) ->...
  class _TokenCache (line 127) | class _TokenCache(dict[tuple[str, ...], str]):
    method __missing__ (line 135) | def __missing__(self, key: tuple[str, ...]) -> str:
  class PygmentsLexer (line 144) | class PygmentsLexer(Lexer):
    method __init__ (line 181) | def __init__(
    method from_filename (line 201) | def from_filename(
    method lex_document (line 218) | def lex_document(self, document: Document) -> Callable[[int], StyleAnd...

FILE: src/prompt_toolkit/mouse_events.py
  class MouseEventType (line 28) | class MouseEventType(Enum):
  class MouseButton (line 44) | class MouseButton(Enum):
  class MouseModifier (line 58) | class MouseModifier(Enum):
  class MouseEvent (line 64) | class MouseEvent:
    method __init__ (line 72) | def __init__(
    method __repr__ (line 84) | def __repr__(self) -> str:

FILE: src/prompt_toolkit/output/base.py
  class Output (line 22) | class Output(metaclass=ABCMeta):
    method fileno (line 35) | def fileno(self) -> int:
    method encoding (line 39) | def encoding(self) -> str:
    method write (line 48) | def write(self, data: str) -> None:
    method write_raw (line 52) | def write_raw(self, data: str) -> None:
    method set_title (line 56) | def set_title(self, title: str) -> None:
    method clear_title (line 60) | def clear_title(self) -> None:
    method flush (line 64) | def flush(self) -> None:
    method erase_screen (line 68) | def erase_screen(self) -> None:
    method enter_alternate_screen (line 75) | def enter_alternate_screen(self) -> None:
    method quit_alternate_screen (line 79) | def quit_alternate_screen(self) -> None:
    method enable_mouse_support (line 83) | def enable_mouse_support(self) -> None:
    method disable_mouse_support (line 87) | def disable_mouse_support(self) -> None:
    method erase_end_of_line (line 91) | def erase_end_of_line(self) -> None:
    method erase_down (line 97) | def erase_down(self) -> None:
    method reset_attributes (line 104) | def reset_attributes(self) -> None:
    method set_attributes (line 108) | def set_attributes(self, attrs: Attrs, color_depth: ColorDepth) -> None:
    method disable_autowrap (line 112) | def disable_autowrap(self) -> None:
    method enable_autowrap (line 116) | def enable_autowrap(self) -> None:
    method cursor_goto (line 120) | def cursor_goto(self, row: int = 0, column: int = 0) -> None:
    method cursor_up (line 124) | def cursor_up(self, amount: int) -> None:
    method cursor_down (line 128) | def cursor_down(self, amount: int) -> None:
    method cursor_forward (line 132) | def cursor_forward(self, amount: int) -> None:
    method cursor_backward (line 136) | def cursor_backward(self, amount: int) -> None:
    method hide_cursor (line 140) | def hide_cursor(self) -> None:
    method show_cursor (line 144) | def show_cursor(self) -> None:
    method set_cursor_shape (line 148) | def set_cursor_shape(self, cursor_shape: CursorShape) -> None:
    method reset_cursor_shape (line 152) | def reset_cursor_shape(self) -> None:
    method ask_for_cpr (line 155) | def ask_for_cpr(self) -> None:
    method responds_to_cpr (line 162) | def responds_to_cpr(self) -> bool:
    method get_size (line 178) | def get_size(self) -> Size:
    method bell (line 181) | def bell(self) -> None:
    method enable_bracketed_paste (line 184) | def enable_bracketed_paste(self) -> None:
    method disable_bracketed_paste (line 187) | def disable_bracketed_paste(self) -> None:
    method reset_cursor_key_mode (line 190) | def reset_cursor_key_mode(self) -> None:
    method scroll_buffer_to_prompt (line 198) | def scroll_buffer_to_prompt(self) -> None:
    method get_rows_below_cursor_position (line 201) | def get_rows_below_cursor_position(self) -> int:
    method get_default_color_depth (line 206) | def get_default_color_depth(self) -> ColorDepth:
  class DummyOutput (line 223) | class DummyOutput(Output):
    method fileno (line 228) | def fileno(self) -> int:
    method encoding (line 232) | def encoding(self) -> str:
    method write (line 235) | def write(self, data: str) -> None:
    method write_raw (line 238) | def write_raw(self, data: str) -> None:
    method set_title (line 241) | def set_title(self, title: str) -> None:
    method clear_title (line 244) | def clear_title(self) -> None:
    method flush (line 247) | def flush(self) -> None:
    method erase_screen (line 250) | def erase_screen(self) -> None:
    method enter_alternate_screen (line 253) | def enter_alternate_screen(self) -> None:
    method quit_alternate_screen (line 256) | def quit_alternate_screen(self) -> None:
    method enable_mouse_support (line 259) | def enable_mouse_support(self) -> None:
    method disable_mouse_support (line 262) | def disable_mouse_support(self) -> None:
    method erase_end_of_line (line 265) | def erase_end_of_line(self) -> None:
    method erase_down (line 268) | def erase_down(self) -> None:
    method reset_attributes (line 271) | def reset_attributes(self) -> None:
    method set_attributes (line 274) | def set_attributes(self, attrs: Attrs, color_depth: ColorDepth) -> None:
    method disable_autowrap (line 277) | def disable_autowrap(self) -> None:
    method enable_autowrap (line 280) | def enable_autowrap(self) -> None:
    method cursor_goto (line 283) | def cursor_goto(self, row: int = 0, column: int = 0) -> None:
    method cursor_up (line 286) | def cursor_up(self, amount: int) -> None:
    method cursor_down (line 289) | def cursor_down(self, amount: int) -> None:
    method cursor_forward (line 292) | def cursor_forward(self, amount: int) -> None:
    method cursor_backward (line 295) | def cursor_backward(self, amount: int) -> None:
    method hide_cursor (line 298) | def hide_cursor(self) -> None:
    method show_cursor (line 301) | def show_cursor(self) -> None:
    method set_cursor_shape (line 304) | def set_cursor_shape(self, cursor_shape: CursorShape) -> None:
    method reset_cursor_shape (line 307) | def reset_cursor_shape(self) -> None:
    method ask_for_cpr (line 310) | def ask_for_cpr(self) -> None:
    method bell (line 313) | def bell(self) -> None:
    method enable_bracketed_paste (line 316) | def enable_bracketed_paste(self) -> None:
    method disable_bracketed_paste (line 319) | def disable_bracketed_paste(self) -> None:
    method scroll_buffer_to_prompt (line 322) | def scroll_buffer_to_prompt(self) -> None:
    method get_size (line 325) | def get_size(self) -> Size:
    method get_rows_below_cursor_position (line 328) | def get_rows_below_cursor_position(self) -> int:
    method get_default_color_depth (line 331) | def get_default_color_depth(self) -> ColorDepth:

FILE: src/prompt_toolkit/output/color_depth.py
  class ColorDepth (line 11) | class ColorDepth(str, Enum):
    method from_env (line 37) | def from_env(cls) -> ColorDepth | None:
    method default (line 58) | def default(cls) -> ColorDepth:

FILE: src/prompt_toolkit/output/conemu.py
  class ConEmuOutput (line 21) | class ConEmuOutput:
    method __init__ (line 37) | def __init__(
    method responds_to_cpr (line 46) | def responds_to_cpr(self) -> bool:
    method __getattr__ (line 49) | def __getattr__(self, name: str) -> Any:

FILE: src/prompt_toolkit/output/defaults.py
  function create_output (line 25) | def create_output(

FILE: src/prompt_toolkit/output/flush_stdout.py
  function flush_stdout (line 13) | def flush_stdout(stdout: TextIO, data: str) -> None:
  function _blocking_io (line 58) | def _blocking_io(io: IO[str]) -> Iterator[None]:

FILE: src/prompt_toolkit/output/plain_text.py
  class PlainTextOutput (line 16) | class PlainTextOutput(Output):
    method __init__ (line 28) | def __init__(self, stdout: TextIO) -> None:
    method fileno (line 34) | def fileno(self) -> int:
    method encoding (line 38) | def encoding(self) -> str:
    method write (line 41) | def write(self, data: str) -> None:
    method write_raw (line 44) | def write_raw(self, data: str) -> None:
    method set_title (line 47) | def set_title(self, title: str) -> None:
    method clear_title (line 50) | def clear_title(self) -> None:
    method flush (line 53) | def flush(self) -> None:
    method erase_screen (line 61) | def erase_screen(self) -> None:
    method enter_alternate_screen (line 64) | def enter_alternate_screen(self) -> None:
    method quit_alternate_screen (line 67) | def quit_alternate_screen(self) -> None:
    method enable_mouse_support (line 70) | def enable_mouse_support(self) -> None:
    method disable_mouse_support (line 73) | def disable_mouse_support(self) -> None:
    method erase_end_of_line (line 76) | def erase_end_of_line(self) -> None:
    method erase_down (line 79) | def erase_down(self) -> None:
    method reset_attributes (line 82) | def reset_attributes(self) -> None:
    method set_attributes (line 85) | def set_attributes(self, attrs: Attrs, color_depth: ColorDepth) -> None:
    method disable_autowrap (line 88) | def disable_autowrap(self) -> None:
    method enable_autowrap (line 91) | def enable_autowrap(self) -> None:
    method cursor_goto (line 94) | def cursor_goto(self, row: int = 0, column: int = 0) -> None:
    method cursor_up (line 97) | def cursor_up(self, amount: int) -> None:
    method cursor_down (line 100) | def cursor_down(self, amount: int) -> None:
    method cursor_forward (line 103) | def cursor_forward(self, amount: int) -> None:
    method cursor_backward (line 106) | def cursor_backward(self, amount: int) -> None:
    method hide_cursor (line 109) | def hide_cursor(self) -> None:
    method show_cursor (line 112) | def show_cursor(self) -> None:
    method set_cursor_shape (line 115) | def set_cursor_shape(self, cursor_shape: CursorShape) -> None:
    method reset_cursor_shape (line 118) | def reset_cursor_shape(self) -> None:
    method ask_for_cpr (line 121) | def ask_for_cpr(self) -> None:
    method bell (line 124) | def bell(self) -> None:
    method enable_bracketed_paste (line 127) | def enable_bracketed_paste(self) -> None:
    method disable_bracketed_paste (line 130) | def disable_bracketed_paste(self) -> None:
    method scroll_buffer_to_prompt (line 133) | def scroll_buffer_to_prompt(self) -> None:
    method get_size (line 136) | def get_size(self) -> Size:
    method get_rows_below_cursor_position (line 139) | def get_rows_below_cursor_position(self) -> int:
    method get_default_color_depth (line 142) | def get_default_color_depth(self) -> ColorDepth:

FILE: src/prompt_toolkit/output/vt100.py
  function _get_closest_ansi_color (line 109) | def _get_closest_ansi_color(r: int, g: int, b: int, exclude: Sequence[st...
  class _16ColorCache (line 146) | class _16ColorCache:
    method __init__ (line 153) | def __init__(self, bg: bool = False) -> None:
    method get_code (line 157) | def get_code(
    method _get (line 172) | def _get(
  class _256ColorCache (line 187) | class _256ColorCache(dict[tuple[int, int, int], int]):
    method __init__ (line 192) | def __init__(self) -> None:
    method __missing__ (line 230) | def __missing__(self, value: tuple[int, int, int]) -> int:
  class _EscapeCodeCache (line 258) | class _EscapeCodeCache(dict[Attrs, str]):
    method __init__ (line 267) | def __init__(self, color_depth: ColorDepth) -> None:
    method __missing__ (line 270) | def __missing__(self, attrs: Attrs) -> str:
    method _color_name_to_rgb (line 312) | def _color_name_to_rgb(self, color: str) -> tuple[int, int, int]:
    method _colors_to_code (line 324) | def _colors_to_code(self, fg_color: str, bg_color: str) -> Iterable[str]:
  function _get_size (line 382) | def _get_size(fileno: int) -> tuple[int, int]:
  class Vt100_Output (line 393) | class Vt100_Output(Output):
    method __init__ (line 411) | def __init__(
    method from_pty (line 449) | def from_pty(
    method get_size (line 501) | def get_size(self) -> Size:
    method fileno (line 504) | def fileno(self) -> int:
    method encoding (line 508) | def encoding(self) -> str:
    method write_raw (line 512) | def write_raw(self, data: str) -> None:
    method write (line 518) | def write(self, data: str) -> None:
    method set_title (line 525) | def set_title(self, title: str) -> None:
    method clear_title (line 537) | def clear_title(self) -> None:
    method erase_screen (line 540) | def erase_screen(self) -> None:
    method enter_alternate_screen (line 547) | def enter_alternate_screen(self) -> None:
    method quit_alternate_screen (line 550) | def quit_alternate_screen(self) -> None:
    method enable_mouse_support (line 553) | def enable_mouse_support(self) -> None:
    method disable_mouse_support (line 568) | def disable_mouse_support(self) -> None:
    method erase_end_of_line (line 574) | def erase_end_of_line(self) -> None:
    method erase_down (line 580) | def erase_down(self) -> None:
    method reset_attributes (line 587) | def reset_attributes(self) -> None:
    method set_attributes (line 590) | def set_attributes(self, attrs: Attrs, color_depth: ColorDepth) -> None:
    method disable_autowrap (line 602) | def disable_autowrap(self) -> None:
    method enable_autowrap (line 605) | def enable_autowrap(self) -> None:
    method enable_bracketed_paste (line 608) | def enable_bracketed_paste(self) -> None:
    method disable_bracketed_paste (line 611) | def disable_bracketed_paste(self) -> None:
    method reset_cursor_key_mode (line 614) | def reset_cursor_key_mode(self) -> None:
    method cursor_goto (line 622) | def cursor_goto(self, row: int = 0, column: int = 0) -> None:
    method cursor_up (line 628) | def cursor_up(self, amount: int) -> None:
    method cursor_down (line 636) | def cursor_down(self, amount: int) -> None:
    method cursor_forward (line 646) | def cursor_forward(self, amount: int) -> None:
    method cursor_backward (line 654) | def cursor_backward(self, amount: int) -> None:
    method hide_cursor (line 662) | def hide_cursor(self) -> None:
    method show_cursor (line 667) | def show_cursor(self) -> None:
    method set_cursor_shape (line 672) | def set_cursor_shape(self, cursor_shape: CursorShape) -> None:
    method reset_cursor_shape (line 688) | def reset_cursor_shape(self) -> None:
    method flush (line 697) | def flush(self) -> None:
    method ask_for_cpr (line 709) | def ask_for_cpr(self) -> None:
    method responds_to_cpr (line 717) | def responds_to_cpr(self) -> bool:
    method bell (line 733) | def bell(self) -> None:
    method get_default_color_depth (line 739) | def get_default_color_depth(self) -> ColorDepth:

FILE: src/prompt_toolkit/output/win32.py
  function _coord_byval (line 40) | def _coord_byval(coord: COORD) -> c_long:
  class NoConsoleScreenBufferError (line 65) | class NoConsoleScreenBufferError(Exception):
    method __init__ (line 71) | def __init__(self) -> None:
  class Win32Output (line 91) | class Win32Output(Output):
    method __init__ (line 97) | def __init__(
    method fileno (line 122) | def fileno(self) -> int:
    method encoding (line 126) | def encoding(self) -> str:
    method write (line 130) | def write(self, data: str) -> None:
    method write_raw (line 136) | def write_raw(self, data: str) -> None:
    method get_size (line 140) | def get_size(self) -> Size:
    method _winapi (line 160) | def _winapi(self, func: Callable[..., _T], *a: object, **kw: object) -...
    method get_win32_screen_buffer_info (line 186) | def get_win32_screen_buffer_info(self) -> CONSOLE_SCREEN_BUFFER_INFO:
    method set_title (line 222) | def set_title(self, title: str) -> None:
    method clear_title (line 228) | def clear_title(self) -> None:
    method erase_screen (line 231) | def erase_screen(self) -> None:
    method erase_down (line 239) | def erase_down(self) -> None:
    method erase_end_of_line (line 248) | def erase_end_of_line(self) -> None:
    method _erase (line 256) | def _erase(self, start: COORD, length: int) -> None:
    method reset_attributes (line 279) | def reset_attributes(self) -> None:
    method set_attributes (line 286) | def set_attributes(self, attrs: Attrs, color_depth: ColorDepth) -> None:
    method disable_autowrap (line 325) | def disable_autowrap(self) -> None:
    method enable_autowrap (line 329) | def enable_autowrap(self) -> None:
    method cursor_goto (line 333) | def cursor_goto(self, row: int = 0, column: int = 0) -> None:
    method cursor_up (line 339) | def cursor_up(self, amount: int) -> None:
    method cursor_down (line 346) | def cursor_down(self, amount: int) -> None:
    method cursor_forward (line 349) | def cursor_forward(self, amount: int) -> None:
    method cursor_backward (line 358) | def cursor_backward(self, amount: int) -> None:
    method flush (line 361) | def flush(self) -> None:
    method get_rows_below_cursor_position (line 391) | def get_rows_below_cursor_position(self) -> int:
    method scroll_buffer_to_prompt (line 395) | def scroll_buffer_to_prompt(self) -> None:
    method enter_alternate_screen (line 425) | def enter_alternate_screen(self) -> None:
    method quit_alternate_screen (line 449) | def quit_alternate_screen(self) -> None:
    method enable_mouse_support (line 462) | def enable_mouse_support(self) -> None:
    method disable_mouse_support (line 480) | def disable_mouse_support(self) -> None:
    method hide_cursor (line 492) | def hide_cursor(self) -> None:
    method show_cursor (line 495) | def show_cursor(self) -> None:
    method set_cursor_shape (line 498) | def set_cursor_shape(self, cursor_shape: CursorShape) -> None:
    method reset_cursor_shape (line 501) | def reset_cursor_shape(self) -> None:
    method win32_refresh_window (line 505) | def win32_refresh_window(cls) -> None:
    method get_default_color_depth (line 519) | def get_default_color_depth(self) -> ColorDepth:
  class FOREGROUND_COLOR (line 532) | class FOREGROUND_COLOR:
  class BACKGROUND_COLOR (line 544) | class BACKGROUND_COLOR:
  function _create_ansi_color_dict (line 556) | def _create_ansi_color_dict(
  class ColorLookupTable (line 590) | class ColorLookupTable:
    method __init__ (line 595) | def __init__(self) -> None:
    method _build_color_table (line 602) | def _build_color_table() -> list[tuple[int, int, int, int, int]]:
    method _closest_color (line 628) | def _closest_color(self, r: int, g: int, b: int) -> tuple[int, int]:
    method _color_indexes (line 646) | def _color_indexes(self, color: str) -> tuple[int, int]:
    method lookup_fg_color (line 661) | def lookup_fg_color(self, fg_color: str) -> int:
    method lookup_bg_color (line 674) | def lookup_bg_color(self, bg_color: str) -> int:

FILE: src/prompt_toolkit/output/windows10.py
  class Windows10_Output (line 28) | class Windows10_Output:
    method __init__ (line 33) | def __init__(
    method flush (line 43) | def flush(self) -> None:
    method responds_to_cpr (line 65) | def responds_to_cpr(self) -> bool:
    method __getattr__ (line 68) | def __getattr__(self, name: str) -> Any:
    method get_default_color_depth (line 88) | def get_default_color_depth(self) -> ColorDepth:
  function is_win_vt100_enabled (line 111) | def is_win_vt100_enabled() -> bool:

FILE: src/prompt_toolkit/patch_stdout.py
  function patch_stdout (line 42) | def patch_stdout(raw: bool = False) -> Generator[None, None, None]:
  class _Done (line 77) | class _Done:
  class StdoutProxy (line 81) | class StdoutProxy:
    method __init__ (line 99) | def __init__(
    method __enter__ (line 126) | def __enter__(self) -> StdoutProxy:
    method __exit__ (line 129) | def __exit__(self, *args: object) -> None:
    method close (line 132) | def close(self) -> None:
    method _start_write_thread (line 144) | def _start_write_thread(self) -> threading.Thread:
    method _write_thread (line 153) | def _write_thread(self) -> None:
    method _get_app_loop (line 190) | def _get_app_loop(self) -> asyncio.AbstractEventLoop | None:
    method _write_and_flush (line 202) | def _write_and_flush(
    method _write (line 238) | def _write(self, data: str) -> None:
    method _flush (line 261) | def _flush(self) -> None:
    method write (line 266) | def write(self, data: str) -> int:
    method flush (line 272) | def flush(self) -> None:
    method original_stdout (line 280) | def original_stdout(self) -> TextIO | None:
    method fileno (line 285) | def fileno(self) -> int:
    method isatty (line 288) | def isatty(self) -> bool:
    method encoding (line 296) | def encoding(self) -> str:
    method errors (line 300) | def errors(self) -> str:

FILE: src/prompt_toolkit/renderer.py
  function _output_screen_diff (line 40) | def _output_screen_diff(
  class HeightIsUnknownError (line 267) | class HeightIsUnknownError(Exception):
  class _StyleStringToAttrsCache (line 271) | class _StyleStringToAttrsCache(dict[str, Attrs]):
    method __init__ (line 277) | def __init__(
    method __missing__ (line 285) | def __missing__(self, style_str: str) -> Attrs:
  class _StyleStringHasStyleCache (line 293) | class _StyleStringHasStyleCache(dict[str, bool]):
    method __init__ (line 304) | def __init__(self, style_string_to_attrs: dict[str, Attrs]) -> None:
    method __missing__ (line 307) | def __missing__(self, style_str: str) -> bool:
  class CPR_Support (line 322) | class CPR_Support(Enum):
  class Renderer (line 330) | class Renderer:
    method __init__ (line 343) | def __init__(
    method reset (line 383) | def reset(self, _scroll: bool = False, leave_alternate_screen: bool = ...
    method last_rendered_screen (line 433) | def last_rendered_screen(self) -> Screen | None:
    method height_is_known (line 441) | def height_is_known(self) -> bool:
    method rows_above_layout (line 456) | def rows_above_layout(self) -> int:
    method request_absolute_cursor_position (line 469) | def request_absolute_cursor_position(self) -> None:
    method report_absolute_cursor_row (line 530) | def report_absolute_cursor_row(self, row: int) -> None:
    method waiting_for_cpr (line 554) | def waiting_for_cpr(self) -> bool:
    method wait_for_cpr_responses (line 561) | async def wait_for_cpr_responses(self, timeout: int = 1) -> None:
    method render (line 591) | def render(
    method erase (line 735) | def erase(self, leave_alternate_screen: bool = True) -> None:
    method clear (line 756) | def clear(self) -> None:
  function print_formatted_text (line 773) | def print_formatted_text(

FILE: src/prompt_toolkit/search.py
  class SearchDirection (line 29) | class SearchDirection(Enum):
  class SearchState (line 34) | class SearchState:
    method __init__ (line 52) | def __init__(
    method __repr__ (line 62) | def __repr__(self) -> str:
    method __invert__ (line 65) | def __invert__(self) -> SearchState:
  function start_search (line 80) | def start_search(
  function stop_search (line 119) | def stop_search(buffer_control: BufferControl | None = None) -> None:
  function do_incremental_search (line 150) | def do_incremental_search(direction: SearchDirection, count: int = 1) ->...
  function accept_search (line 183) | def accept_search() -> None:
  function _get_reverse_search_links (line 217) | def _get_reverse_search_links(

FILE: src/prompt_toolkit/selection.py
  class SelectionType (line 16) | class SelectionType(Enum):
  class PasteMode (line 31) | class PasteMode(Enum):
  class SelectionState (line 37) | class SelectionState:
    method __init__ (line 45) | def __init__(
    method enter_shift_mode (line 54) | def enter_shift_mode(self) -> None:
    method __repr__ (line 57) | def __repr__(self) -> str:

FILE: src/prompt_toolkit/shortcuts/choice_input.py
  function create_default_choice_input_style (line 44) | def create_default_choice_input_style() -> BaseStyle:
  class ChoiceInput (line 53) | class ChoiceInput(Generic[_T]):
    method __init__ (line 91) | def __init__(
    method _create_application (line 123) | def _create_application(self) -> Application[_T]:
    method prompt (line 242) | def prompt(self) -> _T:
    method prompt_async (line 245) | async def prompt_async(self) -> _T:
  function choice (line 249) | def choice(

FILE: src/prompt_toolkit/shortcuts/dialogs.py
  function yes_no_dialog (line 45) | def yes_no_dialog(
  function button_dialog (line 79) | def button_dialog(
  function input_dialog (line 106) | def input_dialog(
  function message_dialog (line 158) | def message_dialog(
  function radiolist_dialog (line 177) | def radiolist_dialog(
  function checkboxlist_dialog (line 216) | def checkboxlist_dialog(
  function progress_dialog (line 255) | def progress_dialog(
  function _create_app (line 314) | def _create_app(dialog: AnyContainer, style: BaseStyle | None) -> Applic...
  function _return_none (line 329) | def _return_none() -> None:

FILE: src/prompt_toolkit/shortcuts/progress_bar/base.py
  function create_key_bindings (line 62) | def create_key_bindings(cancel_callback: Callable[[], None] | None) -> K...
  class ProgressBar (line 87) | class ProgressBar:
    method __init__ (line 114) | def __init__(
    method __enter__ (line 156) | def __enter__(self) -> ProgressBar:
    method __exit__ (line 233) | def __exit__(self, *a: object) -> None:
    method __call__ (line 246) | def __call__(
    method invalidate (line 268) | def invalidate(self) -> None:
  class _ProgressControl (line 272) | class _ProgressControl(UIControl):
    method __init__ (line 277) | def __init__(
    method create_content (line 287) | def create_content(self, width: int, height: int) -> UIContent:
    method is_focusable (line 304) | def is_focusable(self) -> bool:
    method get_key_bindings (line 307) | def get_key_bindings(self) -> KeyBindings:
  class ProgressBarCounter (line 314) | class ProgressBarCounter(Generic[_CounterItem]):
    method __init__ (line 319) | def __init__(
    method __iter__ (line 345) | def __iter__(self) -> Iterator[_CounterItem]:
    method item_completed (line 361) | def item_completed(self) -> None:
    method done (line 371) | def done(self) -> bool:
    method done (line 383) | def done(self, value: bool) -> None:
    method stopped (line 391) | def stopped(self) -> bool:
    method stopped (line 409) | def stopped(self, value: bool) -> None:
    method percentage (line 419) | def percentage(self) -> float:
    method time_elapsed (line 426) | def time_elapsed(self) -> datetime.timedelta:
    method time_left (line 436) | def time_left(self) -> datetime.timedelta | None:

FILE: src/prompt_toolkit/shortcuts/progress_bar/formatters.py
  class Formatter (line 43) | class Formatter(metaclass=ABCMeta):
    method format (line 49) | def format(
    method get_width (line 57) | def get_width(self, progress_bar: ProgressBar) -> AnyDimension:
  class Text (line 61) | class Text(Formatter):
    method __init__ (line 66) | def __init__(self, text: AnyFormattedText, style: str = "") -> None:
    method format (line 69) | def format(
    method get_width (line 77) | def get_width(self, progress_bar: ProgressBar) -> AnyDimension:
  class Label (line 81) | class Label(Formatter):
    method __init__ (line 91) | def __init__(self, width: AnyDimension = None, suffix: str = "") -> None:
    method _add_suffix (line 95) | def _add_suffix(self, label: AnyFormattedText) -> StyleAndTextTuples:
    method format (line 99) | def format(
    method get_width (line 117) | def get_width(self, progress_bar: ProgressBar) -> AnyDimension:
  class Percentage (line 129) | class Percentage(Formatter):
    method format (line 136) | def format(
    method get_width (line 144) | def get_width(self, progress_bar: ProgressBar) -> AnyDimension:
  class Bar (line 148) | class Bar(Formatter):
    method __init__ (line 157) | def __init__(
    method format (line 176) | def format(
    method get_width (line 212) | def get_width(self, progress_bar: ProgressBar) -> AnyDimension:
  class Progress (line 216) | class Progress(Formatter):
    method format (line 223) | def format(
    method get_width (line 233) | def get_width(self, progress_bar: ProgressBar) -> AnyDimension:
  function _format_timedelta (line 241) | def _format_timedelta(timedelta: datetime.timedelta) -> str:
  class TimeElapsed (line 251) | class TimeElapsed(Formatter):
    method format (line 258) | def format(
    method get_width (line 267) | def get_width(self, progress_bar: ProgressBar) -> AnyDimension:
  class TimeLeft (line 276) | class TimeLeft(Formatter):
    method format (line 284) | def format(
    method get_width (line 298) | def get_width(self, progress_bar: ProgressBar) -> AnyDimension:
  class IterationsPerSecond (line 308) | class IterationsPerSecond(Formatter):
    method format (line 317) | def format(
    method get_width (line 326) | def get_width(self, progress_bar: ProgressBar) -> AnyDimension:
  class SpinningWheel (line 336) | class SpinningWheel(Formatter):
    method format (line 344) | def format(
    method get_width (line 353) | def get_width(self, progress_bar: ProgressBar) -> AnyDimension:
  function _hue_to_rgb (line 357) | def _hue_to_rgb(hue: float) -> tuple[int, int, int]:
  class Rainbow (line 379) | class Rainbow(Formatter):
    method __init__ (line 386) | def __init__(self, formatter: Formatter) -> None:
    method format (line 389) | def format(
    method get_width (line 410) | def get_width(self, progress_bar: ProgressBar) -> AnyDimension:
  function create_default_formatters (line 414) | def create_default_formatters() -> list[Formatter]:

FILE: src/prompt_toolkit/shortcuts/prompt.py
  function _split_multiline_prompt (line 150) | def _split_multiline_prompt(
  class _RPrompt (line 190) | class _RPrompt(Window):
    method __init__ (line 195) | def __init__(self, text: AnyFormattedText) -> None:
  class CompleteStyle (line 203) | class CompleteStyle(str, Enum):
  class PromptSession (line 228) | class PromptSession(Generic[_T]):
    method __init__ (line 379) | def __init__(
    method _dyncond (line 486) | def _dyncond(self, attr_name: str) -> Condition:
    method _create_default_buffer (line 503) | def _create_default_buffer(self) -> Buffer:
    method _create_search_buffer (line 547) | def _create_search_buffer(self) -> Buffer:
    method _create_layout (line 550) | def _create_layout(self) -> Layout:
    method _create_application (line 739) | def _create_application(
    method _create_prompt_bindings (line 816) | def _create_prompt_bindings(self) -> KeyBindings:
    method prompt (line 880) | def prompt(
    method _dumb_prompt (line 1072) | def _dumb_prompt(self, message: AnyFormattedText = "") -> Iterator[App...
    method prompt_async (line 1120) | async def prompt_async(
    method _add_pre_run_callables (line 1265) | def _add_pre_run_callables(
    method editing_mode (line 1282) | def editing_mode(self) -> EditingMode:
    method editing_mode (line 1286) | def editing_mode(self, value: EditingMode) -> None:
    method _get_default_buffer_control_height (line 1289) | def _get_default_buffer_control_height(self) -> Dimension:
    method _get_prompt (line 1311) | def _get_prompt(self) -> StyleAndTextTuples:
    method _get_continuation (line 1314) | def _get_continuation(
    method _get_line_prefix (line 1341) | def _get_line_prefix(
    method _get_arg_text (line 1362) | def _get_arg_text(self) -> StyleAndTextTuples:
    method _inline_arg (line 1374) | def _inline_arg(self) -> StyleAndTextTuples:
    method input (line 1392) | def input(self) -> Input:
    method output (line 1396) | def output(self) -> Output:
  function prompt (line 1400) | def prompt(
  function create_confirm_session (line 1510) | def create_confirm_session(
  function confirm (line 1542) | def confirm(message: AnyFormattedText = "Confirm?", suffix: str = " (y/n...

FILE: src/prompt_toolkit/shortcuts/utils.py
  function print_formatted_text (line 41) | def print_formatted_text(
  function print_container (line 167) | def print_container(
  function _create_merged_style (line 202) | def _create_merged_style(
  function clear (line 217) | def clear() -> None:
  function set_title (line 227) | def set_title(text: str) -> None:
  function clear_title (line 235) | def clear_title() -> None:

FILE: src/prompt_toolkit/styles/base.py
  class Attrs (line 23) | class Attrs(NamedTuple):
  class BaseStyle (line 113) | class BaseStyle(metaclass=ABCMeta):
    method get_attrs_for_style_str (line 119) | def get_attrs_for_style_str(
    method style_rules (line 132) | def style_rules(self) -> list[tuple[str, str]]:
    method invalidation_hash (line 140) | def invalidation_hash(self) -> Hashable:
  class DummyStyle (line 148) | class DummyStyle(BaseStyle):
    method get_attrs_for_style_str (line 153) | def get_attrs_for_style_str(
    method invalidation_hash (line 158) | def invalidation_hash(self) -> Hashable:
    method style_rules (line 162) | def style_rules(self) -> list[tuple[str, str]]:
  class DynamicStyle (line 166) | class DynamicStyle(BaseStyle):
    method __init__ (line 173) | def __init__(self, get_style: Callable[[], BaseStyle | None]):
    method get_attrs_for_style_str (line 177) | def get_attrs_for_style_str(
    method invalidation_hash (line 184) | def invalidation_hash(self) -> Hashable:
    method style_rules (line 188) | def style_rules(self) -> list[tuple[str, str]]:

FILE: src/prompt_toolkit/styles/defaults.py
  function default_ui_style (line 218) | def default_ui_style() -> BaseStyle:
  function default_pygments_style (line 232) | def default_pygments_style() -> Style:

FILE: src/prompt_toolkit/styles/pygments.py
  function style_from_pygments_cls (line 28) | def style_from_pygments_cls(pygments_style_cls: type[PygmentsStyle]) -> ...
  function style_from_pygments_dict (line 49) | def style_from_pygments_dict(pygments_dict: dict[Token, str]) -> Style:
  function pygments_token_to_classname (line 62) | def pygments_token_to_classname(token: Token) -> str:

FILE: src/prompt_toolkit/styles/style.py
  function parse_color (line 34) | def parse_color(text: str) -> str:
  function _expand_classname (line 96) | def _expand_classname(classname: str) -> list[str]:
  function _parse_style_str (line 111) | def _parse_style_str(style_str: str) -> Attrs:
  class Priority (line 186) | class Priority(Enum):
  class Style (line 212) | class Style(BaseStyle):
    method __init__ (line 234) | def __init__(self, style_rules: list[tuple[str, str]]) -> None:
    method style_rules (line 253) | def style_rules(self) -> list[tuple[str, str]]:
    method from_dict (line 257) | def from_dict(
    method get_attrs_for_style_str (line 274) | def get_attrs_for_style_str(
    method invalidation_hash (line 323) | def invalidation_hash(self) -> Hashable:
  function _merge_attrs (line 330) | def _merge_attrs(list_of_attrs: list[Attrs]) -> Attrs:
  function merge_styles (line 358) | def merge_styles(styles: list[BaseStyle]) -> _MergedStyle:
  class _MergedStyle (line 366) | class _MergedStyle(BaseStyle):
    method __init__ (line 382) | def __init__(self, styles: list[BaseStyle]) -> None:
    method _merged_style (line 387) | def _merged_style(self) -> Style:
    method style_rules (line 396) | def style_rules(self) -> list[tuple[str, str]]:
    method get_attrs_for_style_str (line 402) | def get_attrs_for_style_str(
    method invalidation_hash (line 407) | def invalidation_hash(self) -> Hashable:

FILE: src/prompt_toolkit/styles/style_transformation.py
  class StyleTransformation (line 39) | class StyleTransformation(metaclass=ABCMeta):
    method transform_attrs (line 45) | def transform_attrs(self, attrs: Attrs) -> Attrs:
    method invalidation_hash (line 53) | def invalidation_hash(self) -> Hashable:
  class SwapLightAndDarkStyleTransformation (line 60) | class SwapLightAndDarkStyleTransformation(StyleTransformation):
    method transform_attrs (line 78) | def transform_attrs(self, attrs: Attrs) -> Attrs:
  class ReverseStyleTransformation (line 89) | class ReverseStyleTransformation(StyleTransformation):
    method transform_attrs (line 96) | def transform_attrs(self, attrs: Attrs) -> Attrs:
  class SetDefaultColorStyleTransformation (line 100) | class SetDefaultColorStyleTransformation(StyleTransformation):
    method __init__ (line 110) | def __init__(
    method transform_attrs (line 116) | def transform_attrs(self, attrs: Attrs) -> Attrs:
    method invalidation_hash (line 125) | def invalidation_hash(self) -> Hashable:
  class AdjustBrightnessStyleTransformation (line 133) | class AdjustBrightnessStyleTransformation(StyleTransformation):
    method __init__ (line 157) | def __init__(
    method transform_attrs (line 163) | def transform_attrs(self, attrs: Attrs) -> Attrs:
    method _color_to_rgb (line 192) | def _color_to_rgb(self, color: str) -> tuple[float, float, float]:
    method _interpolate_brightness (line 215) | def _interpolate_brightness(
    method invalidation_hash (line 223) | def invalidation_hash(self) -> Hashable:
  class DummyStyleTransformation (line 231) | class DummyStyleTransformation(StyleTransformation):
    method transform_attrs (line 236) | def transform_attrs(self, attrs: Attrs) -> Attrs:
    method invalidation_hash (line 239) | def invalidation_hash(self) -> Hashable:
  class DynamicStyleTransformation (line 244) | class DynamicStyleTransformation(StyleTransformation):
    method __init__ (line 253) | def __init__(
    method transform_attrs (line 258) | def transform_attrs(self, attrs: Attrs) -> Attrs:
    method invalidation_hash (line 264) | def invalidation_hash(self) -> Hashable:
  class ConditionalStyleTransformation (line 271) | class ConditionalStyleTransformation(StyleTransformation):
    method __init__ (line 276) | def __init__(
    method transform_attrs (line 282) | def transform_attrs(self, attrs: Attrs) -> Attrs:
    method invalidation_hash (line 287) | def invalidation_hash(self) -> Hashable:
  class _MergedStyleTransformation (line 291) | class _MergedStyleTransformation(StyleTransformation):
    method __init__ (line 292) | def __init__(self, style_transformations: Sequence[StyleTransformation...
    method transform_attrs (line 295) | def transform_attrs(self, attrs: Attrs) -> Attrs:
    method invalidation_hash (line 300) | def invalidation_hash(self) -> Hashable:
  function merge_style_transformations (line 304) | def merge_style_transformations(
  function get_opposite_color (line 340) | def get_opposite_color(colorname: str | None) -> str | None:

FILE: src/prompt_toolkit/utils.py
  class Event (line 42) | class Event(Generic[_Sender]):
    method __init__ (line 63) | def __init__(
    method __call__ (line 72) | def __call__(self) -> None:
    method fire (line 77) | def fire(self) -> None:
    method add_handler (line 81) | def add_handler(self, handler: Callable[[_Sender], None]) -> None:
    method remove_handler (line 90) | def remove_handler(self, handler: Callable[[_Sender], None]) -> None:
    method __iadd__ (line 97) | def __iadd__(self, handler: Callable[[_Sender], None]) -> Event[_Sender]:
    method __isub__ (line 104) | def __isub__(self, handler: Callable[[_Sender], None]) -> Event[_Sender]:
  class DummyContext (line 112) | class DummyContext(AbstractContextManager[None]):
    method __enter__ (line 117) | def __enter__(self) -> None:
    method __exit__ (line 120) | def __exit__(self, *a: object) -> None:
  class _CharSizesCache (line 124) | class _CharSizesCache(dict[str, int]):
    method __init__ (line 132) | def __init__(self) -> None:
    method __missing__ (line 137) | def __missing__(self, string: str) -> int:
  function get_cwidth (line 168) | def get_cwidth(string: str) -> int:
  function suspend_to_background_supported (line 175) | def suspend_to_background_supported() -> bool:
  function is_windows (line 183) | def is_windows() -> bool:
  function is_windows_vt100_supported (line 190) | def is_windows_vt100_supported() -> bool:
  function is_conemu_ansi (line 203) | def is_conemu_ansi() -> bool:
  function in_main_thread (line 210) | def in_main_thread() -> bool:
  function get_bell_environment_variable (line 217) | def get_bell_environment_variable() -> bool:
  function get_term_environment_variable (line 225) | def get_term_environment_variable() -> str:
  function take_using_weights (line 233) | def take_using_weights(
  function to_str (line 287) | def to_str(value: Callable[[], str] | str) -> str:
  function to_int (line 295) | def to_int(value: Callable[[], int] | int) -> int:
  function to_float (line 306) | def to_float(value: AnyFloat) -> float:
  function is_dumb_terminal (line 314) | def is_dumb_terminal(term: str | None = None) -> bool:

FILE: src/prompt_toolkit/validation.py
  class ValidationError (line 26) | class ValidationError(Exception):
    method __init__ (line 34) | def __init__(self, cursor_position: int = 0, message: str = "") -> None:
    method __repr__ (line 39) | def __repr__(self) -> str:
  class Validator (line 43) | class Validator(metaclass=ABCMeta):
    method validate (line 57) | def validate(self, document: Document) -> None:
    method validate_async (line 66) | async def validate_async(self, document: Document) -> None:
    method from_callable (line 78) | def from_callable(
  class _ValidatorFromCallable (line 102) | class _ValidatorFromCallable(Validator):
    method __init__ (line 107) | def __init__(
    method __repr__ (line 114) | def __repr__(self) -> str:
    method validate (line 117) | def validate(self, document: Document) -> None:
  class ThreadedValidator (line 127) | class ThreadedValidator(Validator):
    method __init__ (line 134) | def __init__(self, validator: Validator) -> None:
    method validate (line 137) | def validate(self, document: Document) -> None:
    method validate_async (line 140) | async def validate_async(self, document: Document) -> None:
  class DummyValidator (line 151) | class DummyValidator(Validator):
    method validate (line 156) | def validate(self, document: Document) -> None:
  class ConditionalValidator (line 160) | class ConditionalValidator(Validator):
    method __init__ (line 166) | def __init__(self, validator: Validator, filter: FilterOrBool) -> None:
    method validate (line 170) | def validate(self, document: Document) -> None:
  class DynamicValidator (line 176) | class DynamicValidator(Validator):
    method __init__ (line 183) | def __init__(self, get_validator: Callable[[], Validator | None]) -> N...
    method validate (line 186) | def validate(self, document: Document) -> None:
    method validate_async (line 190) | async def validate_async(self, document: Document) -> None:

FILE: src/prompt_toolkit/widgets/base.py
  class Border (line 102) | class Border:
  class TextArea (line 113) | class TextArea:
    method __init__ (line 174) | def __init__(
    method text (line 289) | def text(self) -> str:
    method text (line 296) | def text(self, value: str) -> None:
    method document (line 300) | def document(self) -> Document:
    method document (line 307) | def document(self, value: Document) -> None:
    method accept_handler (line 311) | def accept_handler(self) -> BufferAcceptHandler | None:
    method accept_handler (line 318) | def accept_handler(self, value: BufferAcceptHandler) -> None:
    method __pt_container__ (line 321) | def __pt_container__(self) -> Container:
  class Label (line 325) | class Label:
    method __init__ (line 344) | def __init__(
    method __pt_container__ (line 383) | def __pt_container__(self) -> Container:
  class Button (line 387) | class Button:
    method __init__ (line 398) | def __init__(
    method _get_text_fragments (line 439) | def _get_text_fragments(self) -> StyleAndTextTuples:
    method _get_key_bindings (line 461) | def _get_key_bindings(self) -> KeyBindings:
    method __pt_container__ (line 473) | def __pt_container__(self) -> Container:
  class Frame (line 477) | class Frame:
    method __init__ (line 489) | def __init__(
    method __pt_container__ (line 571) | def __pt_container__(self) -> Container:
  class Shadow (line 575) | class Shadow:
    method __init__ (line 584) | def __init__(self, body: AnyContainer) -> None:
    method __pt_container__ (line 607) | def __pt_container__(self) -> Container:
  class Box (line 611) | class Box:
    method __init__ (line 630) | def __init__(
    method __pt_container__ (line 691) | def __pt_container__(self) -> Container:
  class _DialogList (line 698) | class _DialogList(Generic[_T]):
    method __init__ (line 703) | def __init__(
    method _handle_enter (line 836) | def _handle_enter(self) -> None:
    method _get_text_fragments (line 846) | def _get_text_fragments(self) -> StyleAndTextTuples:
    method __pt_container__ (line 898) | def __pt_container__(self) -> Container:
  class RadioList (line 902) | class RadioList(_DialogList[_T]):
    method __init__ (line 909) | def __init__(
  class CheckboxList (line 951) | class CheckboxList(_DialogList[_T]):
    method __init__ (line 958) | def __init__(
  class Checkbox (line 984) | class Checkbox(CheckboxList[str]):
    method __init__ (line 992) | def __init__(self, text: AnyFormattedText = "", checked: bool = False)...
    method checked (line 998) | def checked(self) -> bool:
    method checked (line 1002) | def checked(self, value: bool) -> None:
  class VerticalLine (line 1009) | class VerticalLine:
    method __init__ (line 1014) | def __init__(self) -> None:
    method __pt_container__ (line 1019) | def __pt_container__(self) -> Container:
  class HorizontalLine (line 1023) | class HorizontalLine:
    method __init__ (line 1028) | def __init__(self) -> None:
    method __pt_container__ (line 1033) | def __pt_container__(self) -> Container:
  class ProgressBar (line 1037) | class ProgressBar:
    method __init__ (line 1038) | def __init__(self) -> None:
    method percentage (line 1072) | def percentage(self) -> int:
    method percentage (line 1076) | def percentage(self, value: int) -> None:
    method __pt_container__ (line 1080) | def __pt_container__(self) -> Container:

FILE: src/prompt_toolkit/widgets/dialogs.py
  class Dialog (line 29) | class Dialog:
    method __init__ (line 42) | def __init__(
    method __pt_container__ (line 107) | def __pt_container__(self) -> AnyContainer:

FILE: src/prompt_toolkit/widgets/menus.py
  class MenuContainer (line 35) | class MenuContainer:
    method __init__ (line 41) | def __init__(
    method _get_menu (line 214) | def _get_menu(self, level: int) -> MenuItem:
    method _get_menu_fragments (line 226) | def _get_menu_fragments(self) -> StyleAndTextTuples:
    method _submenu (line 267) | def _submenu(self, level: int = 0) -> Window:
    method floats (line 346) | def floats(self) -> list[Float] | None:
    method __pt_container__ (line 349) | def __pt_container__(self) -> Container:
  class MenuItem (line 353) | class MenuItem:
    method __init__ (line 354) | def __init__(
    method width (line 370) | def width(self) -> int:

FILE: src/prompt_toolkit/widgets/toolbars.py
  class FormattedTextToolbar (line 60) | class FormattedTextToolbar(Window):
    method __init__ (line 61) | def __init__(self, text: AnyFormattedText, style: str = "", **kw: Any)...
  class SystemToolbar (line 72) | class SystemToolbar:
    method __init__ (line 79) | def __init__(
    method _get_display_before_text (line 108) | def _get_display_before_text(self) -> StyleAndTextTuples:
    method _build_key_bindings (line 115) | def _build_key_bindings(self) -> KeyBindingsBase:
    method __pt_container__ (line 187) | def __pt_container__(self) -> Container:
  class ArgToolbar (line 191) | class ArgToolbar:
    method __init__ (line 192) | def __init__(self) -> None:
    method __pt_container__ (line 207) | def __pt_container__(self) -> Container:
  class SearchToolbar (line 211) | class SearchToolbar:
    method __init__ (line 217) | def __init__(
    method __pt_container__ (line 259) | def __pt_container__(self) -> Container:
  class _CompletionsToolbarControl (line 263) | class _CompletionsToolbarControl(UIControl):
    method create_content (line 264) | def create_content(self, width: int, height: int) -> UIContent:
  class CompletionsToolbar (line 331) | class CompletionsToolbar:
    method __init__ (line 332) | def __init__(self) -> None:
    method __pt_container__ (line 340) | def __pt_container__(self) -> Container:
  class ValidationToolbar (line 344) | class ValidationToolbar:
    method __init__ (line 345) | def __init__(self, show_position: bool = False) -> None:
    method __pt_container__ (line 369) | def __pt_container__(self) -> Container:

FILE: src/prompt_toolkit/win32_types.py
  class COORD (line 15) | class COORD(Structure):
    method __repr__ (line 30) | def __repr__(self) -> str:
  class UNICODE_OR_ASCII (line 40) | class UNICODE_OR_ASCII(Union):
  class KEY_EVENT_RECORD (line 51) | class KEY_EVENT_RECORD(Structure):
  class MOUSE_EVENT_RECORD (line 74) | class MOUSE_EVENT_RECORD(Structure):
  class WINDOW_BUFFER_SIZE_RECORD (line 93) | class WINDOW_BUFFER_SIZE_RECORD(Structure):
  class MENU_EVENT_RECORD (line 104) | class MENU_EVENT_RECORD(Structure):
  class FOCUS_EVENT_RECORD (line 115) | class FOCUS_EVENT_RECORD(Structure):
  class EVENT_RECORD (line 126) | class EVENT_RECORD(Union):
  class INPUT_RECORD (line 143) | class INPUT_RECORD(Structure):
  class SMALL_RECT (line 164) | class SMALL_RECT(Structure):
  class CONSOLE_SCREEN_BUFFER_INFO (line 181) | class CONSOLE_SCREEN_BUFFER_INFO(Structure):
    method __repr__ (line 199) | def __repr__(self) -> str:
  class SECURITY_ATTRIBUTES (line 215) | class SECURITY_ATTRIBUTES(Structure):

FILE: tests/test_async_generator.py
  function _sync_generator (line 8) | def _sync_generator():
  function test_generator_to_async_generator (line 13) | def test_generator_to_async_generator():

FILE: tests/test_buffer.py
  function _buffer (line 9) | def _buffer():
  function test_initial (line 14) | def test_initial(_buffer):
  function test_insert_text (line 19) | def test_insert_text(_buffer):
  function test_cursor_movement (line 25) | def test_cursor_movement(_buffer):
  function test_backspace (line 37) | def test_backspace(_buffer):
  function test_cursor_up (line 47) | def test_cursor_up(_buffer):
  function test_cursor_down (line 66) | def test_cursor_down(_buffer):
  function test_join_next_line (line 83) | def test_join_next_line(_buffer):
  function test_newline (line 99) | def test_newline(_buffer):
  function test_swap_characters_before_cursor (line 106) | def test_swap_characters_before_cursor(_buffer):

FILE: tests/test_cli.py
  function _history (line 24) | def _history():
  function _feed_cli_with_input (line 32) | def _feed_cli_with_input(
  function test_simple_text_input (line 67) | def test_simple_text_input():
  function test_emacs_cursor_movements (line 74) | def test_emacs_cursor_movements():
  function test_emacs_kill_multiple_words_and_paste (line 191) | def test_emacs_kill_multiple_words_and_paste():
  function test_interrupts (line 212) | def test_interrupts():
  function test_emacs_yank (line 225) | def test_emacs_yank():
  function test_quoted_insert (line 233) | def test_quoted_insert():
  function test_transformations (line 239) | def test_transformations():
  function test_emacs_other_bindings (line 266) | def test_emacs_other_bindings():
  function test_controlx_controlx (line 306) | def test_controlx_controlx():
  function test_emacs_history_bindings (line 321) | def test_emacs_history_bindings():
  function test_emacs_reverse_search (line 351) | def test_emacs_reverse_search():
  function test_emacs_arguments (line 363) | def test_emacs_arguments():
  function test_emacs_arguments_for_all_commands (line 392) | def test_emacs_arguments_for_all_commands():
  function test_emacs_kill_ring (line 413) | def test_emacs_kill_ring():
  function test_emacs_selection (line 438) | def test_emacs_selection():
  function test_emacs_insert_comment (line 476) | def test_emacs_insert_comment():
  function test_emacs_record_macro (line 487) | def test_emacs_record_macro():
  function test_emacs_nested_macro (line 503) | def test_emacs_nested_macro():
  function test_prefix_meta (line 536) | def test_prefix_meta():
  function test_bracketed_paste (line 547) | def test_bracketed_paste():
  function test_vi_cursor_movements (line 563) | def test_vi_cursor_movements():
  function test_vi_operators (line 610) | def test_vi_operators():
  function test_vi_text_objects (line 626) | def test_vi_text_objects():
  function test_vi_digraphs (line 650) | def test_vi_digraphs():
  function test_vi_block_editing (line 670) | def test_vi_block_editing():
  function test_vi_block_editing_empty_lines (line 704) | def test_vi_block_editing_empty_lines():
  function test_vi_visual_line_copy (line 738) | def test_vi_visual_line_copy():
  function test_vi_visual_empty_line (line 770) | def test_vi_visual_empty_line():
  function test_vi_character_delete_after_cursor (line 804) | def test_vi_character_delete_after_cursor():
  function test_vi_character_delete_before_cursor (line 829) | def test_vi_character_delete_before_cursor():
  function test_vi_character_paste (line 853) | def test_vi_character_paste():
  function test_vi_temp_navigation_mode (line 867) | def test_vi_temp_navigation_mode():
  function test_vi_macros (line 896) | def test_vi_macros():
  function test_accept_default (line 930) | def test_accept_default():

FILE: tests/test_completion.py
  function chdir (line 21) | def chdir(directory):
  function write_test_files (line 32) | def write_test_files(test_dir, names=None):
  function test_pathcompleter_completes_in_current_directory (line 40) | def test_pathcompleter_completes_in_current_directory():
  function test_pathcompleter_completes_files_in_current_directory (line 49) | def test_pathcompleter_completes_files_in_current_directory():
  function test_pathcompleter_completes_files_in_absolute_directory (line 73) | def test_pathcompleter_completes_files_in_absolute_directory():
  function test_pathcompleter_completes_directories_with_only_directories (line 97) | def test_pathcompleter_completes_directories_with_only_directories():
  function test_pathcompleter_respects_completions_under_min_input_len (line 130) | def test_pathcompleter_respects_completions_under_min_input_len():
  function test_pathcompleter_does_not_expanduser_by_default (line 192) | def test_pathcompleter_does_not_expanduser_by_default():
  function test_pathcompleter_can_expanduser (line 201) | def test_pathcompleter_can_expanduser():
  function test_pathcompleter_can_apply_file_filter (line 210) | def test_pathcompleter_can_apply_file_filter():
  function test_pathcompleter_get_paths_constrains_path (line 234) | def test_pathcompleter_get_paths_constrains_path():
  function test_word_completer_static_word_list (line 260) | def test_word_completer_static_word_list():
  function test_word_completer_ignore_case (line 283) | def test_word_completer_ignore_case():
  function test_word_completer_match_middle (line 292) | def test_word_completer_match_middle():
  function test_word_completer_sentence (line 298) | def test_word_completer_sentence():
  function test_word_completer_dynamic_word_list (line 314) | def test_word_completer_dynamic_word_list():
  function test_word_completer_pattern (line 334) | def test_word_completer_pattern():
  function test_fuzzy_completer (line 349) | def test_fuzzy_completer():
  function test_nested_completer (line 403) | def test_nested_completer():
  function test_deduplicate_completer (line 447) | def test_deduplicate_completer():

FILE: tests/test_document.py
  function document (line 11) | def document():
  function test_current_char (line 17) | def test_current_char(document):
  function test_text_before_cursor (line 22) | def test_text_before_cursor(document):
  function test_text_after_cursor (line 26) | def test_text_after_cursor(document):
  function test_lines (line 30) | def test_lines(document):
  function test_line_count (line 34) | def test_line_count(document):
  function test_current_line_before_cursor (line 38) | def test_current_line_before_cursor(document):
  function test_current_line_after_cursor (line 42) | def test_current_line_after_cursor(document):
  function test_current_line (line 46) | def test_current_line(document):
  function test_cursor_position (line 50) | def test_cursor_position(document):
  function test_translate_index_to_position (line 59) | def test_translate_index_to_position(document):
  function test_is_cursor_at_the_end (line 69) | def test_is_cursor_at_the_end(document):
  function test_get_word_before_cursor_with_whitespace_and_pattern (line 74) | def test_get_word_before_cursor_with_whitespace_and_pattern():

FILE: tests/test_filter.py
  function test_never (line 9) | def test_never():
  function test_always (line 13) | def test_always():
  function test_invert (line 17) | def test_invert():
  function test_or (line 25) | def test_or():
  function test_and (line 36) | def test_and():
  function test_nested_and (line 47) | def test_nested_and():
  function test_nested_or (line 60) | def test_nested_or():
  function test_to_filter (line 73) | def test_to_filter():
  function test_filter_cache_regression_1 (line 92) | def test_filter_cache_regression_1():
  function test_filter_cache_regression_2 (line 105) | def test_filter_cache_regression_2():
  function test_filter_remove_duplicates (line 115) | def test_filter_remove_duplicates():

FILE: tests/test_formatted_text.py
  function test_basic_html (line 15) | def test_basic_html():
  function test_html_with_fg_bg (line 36) | def test_html_with_fg_bg():
  function test_ansi_formatting (line 56) | def test_ansi_formatting():
  function test_ansi_dim (line 92) | def test_ansi_dim():
  function test_ansi_256_color (line 132) | def test_ansi_256_color():
  function test_ansi_true_color (line 141) | def test_ansi_true_color():
  function test_ansi_interpolation (line 148) | def test_ansi_interpolation():
  function test_interpolation (line 213) | def test_interpolation():
  function test_html_interpolation (line 233) | def test_html_interpolation():
  function test_merge_formatted_text (line 255) | def test_merge_formatted_text():
  function test_pygments_tokens (line 266) | def test_pygments_tokens():
  function test_split_lines (line 280) | def test_split_lines():
  function test_split_lines_2 (line 290) | def test_split_lines_2():
  function test_split_lines_3 (line 302) | def test_split_lines_3():
  function test_split_lines_4 (line 329) | def test_split_lines_4():

FILE: tests/test_history.py
  function _call_history_load (line 8) | def _call_history_load(history):
  function test_in_memory_history (line 22) | def test_in_memory_history():
  function test_file_history (line 41) | def test_file_history(tmpdir):
  function test_threaded_file_history (line 63) | def test_threaded_file_history(tmpdir):
  function test_threaded_in_memory_history (line 85) | def test_threaded_in_memory_history():

FILE: tests/test_inputstream.py
  class _ProcessorMock (line 9) | class _ProcessorMock:
    method __init__ (line 10) | def __init__(self):
    method feed_key (line 13) | def feed_key(self, key_press):
  function processor (line 18) | def processor():
  function stream (line 23) | def stream(processor):
  function test_control_keys (line 27) | def test_control_keys(processor, stream):
  function test_arrows (line 39) | def test_arrows(processor, stream):
  function test_escape (line 53) | def test_escape(processor, stream):
  function test_special_double_keys (line 63) | def test_special_double_keys(processor, stream):
  function test_flush_1 (line 73) | def test_flush_1(processor, stream):
  function test_flush_2 (line 83) | def test_flush_2(processor, stream):
  function test_meta_arrows (line 101) | def test_meta_arrows(processor, stream):
  function test_control_square_close (line 109) | def test_control_square_close(processor, stream):
  function test_invalid (line 117) | def test_invalid(processor, stream):
  function test_cpr_response (line 128) | def test_cpr_response(processor, stream):
  function test_cpr_response_2 (line 136) | def test_cpr_response_2(processor, stream):

FILE: tests/test_key_binding.py
  class Handlers (line 17) | class Handlers:
    method __init__ (line 18) | def __init__(self):
    method __getattr__ (line 21) | def __getattr__(self, name):
  function set_dummy_app (line 29) | def set_dummy_app():
  function handlers (line 60) | def handlers():
  function bindings (line 65) | def bindings(handlers):
  function processor (line 76) | def processor(bindings):
  function test_remove_bindings (line 80) | def test_remove_bindings(handlers):
  function test_feed_simple (line 102) | def test_feed_simple(processor, handlers):
  function test_feed_several (line 111) | def test_feed_several(processor, handlers):
  function test_control_square_closed_any (line 137) | def test_control_square_closed_any(processor, handlers):
  function test_common_prefix (line 146) | def test_common_prefix(processor, handlers):
  function test_previous_key_sequence (line 163) | def test_previous_key_sequence(processor):

FILE: tests/test_layout.py
  function test_layout_class (line 10) | def test_layout_class():
  function test_create_invalid_layout (line 51) | def test_create_invalid_layout():

FILE: tests/test_memory_leaks.py
  function _count_prompt_session_instances (line 8) | def _count_prompt_session_instances() -> int:
  function test_prompt_session_memory_leak (line 18) | def test_prompt_session_memory_leak() -> None:

FILE: tests/test_print_formatted_text.py
  class _Capture (line 16) | class _Capture:
    method __init__ (line 19) | def __init__(self):
    method write (line 22) | def write(self, data):
    method data (line 26) | def data(self):
    method flush (line 29) | def flush(self):
    method isatty (line 32) | def isatty(self):
    method fileno (line 35) | def fileno(self):
  function test_print_formatted_text (line 42) | def test_print_formatted_text():
  function test_print_formatted_text_backslash_r (line 50) | def test_print_formatted_text_backslash_r():
  function test_formatted_text_with_style (line 57) | def test_formatted_text_with_style():
  function test_html_with_style (line 80) | def test_html_with_style():
  function test_print_formatted_text_with_dim (line 97) | def test_print_formatted_text_with_dim():

FILE: tests/test_regular_languages.py
  function test_simple_match (line 10) | def test_simple_match():
  function test_variable_varname (line 23) | def test_variable_varname():
  function test_prefix (line 48) | def test_prefix():
  function test_completer (line 78) | def test_completer():

FILE: tests/test_shortcuts.py
  function test_split_multiline_prompt (line 8) | def test_split_multiline_prompt():
  function test_print_container (line 58) | def test_print_container(tmpdir):

FILE: tests/test_style.py
  function test_style_from_dict (line 6) | def test_style_from_dict():
  function test_class_combinations_1 (line 89) | def test_class_combinations_1():
  function test_class_combinations_2 (line 120) | def test_class_combinations_2():
  function test_substyles (line 163) | def test_substyles():
  function test_swap_light_and_dark_style_transformation (line 235) | def test_swap_light_and_dark_style_transformation():

FILE: tests/test_style_transformation.py
  function default_attrs (line 9) | def default_attrs():
  function test_adjust_brightness_style_transformation (line 24) | def test_adjust_brightness_style_transformation(default_attrs):

FILE: tests/test_utils.py
  function test_using_weights (line 10) | def test_using_weights():

FILE: tests/test_vt100_output.py
  function test_get_closest_ansi_color (line 6) | def test_get_closest_ansi_color():
  function test_256_colors (line 23) | def test_256_colors():

FILE: tests/test_widgets.py
  function _to_text (line 8) | def _to_text(button: Button) -> str:
  function test_default_button (line 13) | def test_default_button():
  function test_custom_button (line 18) | def test_custom_button():

FILE: tests/test_yank_nth_arg.py
  function _history (line 10) | def _history():
  function test_empty_history (line 21) | def test_empty_history():
  function test_simple_search (line 27) | def test_simple_search(_history):
  function test_simple_search_with_quotes (line 33) | def test_simple_search_with_quotes(_history):
  function test_simple_search_with_arg (line 40) | def test_simple_search_with_arg(_history):
  function test_simple_search_with_arg_out_of_bounds (line 46) | def test_simple_search_with_arg_out_of_bounds(_history):
  function test_repeated_search (line 52) | def test_repeated_search(_history):
  function test_repeated_search_with_wraparound (line 59) | def test_repeated_search_with_wraparound(_history):
  function test_yank_nth_arg (line 70) | def test_yank_nth_arg(_history):
  function test_repeated_yank_nth_arg (line 76) | def test_repeated_yank_nth_arg(_history):
  function test_yank_nth_arg_with_arg (line 83) | def test_yank_nth_arg_with_arg(_history):

FILE: tools/debug_input_cross_platform.py
  function main (line 15) | async def main() -> None:

FILE: tools/debug_vt100_input.py
  function callback (line 17) | def callback(key_press: KeyPress) -> None:
  function main (line 24) | def main() -> None:
Condensed preview — 342 files, each showing path, character count, and a content snippet. Download the .json file or copy for the full structured content (2,126K chars).
[
  {
    "path": ".codecov.yml",
    "chars": 13,
    "preview": "comment: off\n"
  },
  {
    "path": ".github/workflows/test.yaml",
    "chars": 1215,
    "preview": "name: test\n\non:\n  push: # any branch\n  pull_request:\n    branches: [main]\n\nenv:\n  FORCE_COLOR: 1\n\njobs:\n  test-ubuntu:\n "
  },
  {
    "path": ".gitignore",
    "chars": 555,
    "preview": "*.py[cod]\n\n# C extensions\n*.so\n\n# Packages\n*.egg\n*.egg-info\ndist\nbuild\neggs\nparts\nbin\nvar\nsdist\ndevelop-eggs\n.installed."
  },
  {
    "path": ".pre-commit-config.yaml",
    "chars": 787,
    "preview": "repos:\n  - repo: https://github.com/pre-commit/pre-commit-hooks\n    rev: \"v6.0.0\"\n    hooks:\n      - id: check-case-conf"
  },
  {
    "path": ".readthedocs.yml",
    "chars": 226,
    "preview": "version: 2\n\nbuild:\n  os: ubuntu-22.04\n  tools:\n    python: \"3.11\"\n\nformats:\n  - pdf\n  - epub\n\nsphinx:\n  configuration: d"
  },
  {
    "path": "AUTHORS.rst",
    "chars": 148,
    "preview": "Authors\n=======\n\nCreator\n-------\nJonathan Slenders <jonathan AT slenders.be>\n\nContributors\n------------\n\n- Amjith Ramanu"
  },
  {
    "path": "CHANGELOG",
    "chars": 82091,
    "preview": "CHANGELOG\n=========\n\n3.0.52: 2025-08-27\n------------------\n\nNew features:\n- Add `choice()` shortcut for selecting an opt"
  },
  {
    "path": "LICENSE",
    "chars": 1493,
    "preview": "Copyright (c) 2014, Jonathan Slenders\nAll rights reserved.\n\nRedistribution and use in source and binary forms, with or w"
  },
  {
    "path": "MANIFEST.in",
    "chars": 133,
    "preview": "include *rst LICENSE CHANGELOG MANIFEST.in\nrecursive-include examples *.py\nrecursive-include tests *.py\nprune examples/s"
  },
  {
    "path": "PROJECTS.rst",
    "chars": 5162,
    "preview": "Projects using `prompt_toolkit`\n===============================\n\nShells:\n\n- `ptpython <http://github.com/prompt-toolkit/"
  },
  {
    "path": "README.rst",
    "chars": 5245,
    "preview": "Python Prompt Toolkit\n=====================\n\n|AppVeyor|  |PyPI|  |RTD|  |License|  |Codecov|\n\n.. image :: /docs/images/l"
  },
  {
    "path": "appveyor.yml",
    "chars": 997,
    "preview": "environment:\n  matrix:\n    - PYTHON: \"C:\\\\Python36\"\n      PYTHON_VERSION: \"3.6\"\n    - PYTHON: \"C:\\\\Python36-x64\"\n      P"
  },
  {
    "path": "docs/conf.py",
    "chars": 12672,
    "preview": "#\n# prompt_toolkit documentation build configuration file, created by\n# sphinx-quickstart on Thu Jul 31 14:17:08 2014.\n#"
  },
  {
    "path": "docs/index.rst",
    "chars": 2537,
    "preview": "Python Prompt Toolkit 3.0\n=========================\n\n`prompt_toolkit` is a library for building powerful interactive com"
  },
  {
    "path": "docs/make.bat",
    "chars": 6699,
    "preview": "@ECHO OFF\r\n\r\nREM Command file for Sphinx documentation\r\n\r\nif \"%SPHINXBUILD%\" == \"\" (\r\n\tset SPHINXBUILD=sphinx-build\r\n)\r\n"
  },
  {
    "path": "docs/pages/advanced_topics/architecture.rst",
    "chars": 5484,
    "preview": ".. _architecture:\n\n\nArchitecture\n============\n\nTODO: this is a little outdated.\n\n::\n\n    +------------------------------"
  },
  {
    "path": "docs/pages/advanced_topics/asyncio.rst",
    "chars": 791,
    "preview": ".. _asyncio:\n\nRunning on top of the `asyncio` event loop\n==========================================\n\n.. note::\n\n    New "
  },
  {
    "path": "docs/pages/advanced_topics/filters.rst",
    "chars": 5714,
    "preview": ".. _filters:\n\nFilters\n=======\n\nMany places in `prompt_toolkit` require a boolean value that can change over\ntime. For in"
  },
  {
    "path": "docs/pages/advanced_topics/index.rst",
    "chars": 255,
    "preview": ".. _advanced_topics:\n\nAdvanced topics\n===============\n\n.. toctree::\n    :caption: Contents:\n    :maxdepth: 1\n\n    key_bi"
  },
  {
    "path": "docs/pages/advanced_topics/input_hooks.rst",
    "chars": 1455,
    "preview": ".. _input_hooks:\n\n\nInput hooks\n===========\n\nInput hooks are a tool for inserting an external event loop into the\nprompt_"
  },
  {
    "path": "docs/pages/advanced_topics/key_bindings.rst",
    "chars": 14009,
    "preview": ".. _key_bindings:\n\nMore about key bindings\n=======================\n\nThis page contains a few additional notes about key "
  },
  {
    "path": "docs/pages/advanced_topics/rendering_flow.rst",
    "chars": 3712,
    "preview": ".. _rendering_flow:\n\nThe rendering flow\n==================\n\nUnderstanding the rendering flow is important for understand"
  },
  {
    "path": "docs/pages/advanced_topics/rendering_pipeline.rst",
    "chars": 7337,
    "preview": "The rendering pipeline\n======================\n\nThis document is an attempt to describe how prompt_toolkit applications a"
  },
  {
    "path": "docs/pages/advanced_topics/styling.rst",
    "chars": 10557,
    "preview": ".. _styling:\n\nMore about styling\n==================\n\nThis page will attempt to explain in more detail how to use styling"
  },
  {
    "path": "docs/pages/advanced_topics/unit_testing.rst",
    "chars": 5297,
    "preview": ".. _unit_testing:\n\nUnit testing\n============\n\nTesting user interfaces is not always obvious. Here are a few tricks for\nt"
  },
  {
    "path": "docs/pages/asking_for_a_choice.rst",
    "chars": 4144,
    "preview": ".. _asking_for_input:\n\nAsking for a choice\n===================\n\nSimilar to how the :func:`~prompt_toolkit.shortcuts.prom"
  },
  {
    "path": "docs/pages/asking_for_input.rst",
    "chars": 34995,
    "preview": ".. _asking_for_input:\n\nAsking for input (prompts)\n==========================\n\nThis page is about building prompts. Piece"
  },
  {
    "path": "docs/pages/dialogs.rst",
    "chars": 9344,
    "preview": ".. _dialogs:\n\nDialogs\n=======\n\nPrompt_toolkit ships with a high level API for displaying dialogs, similar to\nthe Whiptai"
  },
  {
    "path": "docs/pages/full_screen_apps.rst",
    "chars": 18716,
    "preview": ".. _full_screen_applications:\n\nBuilding full screen applications\n=================================\n\n`prompt_toolkit` can"
  },
  {
    "path": "docs/pages/gallery.rst",
    "chars": 588,
    "preview": ".. _gallery:\n\nGallery\n=======\n\nShowcase, demonstrating the possibilities of prompt_toolkit.\n\nPtpython, a Python REPL\n^^^"
  },
  {
    "path": "docs/pages/getting_started.rst",
    "chars": 2831,
    "preview": ".. _getting_started:\n\nGetting started\n===============\n\nInstallation\n------------\n\n::\n\n    pip install prompt_toolkit\n\nFo"
  },
  {
    "path": "docs/pages/printing_text.rst",
    "chars": 9210,
    "preview": ".. _printing_text:\n\nPrinting (and using) formatted text\n===================================\n\nPrompt_toolkit ships with a"
  },
  {
    "path": "docs/pages/progress_bars.rst",
    "chars": 7427,
    "preview": ".. _progress_bars:\n\nProgress bars\n=============\n\nPrompt_toolkit ships with a high level API for displaying progress bars"
  },
  {
    "path": "docs/pages/reference.rst",
    "chars": 7327,
    "preview": "Reference\n=========\n\nApplication\n-----------\n\n.. automodule:: prompt_toolkit.application\n    :members: Application, get_"
  },
  {
    "path": "docs/pages/related_projects.rst",
    "chars": 284,
    "preview": ".. _related_projects:\n\nRelated projects\n================\n\nThere are some other Python libraries that provide similar fun"
  },
  {
    "path": "docs/pages/tutorials/index.rst",
    "chars": 101,
    "preview": ".. _tutorials:\n\nTutorials\n=========\n\n.. toctree::\n    :caption: Contents:\n    :maxdepth: 1\n\n    repl\n"
  },
  {
    "path": "docs/pages/tutorials/repl.rst",
    "chars": 12329,
    "preview": ".. _tutorial_repl:\n\nTutorial: Build an SQLite REPL\n==============================\n\nThe aim of this tutorial is to build "
  },
  {
    "path": "docs/pages/upgrading/2.0.rst",
    "chars": 9591,
    "preview": ".. _upgrading_2_0:\n\nUpgrading to prompt_toolkit 2.0\n===============================\n\nPrompt_toolkit 2.0 is not compatibl"
  },
  {
    "path": "docs/pages/upgrading/3.0.rst",
    "chars": 3577,
    "preview": ".. _upgrading_3_0:\n\nUpgrading to prompt_toolkit 3.0\n===============================\n\nThere are two major changes in 3.0 "
  },
  {
    "path": "docs/pages/upgrading/index.rst",
    "chars": 108,
    "preview": ".. _upgrading:\n\nUpgrading\n=========\n\n.. toctree::\n    :caption: Contents:\n    :maxdepth: 1\n\n    2.0\n    3.0\n"
  },
  {
    "path": "docs/requirements.txt",
    "chars": 91,
    "preview": "Sphinx>=8,<9\nwcwidth<1\npyperclip<2\nsphinx_copybutton>=0.5.2,<1.0.0\nsphinx-nefertiti>=0.8.8\n"
  },
  {
    "path": "examples/choices/color.py",
    "chars": 823,
    "preview": "from __future__ import annotations\n\nfrom prompt_toolkit.formatted_text import HTML\nfrom prompt_toolkit.shortcuts import "
  },
  {
    "path": "examples/choices/default.py",
    "chars": 467,
    "preview": "from __future__ import annotations\n\nfrom prompt_toolkit.formatted_text import HTML\nfrom prompt_toolkit.shortcuts import "
  },
  {
    "path": "examples/choices/frame-and-bottom-toolbar.py",
    "chars": 1190,
    "preview": "from __future__ import annotations\n\nfrom prompt_toolkit.filters import is_done\nfrom prompt_toolkit.formatted_text import"
  },
  {
    "path": "examples/choices/gray-frame-on-accept.py",
    "chars": 710,
    "preview": "from __future__ import annotations\n\nfrom prompt_toolkit.formatted_text import HTML\nfrom prompt_toolkit.shortcuts import "
  },
  {
    "path": "examples/choices/many-choices.py",
    "chars": 292,
    "preview": "from __future__ import annotations\n\nfrom prompt_toolkit.shortcuts import choice\n\n\ndef main() -> None:\n    result = choic"
  },
  {
    "path": "examples/choices/mouse-support.py",
    "chars": 470,
    "preview": "from __future__ import annotations\n\nfrom prompt_toolkit.formatted_text import HTML\nfrom prompt_toolkit.shortcuts import "
  },
  {
    "path": "examples/choices/simple-selection.py",
    "chars": 382,
    "preview": "from __future__ import annotations\n\nfrom prompt_toolkit.shortcuts import choice\n\n\ndef main() -> None:\n    result = choic"
  },
  {
    "path": "examples/choices/with-frame.py",
    "chars": 904,
    "preview": "from __future__ import annotations\n\nfrom prompt_toolkit.filters import is_done\nfrom prompt_toolkit.formatted_text import"
  },
  {
    "path": "examples/dialogs/button_dialog.py",
    "chars": 379,
    "preview": "#!/usr/bin/env python\n\"\"\"\nExample of button dialog window.\n\"\"\"\n\nfrom prompt_toolkit.shortcuts import button_dialog\n\n\ndef"
  },
  {
    "path": "examples/dialogs/checkbox_dialog.py",
    "chars": 1062,
    "preview": "#!/usr/bin/env python\n\"\"\"\nExample of a checkbox-list-based dialog.\n\"\"\"\n\nfrom prompt_toolkit.formatted_text import HTML\nf"
  },
  {
    "path": "examples/dialogs/input_dialog.py",
    "chars": 307,
    "preview": "#!/usr/bin/env python\n\"\"\"\nExample of an input box dialog.\n\"\"\"\n\nfrom prompt_toolkit.shortcuts import input_dialog\n\n\ndef m"
  },
  {
    "path": "examples/dialogs/messagebox.py",
    "chars": 304,
    "preview": "#!/usr/bin/env python\n\"\"\"\nExample of a message box window.\n\"\"\"\n\nfrom prompt_toolkit.shortcuts import message_dialog\n\n\nde"
  },
  {
    "path": "examples/dialogs/password_dialog.py",
    "chars": 351,
    "preview": "#!/usr/bin/env python\n\"\"\"\nExample of an password input dialog.\n\"\"\"\n\nfrom prompt_toolkit.shortcuts import input_dialog\n\n\n"
  },
  {
    "path": "examples/dialogs/progress_dialog.py",
    "chars": 1138,
    "preview": "#!/usr/bin/env python\n\"\"\"\nExample of a progress bar dialog.\n\"\"\"\n\nimport os\nimport time\n\nfrom prompt_toolkit.shortcuts im"
  },
  {
    "path": "examples/dialogs/radio_dialog.py",
    "chars": 1065,
    "preview": "#!/usr/bin/env python\n\"\"\"\nExample of a radio list box dialog.\n\"\"\"\n\nfrom prompt_toolkit.formatted_text import HTML\nfrom p"
  },
  {
    "path": "examples/dialogs/styled_messagebox.py",
    "chars": 932,
    "preview": "#!/usr/bin/env python\n\"\"\"\nExample of a style dialog window.\nAll dialog shortcuts take a `style` argument in order to app"
  },
  {
    "path": "examples/dialogs/yes_no_dialog.py",
    "chars": 327,
    "preview": "#!/usr/bin/env python\n\"\"\"\nExample of confirmation (yes/no) dialog window.\n\"\"\"\n\nfrom prompt_toolkit.shortcuts import yes_"
  },
  {
    "path": "examples/full-screen/ansi-art-and-textarea.py",
    "chars": 22329,
    "preview": "#!/usr/bin/env python\n\nfrom prompt_toolkit.application import Application\nfrom prompt_toolkit.formatted_text import ANSI"
  },
  {
    "path": "examples/full-screen/buttons.py",
    "chars": 2390,
    "preview": "#!/usr/bin/env python\n\"\"\"\nA simple example of a few buttons and click handlers.\n\"\"\"\n\nfrom prompt_toolkit.application imp"
  },
  {
    "path": "examples/full-screen/calculator.py",
    "chars": 2725,
    "preview": "#!/usr/bin/env python\n\"\"\"\nA simple example of a calculator program.\nThis could be used as inspiration for a REPL.\n\"\"\"\n\nf"
  },
  {
    "path": "examples/full-screen/dummy-app.py",
    "chars": 160,
    "preview": "#!/usr/bin/env python\n\"\"\"\nThis is the most simple example possible.\n\"\"\"\n\nfrom prompt_toolkit import Application\n\napp = A"
  },
  {
    "path": "examples/full-screen/full-screen-demo.py",
    "chars": 5606,
    "preview": "#!/usr/bin/env python\n\"\"\" \"\"\"\n\nfrom pygments.lexers.html import HtmlLexer\n\nfrom prompt_toolkit.application import Applic"
  },
  {
    "path": "examples/full-screen/hello-world.py",
    "chars": 937,
    "preview": "#!/usr/bin/env python\n\"\"\"\nA simple example of a a text area displaying \"Hello World!\".\n\"\"\"\n\nfrom prompt_toolkit.applicat"
  },
  {
    "path": "examples/full-screen/no-layout.py",
    "chars": 156,
    "preview": "#!/usr/bin/env python\n\"\"\"\nAn empty full screen application without layout.\n\"\"\"\n\nfrom prompt_toolkit import Application\n\n"
  },
  {
    "path": "examples/full-screen/pager.py",
    "chars": 2442,
    "preview": "#!/usr/bin/env python\n\"\"\"\nA simple application that shows a Pager application.\n\"\"\"\n\nfrom pygments.lexers.python import P"
  },
  {
    "path": "examples/full-screen/scrollable-panes/simple-example.py",
    "chars": 1276,
    "preview": "#!/usr/bin/env python\n\"\"\"\nA simple example of a scrollable pane.\n\"\"\"\n\nfrom prompt_toolkit.application import Application"
  },
  {
    "path": "examples/full-screen/scrollable-panes/with-completion-menu.py",
    "chars": 2826,
    "preview": "#!/usr/bin/env python\n\"\"\"\nA simple example of a scrollable pane.\n\"\"\"\n\nfrom prompt_toolkit.application import Application"
  },
  {
    "path": "examples/full-screen/simple-demos/alignment.py",
    "chars": 1958,
    "preview": "#!/usr/bin/env python\n\"\"\"\nDemo of the different Window alignment options.\n\"\"\"\n\nfrom prompt_toolkit.application import Ap"
  },
  {
    "path": "examples/full-screen/simple-demos/autocompletion.py",
    "chars": 2138,
    "preview": "#!/usr/bin/env python\n\"\"\"\nAn example of a BufferControl in a full screen layout that offers auto\ncompletion.\n\nImportant "
  },
  {
    "path": "examples/full-screen/simple-demos/colorcolumn.py",
    "chars": 1868,
    "preview": "#!/usr/bin/env python\n\"\"\"\nColorcolumn example.\n\"\"\"\n\nfrom prompt_toolkit.application import Application\nfrom prompt_toolk"
  },
  {
    "path": "examples/full-screen/simple-demos/cursorcolumn-cursorline.py",
    "chars": 1869,
    "preview": "#!/usr/bin/env python\n\"\"\"\nCursorcolumn / cursorline example.\n\"\"\"\n\nfrom prompt_toolkit.application import Application\nfro"
  },
  {
    "path": "examples/full-screen/simple-demos/float-transparency.py",
    "chars": 2742,
    "preview": "#!/usr/bin/env python\n\"\"\"\nExample of the 'transparency' attribute of `Window' when used in a Float.\n\"\"\"\n\nfrom prompt_too"
  },
  {
    "path": "examples/full-screen/simple-demos/floats.py",
    "chars": 3418,
    "preview": "#!/usr/bin/env python\n\"\"\"\nFloats example.\n\"\"\"\n\nfrom prompt_toolkit.application import Application\nfrom prompt_toolkit.ke"
  },
  {
    "path": "examples/full-screen/simple-demos/focus.py",
    "chars": 2774,
    "preview": "#!/usr/bin/env python\n\"\"\"\nDemonstration of how to programmatically focus a certain widget.\n\"\"\"\n\nfrom prompt_toolkit.appl"
  },
  {
    "path": "examples/full-screen/simple-demos/horizontal-align.py",
    "chars": 7273,
    "preview": "#!/usr/bin/env python\n\"\"\"\nHorizontal align demo with HSplit.\n\"\"\"\n\nfrom prompt_toolkit.application import Application\nfro"
  },
  {
    "path": "examples/full-screen/simple-demos/horizontal-split.py",
    "chars": 948,
    "preview": "#!/usr/bin/env python\n\"\"\"\nHorizontal split example.\n\"\"\"\n\nfrom prompt_toolkit.application import Application\nfrom prompt_"
  },
  {
    "path": "examples/full-screen/simple-demos/line-prefixes.py",
    "chars": 3091,
    "preview": "#!/usr/bin/env python\n\"\"\"\nAn example of a BufferControl in a full screen layout that offers auto\ncompletion.\n\nImportant "
  },
  {
    "path": "examples/full-screen/simple-demos/margins.py",
    "chars": 2183,
    "preview": "#!/usr/bin/env python\n\"\"\"\nExample of Window margins.\n\nThis is mainly used for displaying line numbers and scroll bars, b"
  },
  {
    "path": "examples/full-screen/simple-demos/vertical-align.py",
    "chars": 5483,
    "preview": "#!/usr/bin/env python\n\"\"\"\nVertical align demo with VSplit.\n\"\"\"\n\nfrom prompt_toolkit.application import Application\nfrom "
  },
  {
    "path": "examples/full-screen/simple-demos/vertical-split.py",
    "chars": 943,
    "preview": "#!/usr/bin/env python\n\"\"\"\nVertical split example.\n\"\"\"\n\nfrom prompt_toolkit.application import Application\nfrom prompt_to"
  },
  {
    "path": "examples/full-screen/split-screen.py",
    "chars": 5144,
    "preview": "#!/usr/bin/env python\n\"\"\"\nSimple example of a full screen application with a vertical split.\n\nThis will show a window on"
  },
  {
    "path": "examples/full-screen/text-editor.py",
    "chars": 9177,
    "preview": "#!/usr/bin/env python\n\"\"\"\nA simple example of a Notepad-like text editor.\n\"\"\"\n\nimport datetime\nfrom asyncio import Futur"
  },
  {
    "path": "examples/gevent-get-input.py",
    "chars": 685,
    "preview": "#!/usr/bin/env python\n\"\"\"\nFor testing: test to make sure that everything still works when gevent monkey\npatches are appl"
  },
  {
    "path": "examples/print-text/ansi-colors.py",
    "chars": 3084,
    "preview": "#!/usr/bin/env python\n\"\"\"\nDemonstration of all the ANSI colors.\n\"\"\"\n\nfrom prompt_toolkit import print_formatted_text\nfro"
  },
  {
    "path": "examples/print-text/ansi.py",
    "chars": 1225,
    "preview": "#!/usr/bin/env python\n\"\"\"\nDemonstration of how to print using ANSI escape sequences.\n\nThe advantage here is that this is"
  },
  {
    "path": "examples/print-text/html.py",
    "chars": 1368,
    "preview": "#!/usr/bin/env python\n\"\"\"\nDemonstration of how to print using the HTML class.\n\"\"\"\n\nfrom prompt_toolkit import HTML, prin"
  },
  {
    "path": "examples/print-text/named-colors.py",
    "chars": 884,
    "preview": "#!/usr/bin/env python\n\"\"\"\nDemonstration of all the ANSI colors.\n\"\"\"\n\nfrom prompt_toolkit import HTML, print_formatted_te"
  },
  {
    "path": "examples/print-text/print-formatted-text.py",
    "chars": 1098,
    "preview": "#!/usr/bin/env python\n\"\"\"\nExample of printing colored text to the output.\n\"\"\"\n\nfrom prompt_toolkit import print_formatte"
  },
  {
    "path": "examples/print-text/print-frame.py",
    "chars": 332,
    "preview": "#!/usr/bin/env python\n\"\"\"\nExample usage of 'print_container', a tool to print\nany layout in a non-interactive way.\n\"\"\"\n\n"
  },
  {
    "path": "examples/print-text/prompt-toolkit-logo-ansi-art.py",
    "chars": 21303,
    "preview": "#!/usr/bin/env python\nr\"\"\"\nThis prints the prompt_toolkit logo at the terminal.\nThe ANSI output was generated using \"png"
  },
  {
    "path": "examples/print-text/pygments-tokens.py",
    "chars": 1231,
    "preview": "#!/usr/bin/env python\n\"\"\"\nPrinting a list of Pygments (Token, text) tuples,\nor an output of a Pygments lexer.\n\"\"\"\n\nimpor"
  },
  {
    "path": "examples/print-text/true-color-demo.py",
    "chars": 1025,
    "preview": "#!/usr/bin/env python\n\"\"\"\nDemonstration of all the ANSI colors.\n\"\"\"\n\nfrom prompt_toolkit import print_formatted_text\nfro"
  },
  {
    "path": "examples/progress-bar/a-lot-of-parallel-tasks.py",
    "chars": 1902,
    "preview": "#!/usr/bin/env python\n\"\"\"\nMore complex demonstration of what's possible with the progress bar.\n\"\"\"\n\nimport random\nimport"
  },
  {
    "path": "examples/progress-bar/colored-title-and-label.py",
    "chars": 538,
    "preview": "#!/usr/bin/env python\n\"\"\"\nA progress bar that displays a formatted title above the progress bar and has a\ncolored label."
  },
  {
    "path": "examples/progress-bar/custom-key-bindings.py",
    "chars": 1208,
    "preview": "#!/usr/bin/env python\n\"\"\"\nA very simple progress bar which keep track of the progress as we consume an\niterator.\n\"\"\"\n\nim"
  },
  {
    "path": "examples/progress-bar/many-parallel-tasks.py",
    "chars": 1592,
    "preview": "#!/usr/bin/env python\n\"\"\"\nMore complex demonstration of what's possible with the progress bar.\n\"\"\"\n\nimport threading\nimp"
  },
  {
    "path": "examples/progress-bar/nested-progress-bars.py",
    "chars": 566,
    "preview": "#!/usr/bin/env python\n\"\"\"\nExample of nested progress bars.\n\"\"\"\n\nimport time\n\nfrom prompt_toolkit import HTML\nfrom prompt"
  },
  {
    "path": "examples/progress-bar/scrolling-task-name.py",
    "chars": 533,
    "preview": "#!/usr/bin/env python\n\"\"\"\nA very simple progress bar where the name of the task scrolls, because it's too long.\niterator"
  },
  {
    "path": "examples/progress-bar/simple-progress-bar.py",
    "chars": 326,
    "preview": "#!/usr/bin/env python\n\"\"\"\nA very simple progress bar which keep track of the progress as we consume an\niterator.\n\"\"\"\n\nim"
  },
  {
    "path": "examples/progress-bar/styled-1.py",
    "chars": 863,
    "preview": "#!/usr/bin/env python\n\"\"\"\nA very simple progress bar which keep track of the progress as we consume an\niterator.\n\"\"\"\n\nim"
  },
  {
    "path": "examples/progress-bar/styled-2.py",
    "chars": 1347,
    "preview": "#!/usr/bin/env python\n\"\"\"\nA very simple progress bar which keep track of the progress as we consume an\niterator.\n\"\"\"\n\nim"
  },
  {
    "path": "examples/progress-bar/styled-apt-get-install.py",
    "chars": 942,
    "preview": "#!/usr/bin/env python\n\"\"\"\nStyled just like an apt-get installation.\n\"\"\"\n\nimport time\n\nfrom prompt_toolkit.shortcuts impo"
  },
  {
    "path": "examples/progress-bar/styled-rainbow.py",
    "chars": 933,
    "preview": "#!/usr/bin/env python\n\"\"\"\nA simple progress bar, visualized with rainbow colors (for fun).\n\"\"\"\n\nimport time\n\nfrom prompt"
  },
  {
    "path": "examples/progress-bar/styled-tqdm-1.py",
    "chars": 1109,
    "preview": "#!/usr/bin/env python\n\"\"\"\nStyled similar to tqdm, another progress bar implementation in Python.\n\nSee: https://github.co"
  },
  {
    "path": "examples/progress-bar/styled-tqdm-2.py",
    "chars": 1035,
    "preview": "#!/usr/bin/env python\n\"\"\"\nStyled similar to tqdm, another progress bar implementation in Python.\n\nSee: https://github.co"
  },
  {
    "path": "examples/progress-bar/two-tasks.py",
    "chars": 930,
    "preview": "#!/usr/bin/env python\n\"\"\"\nTwo progress bars that run in parallel.\n\"\"\"\n\nimport threading\nimport time\n\nfrom prompt_toolkit"
  },
  {
    "path": "examples/progress-bar/unknown-length.py",
    "chars": 502,
    "preview": "#!/usr/bin/env python\n\"\"\"\nA very simple progress bar which keep track of the progress as we consume an\niterator.\n\"\"\"\n\nim"
  },
  {
    "path": "examples/prompts/accept-default.py",
    "chars": 466,
    "preview": "#!/usr/bin/env python\n\"\"\"\nExample of `accept_default`, a way to automatically accept the input that the\nuser typed witho"
  },
  {
    "path": "examples/prompts/asyncio-prompt.py",
    "chars": 1808,
    "preview": "#!/usr/bin/env python\n\"\"\"\nThis is an example of how to prompt inside an application that uses the asyncio\neventloop. The"
  },
  {
    "path": "examples/prompts/auto-completion/autocomplete-with-control-space.py",
    "chars": 1409,
    "preview": "#!/usr/bin/env python\n\"\"\"\nExample of using the control-space key binding for auto completion.\n\"\"\"\n\nfrom prompt_toolkit i"
  },
  {
    "path": "examples/prompts/auto-completion/autocompletion-like-readline.py",
    "chars": 1121,
    "preview": "#!/usr/bin/env python\n\"\"\"\nAutocompletion example that displays the autocompletions like readline does by\nbinding a custo"
  },
  {
    "path": "examples/prompts/auto-completion/autocompletion.py",
    "chars": 1197,
    "preview": "#!/usr/bin/env python\n\"\"\"\nAutocompletion example.\n\nPress [Tab] to complete the current word.\n- The first Tab press fills"
  },
  {
    "path": "examples/prompts/auto-completion/colored-completions-with-formatted-text.py",
    "chars": 3759,
    "preview": "#!/usr/bin/env python\n\"\"\"\nDemonstration of a custom completer class and the possibility of styling\ncompletions independe"
  },
  {
    "path": "examples/prompts/auto-completion/colored-completions.py",
    "chars": 1938,
    "preview": "#!/usr/bin/env python\n\"\"\"\nDemonstration of a custom completer class and the possibility of styling\ncompletions independe"
  },
  {
    "path": "examples/prompts/auto-completion/combine-multiple-completers.py",
    "chars": 1388,
    "preview": "#!/usr/bin/env python\n\"\"\"\nExample of multiple individual completers that are combined into one.\n\"\"\"\n\nfrom prompt_toolkit"
  },
  {
    "path": "examples/prompts/auto-completion/fuzzy-custom-completer.py",
    "chars": 1369,
    "preview": "#!/usr/bin/env python\n\"\"\"\nDemonstration of a custom completer wrapped in a `FuzzyCompleter` for fuzzy\nmatching.\n\"\"\"\n\nfro"
  },
  {
    "path": "examples/prompts/auto-completion/fuzzy-word-completer.py",
    "chars": 1193,
    "preview": "#!/usr/bin/env python\n\"\"\"\nAutocompletion example.\n\nPress [Tab] to complete the current word.\n- The first Tab press fills"
  },
  {
    "path": "examples/prompts/auto-completion/multi-column-autocompletion-with-meta.py",
    "chars": 1211,
    "preview": "#!/usr/bin/env python\n\"\"\"\nAutocompletion example that shows meta-information alongside the completions.\n\"\"\"\n\nfrom prompt"
  },
  {
    "path": "examples/prompts/auto-completion/multi-column-autocompletion.py",
    "chars": 1092,
    "preview": "#!/usr/bin/env python\n\"\"\"\nSimilar to the autocompletion example. But display all the completions in multiple columns.\n\"\""
  },
  {
    "path": "examples/prompts/auto-completion/nested-autocompletion.py",
    "chars": 468,
    "preview": "#!/usr/bin/env python\n\"\"\"\nExample of nested autocompletion.\n\"\"\"\n\nfrom prompt_toolkit import prompt\nfrom prompt_toolkit.c"
  },
  {
    "path": "examples/prompts/auto-completion/slow-completions.py",
    "chars": 2649,
    "preview": "#!/usr/bin/env python\n\"\"\"\nAn example of how to deal with slow auto completion code.\n\n- Running the completions in a thre"
  },
  {
    "path": "examples/prompts/auto-suggestion.py",
    "chars": 1452,
    "preview": "#!/usr/bin/env python\n\"\"\"\nSimple example of a CLI that demonstrates fish-style auto suggestion.\n\nWhen you type some inpu"
  },
  {
    "path": "examples/prompts/autocorrection.py",
    "chars": 1095,
    "preview": "#!/usr/bin/env python\n\"\"\"\nExample of implementing auto correction while typing.\n\nThe word \"impotr\" will be corrected whe"
  },
  {
    "path": "examples/prompts/bottom-toolbar.py",
    "chars": 2326,
    "preview": "#!/usr/bin/env python\n\"\"\"\nA few examples of displaying a bottom toolbar.\n\nThe ``prompt`` function takes a ``bottom_toolb"
  },
  {
    "path": "examples/prompts/clock-input.py",
    "chars": 557,
    "preview": "#!/usr/bin/env python\n\"\"\"\nExample of a 'dynamic' prompt. On that shows the current time in the prompt.\n\"\"\"\n\nimport datet"
  },
  {
    "path": "examples/prompts/colored-prompt.py",
    "chars": 1786,
    "preview": "#!/usr/bin/env python\n\"\"\"\nExample of a colored prompt.\n\"\"\"\n\nfrom prompt_toolkit import prompt\nfrom prompt_toolkit.format"
  },
  {
    "path": "examples/prompts/confirmation-prompt.py",
    "chars": 214,
    "preview": "#!/usr/bin/env python\n\"\"\"\nExample of a confirmation prompt.\n\"\"\"\n\nfrom prompt_toolkit.shortcuts import confirm\n\nif __name"
  },
  {
    "path": "examples/prompts/cursor-shapes.py",
    "chars": 669,
    "preview": "#!/usr/bin/env python\n\"\"\"\nExample of cursor shape configurations.\n\"\"\"\n\nfrom prompt_toolkit import prompt\nfrom prompt_too"
  },
  {
    "path": "examples/prompts/custom-key-binding.py",
    "chars": 2254,
    "preview": "#!/usr/bin/env python\n\"\"\"\nExample of adding a custom key binding to a prompt.\n\"\"\"\n\nimport asyncio\n\nfrom prompt_toolkit i"
  },
  {
    "path": "examples/prompts/custom-lexer.py",
    "chars": 727,
    "preview": "#!/usr/bin/env python\n\"\"\"\nAn example of a custom lexer that prints the input text in random colors.\n\"\"\"\n\nfrom prompt_too"
  },
  {
    "path": "examples/prompts/custom-vi-operator-and-text-object.py",
    "chars": 2173,
    "preview": "#!/usr/bin/env python\n\"\"\"\nExample of adding a custom Vi operator and text object.\n(Note that this API is not guaranteed "
  },
  {
    "path": "examples/prompts/enforce-tty-input-output.py",
    "chars": 418,
    "preview": "#!/usr/bin/env python\n\"\"\"\nThis will display a prompt that will always use the terminal for input and\noutput, even if sys"
  },
  {
    "path": "examples/prompts/fancy-zsh-prompt.py",
    "chars": 2045,
    "preview": "#!/usr/bin/env python\n\"\"\"\nExample of the fancy ZSH prompt that @anki-code was using.\n\nThe theme is coming from the xonsh"
  },
  {
    "path": "examples/prompts/finalterm-shell-integration.py",
    "chars": 1309,
    "preview": "#!/usr/bin/env python\n\"\"\"\nMark the start and end of the prompt with Final term (iterm2) escape sequences.\nSee: https://i"
  },
  {
    "path": "examples/prompts/get-input-vi-mode.py",
    "chars": 273,
    "preview": "#!/usr/bin/env python\nfrom prompt_toolkit import prompt\n\nif __name__ == \"__main__\":\n    print(\"You have Vi keybindings h"
  },
  {
    "path": "examples/prompts/get-input-with-default.py",
    "chars": 335,
    "preview": "#!/usr/bin/env python\n\"\"\"\nExample of a call to `prompt` with a default value.\nThe input is pre-filled, but the user can "
  },
  {
    "path": "examples/prompts/get-input.py",
    "chars": 202,
    "preview": "#!/usr/bin/env python\n\"\"\"\nThe most simple prompt example.\n\"\"\"\n\nfrom prompt_toolkit import prompt\n\nif __name__ == \"__main"
  },
  {
    "path": "examples/prompts/get-multiline-input.py",
    "chars": 1005,
    "preview": "#!/usr/bin/env python\nfrom prompt_toolkit import prompt\nfrom prompt_toolkit.formatted_text import HTML\n\n\ndef prompt_cont"
  },
  {
    "path": "examples/prompts/get-password-with-toggle-display-shortcut.py",
    "chars": 767,
    "preview": "#!/usr/bin/env python\n\"\"\"\nget_password function that displays asterisks instead of the actual characters.\nWith the addit"
  },
  {
    "path": "examples/prompts/get-password.py",
    "chars": 173,
    "preview": "#!/usr/bin/env python\nfrom prompt_toolkit import prompt\n\nif __name__ == \"__main__\":\n    password = prompt(\"Password: \", "
  },
  {
    "path": "examples/prompts/history/persistent-history.py",
    "chars": 728,
    "preview": "#!/usr/bin/env python\n\"\"\"\nSimple example of a CLI that keeps a persistent history of all the entered\nstrings in a file. "
  },
  {
    "path": "examples/prompts/history/slow-history.py",
    "chars": 1367,
    "preview": "#!/usr/bin/env python\n\"\"\"\nSimple example of a custom, very slow history, that is loaded asynchronously.\n\nBy wrapping it "
  },
  {
    "path": "examples/prompts/html-input.py",
    "chars": 406,
    "preview": "#!/usr/bin/env python\n\"\"\"\nSimple example of a syntax-highlighted HTML input line.\n(This requires Pygments to be installe"
  },
  {
    "path": "examples/prompts/input-validation.py",
    "chars": 750,
    "preview": "#!/usr/bin/env python\n\"\"\"\nSimple example of input validation.\n\"\"\"\n\nfrom prompt_toolkit import prompt\nfrom prompt_toolkit"
  },
  {
    "path": "examples/prompts/inputhook.py",
    "chars": 2432,
    "preview": "#!/usr/bin/env python\n\"\"\"\nAn example that demonstrates how inputhooks can be used in prompt-toolkit.\n\nAn inputhook is a "
  },
  {
    "path": "examples/prompts/mouse-support.py",
    "chars": 378,
    "preview": "#!/usr/bin/env python\nfrom prompt_toolkit import prompt\n\nif __name__ == \"__main__\":\n    print(\n        \"This is multilin"
  },
  {
    "path": "examples/prompts/multiline-autosuggest.py",
    "chars": 5955,
    "preview": "#!/usr/bin/env python\n\"\"\"\nA more complex example of a CLI that demonstrates fish-style auto suggestion\nacross multiple l"
  },
  {
    "path": "examples/prompts/multiline-prompt.py",
    "chars": 289,
    "preview": "#!/usr/bin/env python\n\"\"\"\nDemonstration of how the input can be indented.\n\"\"\"\n\nfrom prompt_toolkit import prompt\n\nif __n"
  },
  {
    "path": "examples/prompts/no-wrapping.py",
    "chars": 195,
    "preview": "#!/usr/bin/env python\nfrom prompt_toolkit import prompt\n\nif __name__ == \"__main__\":\n    answer = prompt(\"Give me some in"
  },
  {
    "path": "examples/prompts/operate-and-get-next.py",
    "chars": 405,
    "preview": "#!/usr/bin/env python\n\"\"\"\nDemo of \"operate-and-get-next\".\n\n(Actually, this creates one prompt application, and keeps run"
  },
  {
    "path": "examples/prompts/patch-stdout.py",
    "chars": 919,
    "preview": "#!/usr/bin/env python\n\"\"\"\nAn example that demonstrates how `patch_stdout` works.\n\nThis makes sure that output from other"
  },
  {
    "path": "examples/prompts/placeholder-text.py",
    "chars": 388,
    "preview": "#!/usr/bin/env python\n\"\"\"\nExample of a placeholder that's displayed as long as no input is given.\n\"\"\"\n\nfrom prompt_toolk"
  },
  {
    "path": "examples/prompts/regular-language.py",
    "chars": 3155,
    "preview": "#!/usr/bin/env python\n\"\"\"\nThis is an example of \"prompt_toolkit.contrib.regular_languages\" which\nimplements a little cal"
  },
  {
    "path": "examples/prompts/rprompt.py",
    "chars": 1517,
    "preview": "#!/usr/bin/env python\n\"\"\"\nExample of a right prompt. This is an additional prompt that is displayed on\nthe right side of"
  },
  {
    "path": "examples/prompts/swap-light-and-dark-colors.py",
    "chars": 2015,
    "preview": "#!/usr/bin/env python\n\"\"\"\nDemonstration of swapping light/dark colors in prompt_toolkit using the\n`swap_light_and_dark_c"
  },
  {
    "path": "examples/prompts/switch-between-vi-emacs.py",
    "chars": 1030,
    "preview": "#!/usr/bin/env python\n\"\"\"\nExample that displays how to switch between Emacs and Vi input mode.\n\n\"\"\"\n\nfrom prompt_toolkit"
  },
  {
    "path": "examples/prompts/system-clipboard-integration.py",
    "chars": 609,
    "preview": "#!/usr/bin/env python\n\"\"\"\nDemonstration of a custom clipboard class.\nThis requires the 'pyperclip' library to be install"
  },
  {
    "path": "examples/prompts/system-prompt.py",
    "chars": 741,
    "preview": "#!/usr/bin/env python\nfrom prompt_toolkit import prompt\n\nif __name__ == \"__main__\":\n    # System prompt.\n    print(\n    "
  },
  {
    "path": "examples/prompts/terminal-title.py",
    "chars": 271,
    "preview": "#!/usr/bin/env python\nfrom prompt_toolkit import prompt\nfrom prompt_toolkit.shortcuts import set_title\n\nif __name__ == \""
  },
  {
    "path": "examples/prompts/up-arrow-partial-string-matching.py",
    "chars": 1216,
    "preview": "#!/usr/bin/env python\n\"\"\"\nSimple example of a CLI that demonstrates up-arrow partial string matching.\n\nWhen you type som"
  },
  {
    "path": "examples/prompts/with-frames/frame-and-autocompletion.py",
    "chars": 1269,
    "preview": "#!/usr/bin/env python\n\"\"\"\nExample of a frame around a prompt input that has autocompletion and a bottom\ntoolbar.\n\"\"\"\n\nfr"
  },
  {
    "path": "examples/prompts/with-frames/gray-frame-on-accept.py",
    "chars": 1344,
    "preview": "#!/usr/bin/env python\n\"\"\"\nExample of a frame around a prompt input that has autocompletion and a bottom\ntoolbar.\n\"\"\"\n\nfr"
  },
  {
    "path": "examples/prompts/with-frames/with-frame.py",
    "chars": 445,
    "preview": "#!/usr/bin/env python\n\"\"\"\nExample of a frame around a prompt input.\n\"\"\"\n\nfrom prompt_toolkit import prompt\nfrom prompt_t"
  },
  {
    "path": "examples/ssh/asyncssh-server.py",
    "chars": 3195,
    "preview": "#!/usr/bin/env python\n\"\"\"\nExample of running a prompt_toolkit application in an asyncssh server.\n\"\"\"\n\nimport asyncio\nimp"
  },
  {
    "path": "examples/telnet/chat-app.py",
    "chars": 2522,
    "preview": "#!/usr/bin/env python\n\"\"\"\nA simple chat application over telnet.\nEveryone that connects is asked for his name, and then "
  },
  {
    "path": "examples/telnet/dialog.py",
    "chars": 746,
    "preview": "#!/usr/bin/env python\n\"\"\"\nExample of a telnet application that displays a dialog window.\n\"\"\"\n\nimport logging\nfrom asynci"
  },
  {
    "path": "examples/telnet/hello-world.py",
    "chars": 980,
    "preview": "#!/usr/bin/env python\n\"\"\"\nA simple Telnet application that asks for input and responds.\n\nThe interaction function is a p"
  },
  {
    "path": "examples/telnet/toolbar.py",
    "chars": 1110,
    "preview": "#!/usr/bin/env python\n\"\"\"\nExample of a telnet application that displays a bottom toolbar and completions\nin the prompt.\n"
  },
  {
    "path": "examples/tutorial/README.md",
    "chars": 84,
    "preview": "See http://python-prompt-toolkit.readthedocs.io/en/stable/pages/tutorials/repl.html\n"
  },
  {
    "path": "examples/tutorial/sqlite-cli.py",
    "chars": 3600,
    "preview": "#!/usr/bin/env python\nimport sqlite3\nimport sys\n\nfrom pygments.lexers.sql import SqlLexer\n\nfrom prompt_toolkit import Pr"
  },
  {
    "path": "pyproject.toml",
    "chars": 4496,
    "preview": "[project]\nname = \"prompt_toolkit\"\nversion = \"3.0.52\" # Also update in `docs/conf.py`.\ndescription = \"Library for buildin"
  },
  {
    "path": "src/prompt_toolkit/__init__.py",
    "chars": 2088,
    "preview": "\"\"\"\nprompt_toolkit\n==============\n\nAuthor: Jonathan Slenders\n\nDescription: prompt_toolkit is a Library for building powe"
  },
  {
    "path": "src/prompt_toolkit/application/__init__.py",
    "chars": 657,
    "preview": "from __future__ import annotations\n\nfrom .application import Application\nfrom .current import (\n    AppSession,\n    crea"
  },
  {
    "path": "src/prompt_toolkit/application/application.py",
    "chars": 63279,
    "preview": "from __future__ import annotations\n\nimport asyncio\nimport contextvars\nimport os\nimport re\nimport signal\nimport sys\nimpor"
  },
  {
    "path": "src/prompt_toolkit/application/current.py",
    "chars": 6236,
    "preview": "from __future__ import annotations\n\nfrom collections.abc import Generator\nfrom contextlib import contextmanager\nfrom con"
  },
  {
    "path": "src/prompt_toolkit/application/dummy.py",
    "chars": 1628,
    "preview": "from __future__ import annotations\n\nfrom collections.abc import Callable\n\nfrom prompt_toolkit.eventloop import InputHook"
  },
  {
    "path": "src/prompt_toolkit/application/run_in_terminal.py",
    "chars": 3794,
    "preview": "\"\"\"\nTools for running functions on the terminal above the current application or prompt.\n\"\"\"\n\nfrom __future__ import ann"
  },
  {
    "path": "src/prompt_toolkit/auto_suggest.py",
    "chars": 5825,
    "preview": "\"\"\"\n`Fish-style <http://fishshell.com/>`_  like auto-suggestion.\n\nWhile a user types input in a certain buffer, suggesti"
  },
  {
    "path": "src/prompt_toolkit/buffer.py",
    "chars": 74540,
    "preview": "\"\"\"\nData structures for the Buffer.\nIt holds the text, cursor position, history, etc...\n\"\"\"\n\nfrom __future__ import anno"
  },
  {
    "path": "src/prompt_toolkit/cache.py",
    "chars": 3837,
    "preview": "from __future__ import annotations\n\nfrom collections import deque\nfrom collections.abc import Callable, Hashable\nfrom fu"
  },
  {
    "path": "src/prompt_toolkit/clipboard/__init__.py",
    "chars": 439,
    "preview": "from __future__ import annotations\n\nfrom .base import Clipboard, ClipboardData, DummyClipboard, DynamicClipboard\nfrom .i"
  },
  {
    "path": "src/prompt_toolkit/clipboard/base.py",
    "chars": 2524,
    "preview": "\"\"\"\nClipboard for command line interface.\n\"\"\"\n\nfrom __future__ import annotations\n\nfrom abc import ABCMeta, abstractmeth"
  },
  {
    "path": "src/prompt_toolkit/clipboard/in_memory.py",
    "chars": 1060,
    "preview": "from __future__ import annotations\n\nfrom collections import deque\n\nfrom .base import Clipboard, ClipboardData\n\n__all__ ="
  },
  {
    "path": "src/prompt_toolkit/clipboard/pyperclip.py",
    "chars": 1160,
    "preview": "from __future__ import annotations\n\nimport pyperclip\n\nfrom prompt_toolkit.selection import SelectionType\n\nfrom .base imp"
  },
  {
    "path": "src/prompt_toolkit/completion/__init__.py",
    "chars": 992,
    "preview": "from __future__ import annotations\n\nfrom .base import (\n    CompleteEvent,\n    Completer,\n    Completion,\n    Conditiona"
  },
  {
    "path": "src/prompt_toolkit/completion/base.py",
    "chars": 16112,
    "preview": "\"\"\" \"\"\"\n\nfrom __future__ import annotations\n\nfrom abc import ABCMeta, abstractmethod\nfrom collections.abc import AsyncGe"
  },
  {
    "path": "src/prompt_toolkit/completion/deduplicate.py",
    "chars": 1445,
    "preview": "from __future__ import annotations\n\nfrom collections.abc import Iterable\n\nfrom prompt_toolkit.document import Document\n\n"
  },
  {
    "path": "src/prompt_toolkit/completion/filesystem.py",
    "chars": 3958,
    "preview": "from __future__ import annotations\n\nimport os\nfrom collections.abc import Callable, Iterable\n\nfrom prompt_toolkit.comple"
  },
  {
    "path": "src/prompt_toolkit/completion/fuzzy_completer.py",
    "chars": 7765,
    "preview": "from __future__ import annotations\n\nimport re\nfrom collections.abc import Callable, Iterable, Sequence\nfrom typing impor"
  },
  {
    "path": "src/prompt_toolkit/completion/nested.py",
    "chars": 3855,
    "preview": "\"\"\"\nNestedcompleter for completion of hierarchical data structures.\n\"\"\"\n\nfrom __future__ import annotations\n\nfrom collec"
  },
  {
    "path": "src/prompt_toolkit/completion/word_completer.py",
    "chars": 3458,
    "preview": "from __future__ import annotations\n\nfrom collections.abc import Callable, Iterable, Mapping, Sequence\nfrom re import Pat"
  },
  {
    "path": "src/prompt_toolkit/contrib/__init__.py",
    "chars": 0,
    "preview": ""
  },
  {
    "path": "src/prompt_toolkit/contrib/completers/__init__.py",
    "chars": 103,
    "preview": "from __future__ import annotations\n\nfrom .system import SystemCompleter\n\n__all__ = [\"SystemCompleter\"]\n"
  },
  {
    "path": "src/prompt_toolkit/contrib/completers/system.py",
    "chars": 2057,
    "preview": "from __future__ import annotations\n\nfrom prompt_toolkit.completion.filesystem import ExecutableCompleter, PathCompleter\n"
  },
  {
    "path": "src/prompt_toolkit/contrib/regular_languages/__init__.py",
    "chars": 3279,
    "preview": "r\"\"\"\nTool for expressing the grammar of an input as a regular language.\n================================================"
  },
  {
    "path": "src/prompt_toolkit/contrib/regular_languages/compiler.py",
    "chars": 21979,
    "preview": "r\"\"\"\nCompiler for a regular grammar.\n\nExample usage::\n\n    # Create and compile grammar.\n    p = compile('add \\s+ (?P<va"
  },
  {
    "path": "src/prompt_toolkit/contrib/regular_languages/completion.py",
    "chars": 3477,
    "preview": "\"\"\"\nCompleter for a regular grammar.\n\"\"\"\n\nfrom __future__ import annotations\n\nfrom collections.abc import Iterable\n\nfrom"
  },
  {
    "path": "src/prompt_toolkit/contrib/regular_languages/lexer.py",
    "chars": 3424,
    "preview": "\"\"\"\n`GrammarLexer` is compatible with other lexers and can be used to highlight\nthe input using a regular grammar with a"
  },
  {
    "path": "src/prompt_toolkit/contrib/regular_languages/regex_parser.py",
    "chars": 7732,
    "preview": "\"\"\"\nParser for parsing a regular expression.\nTake a string representing a regular expression and return the root node of"
  }
]

// ... and 142 more files (download for full content)

About this extraction

This page contains the full source code of the prompt-toolkit/python-prompt-toolkit GitHub repository, extracted and formatted as plain text for AI agents and large language models (LLMs). The extraction includes 342 files (1.9 MB), approximately 495.8k tokens, and a symbol index with 2418 extracted functions, classes, methods, constants, and types. Use this with OpenClaw, Claude, ChatGPT, Cursor, Windsurf, or any other AI tool that accepts text input. You can copy the full output to your clipboard or download it as a .txt file.

Extracted by GitExtract — free GitHub repo to text converter for AI. Built by Nikandr Surkov.

Copied to clipboard!