diff -Nru prompt-toolkit-1.0.14/CHANGELOG prompt-toolkit-1.0.15/CHANGELOG --- prompt-toolkit-1.0.14/CHANGELOG 2017-03-26 18:34:55.000000000 +0000 +++ prompt-toolkit-1.0.15/CHANGELOG 2017-07-27 10:03:08.000000000 +0000 @@ -1,6 +1,21 @@ CHANGELOG ========= +1.0.15: 2017-07-27 +------------------ + +Fixes: +- Don't shuffle tasks in the event loop. This fixes an issue where lines + printed from background threads were printed in a different order if + `patch_stdout=True`. +- Only consider the text before the cursor when activating history search. +- Pressing escape should accept the search, this is closer to how readline works. +- Enable autowrap again when required. + +New features: +- Add run_in_terminal option to disable cooked mode. + + 1.0.14: 2017-03-26 ------------------ diff -Nru prompt-toolkit-1.0.14/debian/changelog prompt-toolkit-1.0.15/debian/changelog --- prompt-toolkit-1.0.14/debian/changelog 2017-06-18 05:04:10.000000000 +0000 +++ prompt-toolkit-1.0.15/debian/changelog 2018-01-08 21:43:40.000000000 +0000 @@ -1,3 +1,10 @@ +prompt-toolkit (1.0.15-1) unstable; urgency=medium + + * New upstream release + * Bump standards-version to 4.1.3 without further change + + -- Scott Kitterman Mon, 08 Jan 2018 16:43:40 -0500 + prompt-toolkit (1.0.14-1) unstable; urgency=medium * New upstream release diff -Nru prompt-toolkit-1.0.14/debian/control prompt-toolkit-1.0.15/debian/control --- prompt-toolkit-1.0.14/debian/control 2016-11-11 01:49:46.000000000 +0000 +++ prompt-toolkit-1.0.15/debian/control 2018-01-08 21:43:37.000000000 +0000 @@ -18,7 +18,7 @@ python3-setuptools, python3-six (>=1.9.0), python3-wcwidth -Standards-Version: 3.9.8 +Standards-Version: 4.1.3 Package: python-prompt-toolkit Architecture: all diff -Nru prompt-toolkit-1.0.14/PKG-INFO prompt-toolkit-1.0.15/PKG-INFO --- prompt-toolkit-1.0.14/PKG-INFO 2017-03-26 18:36:28.000000000 +0000 +++ prompt-toolkit-1.0.15/PKG-INFO 2017-07-27 10:08:26.000000000 +0000 @@ -1,6 +1,6 @@ Metadata-Version: 1.1 Name: prompt_toolkit -Version: 1.0.14 +Version: 1.0.15 Summary: Library for building powerful interactive command lines in Python Home-page: https://github.com/jonathanslenders/python-prompt-toolkit Author: Jonathan Slenders @@ -137,6 +137,7 @@ - `http-prompt `_: An interactive command-line HTTP client. - `coconut `_: Functional programming in Python. - `Ergonomica `_: A Bash alternative written in Python. + - `Kube-shell `_: Kubernetes shell: An integrated shell for working with the Kubernetes CLI Full screen applications: diff -Nru prompt-toolkit-1.0.14/prompt_toolkit/buffer.py prompt-toolkit-1.0.15/prompt_toolkit/buffer.py --- prompt-toolkit-1.0.14/prompt_toolkit/buffer.py 2017-03-26 17:48:14.000000000 +0000 +++ prompt-toolkit-1.0.15/prompt_toolkit/buffer.py 2017-07-26 15:11:12.000000000 +0000 @@ -849,7 +849,7 @@ """ Set `history_search_text`. """ if self.enable_history_search(): if self.history_search_text is None: - self.history_search_text = self.text + self.history_search_text = self.document.text_before_cursor else: self.history_search_text = None diff -Nru prompt-toolkit-1.0.14/prompt_toolkit/eventloop/posix.py prompt-toolkit-1.0.15/prompt_toolkit/eventloop/posix.py --- prompt-toolkit-1.0.14/prompt_toolkit/eventloop/posix.py 2017-03-26 17:48:14.000000000 +0000 +++ prompt-toolkit-1.0.15/prompt_toolkit/eventloop/posix.py 2017-07-26 15:11:12.000000000 +0000 @@ -1,7 +1,6 @@ from __future__ import unicode_literals import fcntl import os -import random import signal import threading import time @@ -153,10 +152,6 @@ if handler: tasks.append(handler) - # Handle everything in random order. (To avoid starvation.) - random.shuffle(tasks) - random.shuffle(low_priority_tasks) - # When there are high priority tasks, run all these. # Schedule low priority tasks for the next iteration. if tasks: diff -Nru prompt-toolkit-1.0.14/prompt_toolkit/__init__.py prompt-toolkit-1.0.15/prompt_toolkit/__init__.py --- prompt-toolkit-1.0.14/prompt_toolkit/__init__.py 2017-03-26 18:35:14.000000000 +0000 +++ prompt-toolkit-1.0.15/prompt_toolkit/__init__.py 2017-07-27 10:03:23.000000000 +0000 @@ -19,4 +19,4 @@ # Don't forget to update in `docs/conf.py`! -__version__ = '1.0.14' +__version__ = '1.0.15' diff -Nru prompt-toolkit-1.0.14/prompt_toolkit/interface.py prompt-toolkit-1.0.15/prompt_toolkit/interface.py --- prompt-toolkit-1.0.14/prompt_toolkit/interface.py 2017-03-26 17:48:14.000000000 +0000 +++ prompt-toolkit-1.0.15/prompt_toolkit/interface.py 2017-07-26 15:11:12.000000000 +0000 @@ -611,7 +611,7 @@ if self.eventloop: self.eventloop.stop() - def run_in_terminal(self, func, render_cli_done=False): + def run_in_terminal(self, func, render_cli_done=False, cooked_mode=True): """ Run function on the terminal above the prompt. @@ -624,6 +624,8 @@ :param render_cli_done: When True, render the interface in the 'Done' state first, then execute the function. If False, erase the interface first. + :param cooked_mode: When True (the default), switch the input to + cooked mode while executing the function. :returns: the result of `func`. """ @@ -637,7 +639,10 @@ self._return_value = None # Run system command. - with self.input.cooked_mode(): + if cooked_mode: + with self.input.cooked_mode(): + result = func() + else: result = func() # Redraw interface again. diff -Nru prompt-toolkit-1.0.14/prompt_toolkit/key_binding/bindings/emacs.py prompt-toolkit-1.0.15/prompt_toolkit/key_binding/bindings/emacs.py --- prompt-toolkit-1.0.14/prompt_toolkit/key_binding/bindings/emacs.py 2017-03-26 17:48:14.000000000 +0000 +++ prompt-toolkit-1.0.15/prompt_toolkit/key_binding/bindings/emacs.py 2017-07-26 15:11:12.000000000 +0000 @@ -375,6 +375,7 @@ event.cli.pop_focus() @handle(Keys.ControlJ, filter=has_focus) + @handle(Keys.Escape, filter=has_focus, eager=True) def _(event): """ When enter pressed in isearch, quit isearch mode. (Multiline diff -Nru prompt-toolkit-1.0.14/prompt_toolkit/key_binding/bindings/vi.py prompt-toolkit-1.0.15/prompt_toolkit/key_binding/bindings/vi.py --- prompt-toolkit-1.0.14/prompt_toolkit/key_binding/bindings/vi.py 2017-03-26 17:48:14.000000000 +0000 +++ prompt-toolkit-1.0.15/prompt_toolkit/key_binding/bindings/vi.py 2017-07-26 15:11:12.000000000 +0000 @@ -1808,6 +1808,7 @@ event.cli.vi_state.input_mode = InputMode.INSERT @handle(Keys.ControlJ, filter=has_focus) + @handle(Keys.Escape, filter=has_focus) def _(event): """ Apply the search. (At the / or ? prompt.) @@ -1857,7 +1858,6 @@ """ Returns True when the search buffer is empty. """ return cli.buffers[search_buffer_name].text == '' - @handle(Keys.Escape, filter=has_focus) @handle(Keys.ControlC, filter=has_focus) @handle(Keys.ControlH, filter=has_focus & Condition(search_buffer_is_empty)) @handle(Keys.Backspace, filter=has_focus & Condition(search_buffer_is_empty)) diff -Nru prompt-toolkit-1.0.14/prompt_toolkit/renderer.py prompt-toolkit-1.0.15/prompt_toolkit/renderer.py --- prompt-toolkit-1.0.14/prompt_toolkit/renderer.py 2017-03-26 17:48:14.000000000 +0000 +++ prompt-toolkit-1.0.15/prompt_toolkit/renderer.py 2017-07-26 15:11:12.000000000 +0000 @@ -21,7 +21,8 @@ def _output_screen_diff(output, screen, current_pos, previous_screen=None, last_token=None, - is_done=False, attrs_for_token=None, size=None, previous_width=0): # XXX: drop is_done + is_done=False, use_alternate_screen=False, attrs_for_token=None, size=None, + previous_width=0): # XXX: drop is_done """ Render the diff between this screen and the previous screen. @@ -108,11 +109,17 @@ write(char.char) last_token[0] = char.token - # Disable autowrap + # Render for the first time: reset styling. if not previous_screen: - output.disable_autowrap() reset_attributes() + # Disable autowrap. (When entering a the alternate screen, or anytime when + # we have a prompt. - In the case of a REPL, like IPython, people can have + # background threads, and it's hard for debugging if their output is not + # wrapped.) + if not previous_screen or not use_alternate_screen: + output.disable_autowrap() + # When the previous screen has a different size, redraw everything anyway. # Also when we are done. (We meight take up less rows, so clearing is important.) if is_done or not previous_screen or previous_width != width: # XXX: also consider height?? @@ -187,7 +194,7 @@ else: current_pos = move_cursor(screen.cursor_position) - if is_done: + if is_done or not use_alternate_screen: output.enable_autowrap() # Always reset the color attributes. This is important because a background @@ -437,6 +444,7 @@ self._cursor_pos, self._last_token = _output_screen_diff( output, screen, self._cursor_pos, self._last_screen, self._last_token, is_done, + use_alternate_screen=self.use_alternate_screen, attrs_for_token=self._attrs_for_token, size=size, previous_width=(self._last_size.columns if self._last_size else 0)) @@ -472,6 +480,7 @@ output.cursor_up(self._cursor_pos.y) output.erase_down() output.reset_attributes() + output.enable_autowrap() output.flush() # Erase title. diff -Nru prompt-toolkit-1.0.14/prompt_toolkit.egg-info/PKG-INFO prompt-toolkit-1.0.15/prompt_toolkit.egg-info/PKG-INFO --- prompt-toolkit-1.0.14/prompt_toolkit.egg-info/PKG-INFO 2017-03-26 18:36:28.000000000 +0000 +++ prompt-toolkit-1.0.15/prompt_toolkit.egg-info/PKG-INFO 2017-07-27 10:08:26.000000000 +0000 @@ -1,6 +1,6 @@ Metadata-Version: 1.1 Name: prompt-toolkit -Version: 1.0.14 +Version: 1.0.15 Summary: Library for building powerful interactive command lines in Python Home-page: https://github.com/jonathanslenders/python-prompt-toolkit Author: Jonathan Slenders @@ -137,6 +137,7 @@ - `http-prompt `_: An interactive command-line HTTP client. - `coconut `_: Functional programming in Python. - `Ergonomica `_: A Bash alternative written in Python. + - `Kube-shell `_: Kubernetes shell: An integrated shell for working with the Kubernetes CLI Full screen applications: diff -Nru prompt-toolkit-1.0.14/README.rst prompt-toolkit-1.0.15/README.rst --- prompt-toolkit-1.0.14/README.rst 2017-03-08 19:52:07.000000000 +0000 +++ prompt-toolkit-1.0.15/README.rst 2017-07-26 15:11:12.000000000 +0000 @@ -129,6 +129,7 @@ - `http-prompt `_: An interactive command-line HTTP client. - `coconut `_: Functional programming in Python. - `Ergonomica `_: A Bash alternative written in Python. +- `Kube-shell `_: Kubernetes shell: An integrated shell for working with the Kubernetes CLI Full screen applications: