Skip to content

Update prompt-toolkit to 3.0.27 #2164

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from

Conversation

pyup-bot
Copy link
Collaborator

@pyup-bot pyup-bot commented Feb 7, 2022

This PR updates prompt-toolkit from 3.0.7 to 3.0.27.

Changelog

3.0.27

------------------

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

------------------

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

3.0.25

------------------

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

------------------

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

3.0.23

------------------

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

------------------

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

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

------------------

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

------------------

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

------------------

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

------------------

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

------------------

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

------------------

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

------------------

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

Fixes:
- Improve cancellation of history loading.

3.0.13

------------------

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

3.0.12

------------------

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

3.0.11

------------------

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

------------------

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

-----------------

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

-----------------

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

@pyup-bot
Copy link
Collaborator Author

Closing this in favor of #2171

@pyup-bot pyup-bot closed this Feb 11, 2022
@renzon renzon deleted the pyup-update-prompt-toolkit-3.0.7-to-3.0.27 branch February 11, 2022 12:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant