summaryrefslogtreecommitdiff
path: root/devel/py-http-prompt/files/patch-http_prompt-cli.py
blob: bba3bce0d64c7ac827c7f9364233a366a36f6ea5 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
Obtained from:	https://github.com/jonathanslenders/http-prompt/commit/34de86178d8ae2b478e0ad989222aab24dd4c046
		https://github.com/jonathanslenders/http-prompt/commit/d3d84de2aa7f3fce521e5ac63f4bbcf9a2166501

--- http_prompt/cli.py.orig	2018-11-04 14:03:53 UTC
+++ http_prompt/cli.py
@@ -9,11 +9,11 @@ import click
 
 from httpie.plugins import FormatterPlugin  # noqa, avoid cyclic import
 from httpie.output.formatters.colors import Solarized256Style
-from prompt_toolkit import prompt, AbortAction
+from prompt_toolkit import prompt
 from prompt_toolkit.auto_suggest import AutoSuggestFromHistory
 from prompt_toolkit.history import FileHistory
-from prompt_toolkit.layout.lexers import PygmentsLexer
-from prompt_toolkit.styles.from_pygments import style_from_pygments
+from prompt_toolkit.lexers import PygmentsLexer
+from prompt_toolkit.styles.pygments import style_from_pygments_cls
 from pygments.styles import get_style_by_name
 from pygments.util import ClassNotFound
 from six.moves.http_cookies import SimpleCookie
@@ -135,7 +135,7 @@ def cli(spec, env, url, http_options):
         style_class = get_style_by_name(cfg['command_style'])
     except ClassNotFound:
         style_class = Solarized256Style
-    style = style_from_pygments(style_class)
+    style = style_from_pygments_cls(style_class)
 
     listener = ExecutionListener(cfg)
 
@@ -159,7 +159,9 @@ def cli(spec, env, url, http_options):
             text = prompt('%s> ' % context.url, completer=completer,
                           lexer=lexer, style=style, history=history,
                           auto_suggest=AutoSuggestFromHistory(),
-                          on_abort=AbortAction.RETRY, vi_mode=cfg['vi'])
+                          vi_mode=cfg['vi'])
+        except KeyboardInterrupt:
+            continue  # Control-C pressed
         except EOFError:
             break  # Control-D pressed
         else: