pypi / prompt-toolkit
prompt-toolkit
What changed in prompt-toolkit 1 to 3, from its official release notes, upgrade guides and advisories. Sources checked 2026-11-30.
15 breaking3 deprecations15 new APIs and options2 performance4 behavior and defaults14 fixes and other
See which of these apply to your code, ranked, in your agent:
npx @unstale/cli initprompt-toolkit 311 changes
Breaking changes 2
Adds support for Python 3.14 and 3.15 and sets the minimum Python version to 3.10.
Sets a missing minimum requirement for wcwidth.
New APIs and options 1
Allows specifying show_numbers in ChoiceInput.
Performance 1
Loads __version__ lazily.
Fixes and other changes 7
Treats OSError from add_reader as EOFError on macOS kqueue.
Updates return types to include None when a dialog shortcut is cancelled.
Handles surrogate pairs when storing strings in file history.
Updates the meta_dict type hint to match WordCompleter.
Fixes the behavior of get_word_before_cursor.
Handles ASCII decode errors when decoding terminal types in the telnet protocol.
Fixes the 6x6x6 color cube range and adds missing grayscale shades 232 and 254–255.
prompt-toolkit 142 changes
Breaking changes 13
The on_invalidate callback moved from CommandLineInterface to Application.
The default Buffer in Application now uses IGNORE; pass RETURN_DOCUMENT for the previous behavior.
An EventLoop instance is now always expected rather than created in __init__.
editing_mode is now a CommandLineInterface property, replacing the vi_mode parameter in KeyBindingManager.
The current buffer is no longer reset by default; pass reset_current_buffer=True to reset it.
Callback was renamed to Event, and events should now receive one argument: the sender.
Selection mode is entered only when the current buffer is not empty.
SelectedText now reverses highlighted colors by default; style Token.SelectedText to set fixed foreground and background.
The Vi < and > key bindings became operators.
Application loads Vi bindings by default when no registry is given.
Implemented Vi digraphs; ControlK now inserts a digraph.
Vi motions now handle inclusive and linewise motions properly; several motions were adjusted to match Vim behavior.
Bracket motions now find enclosing brackets rather than the next bracket, and text objects and motions use separate bindings.
Deprecations 3
Renamed MouseEventTypes to MouseEventType; the old name remains valid but is deprecated.
Renamed PipeInput.send to PipeInput.send_text; the old name remains as a deprecated alias.
ViStateFilter is deprecated; use the filters defined in prompt_toolkit.filters.
New APIs and options 14
Added the ap auto-paragraph text object.
Implemented colorcolumn as a visual feature.
Implemented the control-backslash Emacs key binding.
Implemented cursorcolumn as a visual feature.
Implemented cursorline as a visual feature.
Added the DummyOutput class.
Added the Vi gm key binding.
Implemented the Vi gq key binding to reshape text.
Mouse bindings are separated into load_mouse_bindings.
Implemented the meta-* Emacs key binding.
Vi mode now supports named registers.
Renamed SimpleLexer.default_token to SimpleLexer.token, with backward compatibility.
Implemented the Vi tilde_operator.
Vi mode now supports named registers.
Performance 1
Uses the bisect module instead of a custom binary search to improve performance.
Behavior and default changes 4
Menu space is reserved only when complete_while_typing=True or when completions are available to display.
Emacs key bindings now recognize ControlDelete.
A default token is now provided for SearchToolbar.
A default token is now provided for SystemToolbar.
Fixes and other changes 7
Decomposed Unicode characters are now handled.
Fixed behavior when an argument is given.
PipeInput is closed after usage.
Now handles negative values.
Repeated up/down movements stay in the same column.
Copy and paste behavior in Vi mode was improved.
The parameter is no longer ignored.