Prompt-toolkit

Latest version: v3.0.43

Safety actively analyzes 629599 Python packages for vulnerabilities to keep your Python projects secure.

Scan your dependencies

Page 12 of 21

0.58

Not secure
----------------

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

Not secure
----------------

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

Not secure
----------------

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

0.55

Not secure
----------------

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

Not secure
----------------

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

Not secure
----------------

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

Page 12 of 21

© 2024 Safety CLI Cybersecurity Inc. All Rights Reserved.