NewYour coding agent can read the release notes before it upgrades.Set up the MCP server →
PyPI · #151 most downloaded on PyPI
Library for building powerful interactive command lines in Python
Last release 2 months ago
26 Jul 2026
Ships fairly regularly
a new release about every 4 months
Nearly every release is documented
notes for 56 of the last 60 stable releases
Nothing withdrawn
no release was ever pulled
12 years old
137 releases · first in 2014
Fix get_word_before_cursor behavior.
Fixes:
New features:
__version__.show_numbers in ChoiceInput.Added support for Python 3.14, 3.15, and set minimum Python version to 3.10.
Add choice() shortcut for selecting an option amongst a list of choices (see documentation for examples).
New features:
choice() shortcut for selecting an option amongst a list of choices (see documentation for examples).frame=... option for prompt() and choice() shortcuts to allow for displaying a frame around the input prompt.Fixes:
One column per quarter.
Use pyproject.toml instead of setup.py.
New features:
Fixes:
formatted_text.split_lines when the input starts with a line ending.Fixes non user impacting regression on the output rendering. Don't render cursor hide/show ANSI escape codes if not needed.
Fixes:
On Windows, use virtual terminal input when available.
New features:
Fixes:
InvalidStateError during termination when usingrun_in_terminal/patch_stdout. This can happen in some cases duringerase_when_done isBreaking changes:
Add @overload to contrib.regular_languages.compiler.Variables.get .
Fixes:
@overload to contrib.regular_languages.compiler.Variables.get.Sequence instead of list for words argument in completers.ModalCursorShapeConfig:
Allow passing exception classes for KeyboardInterrupt and EOFError in PromptSession .
New features:
KeyboardInterrupt and EOFError in PromptSession.Fixes:
Box widget lazily.Fix pytest capsys fixture compatibility.
Fixes:
Improve performance of GrammarCompleter (faster deduplication of completions).
Fixes:
GrammarCompleter (faster deduplication of completions).Accept os.PathLike in FileHistory (typing fix).
New features:
os.PathLike in FileHistory (typing fix).Fixes:
Fix regression on Pypy: Don't use ctypes.pythonapi to restore SIGINT if not available.
Fixes regression from 3.0.42:
ctypes.pythonapi to restore SIGINT if not available.Other changes from 3.0.42:
patch_stdout on Windows.formatted_text.split_lines() accept an iterable instead of lists only.Fix line wrapping in patch_stdout on Windows.
Fixes:
patch_stdout on Windows.formatted_text.split_lines() accept an iterable instead of lists only.Fix regression regarding IPython input hook (%gui) integration.
Fixes:
Improved Python 3.12 support (fixes event loop DeprecationWarning).
Fixes:
DeprecationWarning).New features:
control-t and control-d for indent/unindent in insert
mode.control+right is pressed, similar to Fish.Fix RuntimeError when __breakpointhook__ is called from another thread.
Fixes:
RuntimeError when __breakpointhook__ is called from another thread.New features:
in_thread keyword in prompt_toolkit.shortcuts.prompt().NO_COLOR environment variable.Fix regression in filters. (Use of WeakValueDictionary caused filters to not be cached).
Fixes:
WeakValueDictionary caused filters to
not be cached).New features:
Fix currentThread() deprecation warning.
Bug fixes:
currentThread() deprecation warning.New features:
.run() method in TelnetServer. (To be used instead of
.start()/.stop().Breaking changes:
Filter have to call super() in their __init__.get_running_loop() instead of get_event_loop().asyncio.run() instead of asyncio.run_until_complete().Another Python 3.6 fix for a bug that was introduced in 3.0.34.
Fixes:
Fix bug introduced in 3.0.34 for Python 3.6. Use asynccontextmanager implementation from prompt_toolkit itself.
Fixes:
Improve completion performance in various places.
Fixes:
KeyboardInterrupt when the stacktrace of an unhandled error is
displayed.Application.create_background_task().show_cursor attribute in ScrollablePane.Improve termination of Application. Don't suppress CancelledError. This fixes a race condition when an Application gets cancelled while we're waiting
Fixes:
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.OneStyleAndTextTuple.CombinedRegistry. Fixed missing @property.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
Bug fixes:
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.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:
cancel_callback in ProgressBar to specify the cancellation
behavior for when control-c is pressed.Pass through name property in TextArea widget to Buffer.
New features:
name property in TextArea widget to Buffer.enable_cpr parameter to Vt100_Output, TelnetServer and
PromptToolkitSSHServer, to completely disable CPR support instead of
automatically detecting it.Allow zero-width-escape sequences in print_formatted_text.
New features:
print_formatted_text.has_suggestion filter.Fixes:
renderer_print_formatted_text in a Jupyter Notebook.Accept 'handle_sigint' parameter in PromptSession.
New features:
Fixes
handle_sigint from Application.run to Application.run_async.print_container utility (handle EOFError).Breaking changes:
create_pipe_input, PosixPipeInput and Win32PipeInput.Support format specifiers for HTML and ANSI formatted text.
New features:
Fixes:
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 mod
New features:
align attribute in Label widget.PlainTextOutput: an output implementation that doesn't render any
ANSI escape sequences. This will be used by default when redirecting stdout
to a file.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.to_plain_text utility for converting formatted text into plain text.Fixes:
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.Fixes issue introduced in 3.0.25: Don't handle SIGINT on Windows.
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 an
Fixes:
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.Application._is_running flag in case of exceptions in some
situations.slow_duration_callback by default to 0.5. This
prevents printing warnings if rendering takes too long on slow systems.Prevent window content overflowing when using scrollbars.
Fixes:
PermissionError when trying to attach /dev/null in vt100 input.Fix multiline bracketed paste on Windows
Fixes:
New features:
Fix stopping of telnet server (capture cancellation exception).
Fixes:
Support for click-drag, which is useful for selecting text.
New features:
Add support for strikethrough text attributes.
New features:
Fixes:
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.)Make the flush method of the vt100 output implementation re-entrant (fixes an issue when using aiogevent).
Fixes:
FormattedTextControl mouse logic.print_container always in a thread (avoid interfering with possible
event loop).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
New features:
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.)Accept style parameter in print_container utility.
New features:
style parameter in print_container utility.Fixes:
Added ScrollablePane: a scrollable layout container. This allows applications to build a layout, larger than the terminal, with a vertical scroll bar.
New features:
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.DeduplicateCompleter and ConditionalCompleter`.deduplicate argument to merge_completers.Set stdout blocking when writing in vt100 output. Fixes an issue when uvloop is used and big amounts of text are written.
Fixes:
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.SIGWINCH in progress bar anymore. (The UI runs in another
thread, and we have terminal size polling now).Application.invalidate(). (Fixes a
RuntimeError in some situations when using progress bars.)QUICK_EDIT_MODE on Windows 10 when mouse support is requested.Disable bell when PROMPT_TOOLKIT_BELL=false environment variable has been set.
New features:
PROMPT_TOOLKIT_BELL=false environment variable has been
set.Fixes:
Again, fixed the race condition in ThreadedHistory. Previous fix was not correct.
Fixes:
ThreadedHistory. Previous fix was not
correct.Fixed a race condition in ThreadedHistory that happens when continuously pasting input text (which would continuously repopulate the history).
Fixes:
ThreadedHistory that happens when continuously
pasting input text (which would continuously repopulate the history).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
New features:
Fixes:
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.raw argument of PatchStdout.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.Improved WordCompleter: accept display_dict. Also accept formatted text for both display_dict and meta_dict.
New features:
WordCompleter: accept display_dict. Also accept formatted text
for both display_dict and meta_dict.Fixes:
Prevent asyncio deprecation warnings.
New features:
Fixes:
print_formatted_text. (Don't render styling
attributes to output between fragments that have identical styling.)FileHistory decoding errors.Added validator parameter to input_dialog.
New features:
validator parameter to input_dialog.Fixes:
fileno.isatty method was not implemented.to_formatted_text.Document._is_word_before_cursor_complete.
Fixes some key bindings.ProgressBarCounter in shortcuts module.New "placeholder" parameter added to PromptSession.
New features:
PromptSession.Other changes:
Input to Output
classes (this does clean up some code).Fixes:
FormattedTextControl when line wrapping is turned
on.BrokenPipeError.The SSH/Telnet adaptors have been refactored and improved in several ways. See issues #876 and PR #1150 and #1184 on GitHub.
New features:
PosixPipeInput and
Win32PipeInput).Output
implementations. Added get_default_color_depth method to Output
objects.REPLACE_SINGLE input mode for Vi key bindings.KeyPressEvent in key_binding/init.py (often used in type
annotations).Fixes:
sys.stdin.encoding for decoding stdin stream.Bugfix in mouse handling on Windows.
Fixes:
Added many more vt100 ANSI sequences and keys.
New features:
set_exception_handler optional argument to PromptSession.prompt().Fixes:
PromptSession was invalidating the UI
continuously.call_soon_threadsafe).set_exception_handler in Application.run to the run_async call.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.Improved support for "dumb" terminals.
New features:
ProgressBarCounter.stopped.scroll_offset, min_brightness and max_brightness.always_prefer_tty parameters to create_input() and create_output().Application.run() if get_event_loop() raises
Runtimeerror.Fixes:
RuntimeError in the progress bar code.line-number.current style. (was current-line-number.)get_size).invalidate() if the application is not running.Bugfix in the UI invalidation. Fixes an issue when the application runs again on another event loop. See: https://github.com/ipython/ipython/pull/1197
Fixes:
Added new_eventloop_with_inputhook function.
New features:
new_eventloop_with_inputhook function.Application.run_async.Fixes:
History classes.
(Fix for special situations when a ThreadedHistory is created before the
event loop has been set up.)Buffer tempfile code.Native asyncio instead of custom event loops.
New features:
Breaking changes:
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.Application. You still have to call either run() or run_async on the
Application object.patch_stdout now requires an Application as input.Nothing published for this version
Fixed Application.run_system_command on Windows.
Bug fixes:
Application.run_system_command on Windows.Fixes the issue where changes made to the buffer in the accept handler were not reflected in the history.
Bug fixes:
print_container utility work if the input is not a pty.New features:
READLINE_LIKE display method.FuzzyCompleter and FuzzyWordCompleter.Fixed assertion in PromptSession: the style_transformation check was wrong.
Bug fixes:
prompt() method. This fixes the issue that passing default once, will
store it for all consequent calls in the PromptSession.__pt_formatted_text__ always returns a FormattedText
instance. This fixes an issue with print_formatted_text.New features:
print_container utility.collections.abc.Sequence for HSplit/VSplit children (instead of
lists only).Backwards incompatible changes:
Bug fixes:
Backwards incompatible changes:
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:
AdjustBrightnessStyleTransformation. This is a simple style
transformation that improves the rendering on terminals with light or dark
background.TextArea:
focus_on_click.auto_suggest, complete_while_typing, history,
get_line_prefix, input_processors.lexer, completer, complete_while_typing,
accept_handler, read_only, wrap_lines.Backwards incompatible changes:
Bug fixes:
DynamicContainer. Return correct result for get_children. This
fixes a bug related to focusing.start, end and sym_b characters of
progress bar.Backwards incompatible changes:
PromptSession attributes when exiting prompt.New features:
get_line_prefix attribute to window. This opens many
possibilities:
swap_light_and_dark_colors parameter to
prompt() function.format() method to ANSI formatted text.pre_run argument to PromptSession.prompt() method.Your coding agent can read these notes before it upgrades. Set up the MCP server →