Skip to content

Update dependency prompt-toolkit to v3#328

Open
renovate[bot] wants to merge 1 commit intomasterfrom
renovate/prompt-toolkit-3.x
Open

Update dependency prompt-toolkit to v3#328
renovate[bot] wants to merge 1 commit intomasterfrom
renovate/prompt-toolkit-3.x

Conversation

@renovate
Copy link

@renovate renovate bot commented Dec 26, 2020

WhiteSource Renovate

This PR contains the following updates:

Package Change Age Adoption Passing Confidence
prompt-toolkit ==1.0.14 -> ==3.0.29 age adoption passing confidence

Release Notes

prompt-toolkit/python-prompt-toolkit

v3.0.29

Compare Source

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.

v3.0.28

Compare Source

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.

v3.0.27

Compare Source

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.

v3.0.26

Compare Source

Fixes:

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

v3.0.25

Compare Source

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.

v3.0.24

Compare Source

Fixes:

  • Prevent window content overflowing when using scrollbars.
  • Handle PermissionError when trying to attach /dev/null in vt100 input.

v3.0.23

Compare Source

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.

v3.0.22

Compare Source

Fixes:

  • Fix stopping of telnet server (capture cancellation exception).

v3.0.21

Compare Source

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.

v3.0.20

Compare Source

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

v3.0.19

Compare Source

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

v3.0.18

Compare Source

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

v3.0.17

Compare Source

New features:

  • Accept style parameter in print_container utility.
  • On Windows, handle Control-Delete.

Fixes:

  • Avoid leaking file descriptors in SSH server.

v3.0.16

Compare Source

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.

v3.0.15

Compare Source

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.

v3.0.14

Compare Source

New features:

  • Disable bell when PROMPT_TOOLKIT_BELL=false environment variable has been
    set.

Fixes:

  • Improve cancellation of history loading.

v3.0.13

Compare Source

Fixes:

  • Again, fixed the race condition in ThreadedHistory. Previous fix was not
    correct.

v3.0.12

Compare Source

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

v3.0.11

Compare Source

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.

v3.0.10

Compare Source

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.

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

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

v3.0.7

Compare Source

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

v3.0.6

Compare Source

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

v3.0.5

Compare Source

Fixes:

  • Bugfix in mouse handling on Windows.

v3.0.4

Compare Source

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.

v3.0.3

Compare Source

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.

v3.0.2

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.

v3.0.1

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

v3.0.0

Compare Source

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.

v2.0.10

Compare Source

v2.0.9

Compare Source

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.

v2.0.8

Compare Source

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 significat 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).

v2.0.7

Compare Source

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.

v2.0.6

Compare Source

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.

v2.0.5

Compare Source

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.

v2.0.4

Compare Source

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.

v2.0.3

Compare Source

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.

v2.0.2

Compare Source

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.

v2.0.1

Compare Source

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

v1.0.18

Compare Source

v1.0.17

Compare Source

v1.0.16

Compare Source

v1.0.15

Compare Source


Configuration

📅 Schedule: At any time (no schedule defined).

🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.

Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 Ignore: Close this PR and you won't be reminded about this update again.


  • If you want to rebase/retry this PR, click this checkbox.

This PR has been generated by WhiteSource Renovate. View repository job log here.

@renovate renovate bot force-pushed the renovate/prompt-toolkit-3.x branch 2 times, most recently from 66672dd to 889f5cf Compare January 9, 2021 17:59
@renovate renovate bot force-pushed the renovate/prompt-toolkit-3.x branch 3 times, most recently from f20aa1d to 29250a3 Compare January 24, 2021 10:39
@renovate renovate bot force-pushed the renovate/prompt-toolkit-3.x branch 2 times, most recently from 6240986 to 2b3df8a Compare February 11, 2021 13:25
@renovate renovate bot force-pushed the renovate/prompt-toolkit-3.x branch 3 times, most recently from 60c2dc3 to 49a74c7 Compare March 26, 2021 23:32
@renovate renovate bot changed the title Update dependency prompt-toolkit to v3 Update dependency prompt-toolkit to v3 - autoclosed Jun 8, 2021
@renovate renovate bot closed this Jun 8, 2021
@renovate renovate bot deleted the renovate/prompt-toolkit-3.x branch June 8, 2021 10:37
@renovate renovate bot changed the title Update dependency prompt-toolkit to v3 - autoclosed Update dependency prompt-toolkit to v3 Jun 8, 2021
@renovate renovate bot restored the renovate/prompt-toolkit-3.x branch June 8, 2021 11:18
@renovate renovate bot reopened this Jun 8, 2021
@renovate renovate bot force-pushed the renovate/prompt-toolkit-3.x branch from 49a74c7 to 287367b Compare June 8, 2021 11:19
@renovate renovate bot force-pushed the renovate/prompt-toolkit-3.x branch from 287367b to 0a631d2 Compare June 18, 2021 12:51
@renovate renovate bot force-pushed the renovate/prompt-toolkit-3.x branch from 0a631d2 to 921637d Compare August 20, 2021 12:35
@renovate renovate bot force-pushed the renovate/prompt-toolkit-3.x branch 3 times, most recently from 1eaf2dd to b68b72f Compare August 31, 2021 10:48
@renovate renovate bot force-pushed the renovate/prompt-toolkit-3.x branch from b68b72f to 284fdcc Compare October 21, 2021 20:43
@renovate renovate bot force-pushed the renovate/prompt-toolkit-3.x branch from 284fdcc to b34194a Compare March 7, 2022 09:09
@renovate renovate bot force-pushed the renovate/prompt-toolkit-3.x branch from b34194a to 5fed943 Compare April 25, 2022 03:01
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