diff options
author | Takeshi KOMIYA <i.tkomiya@gmail.com> | 2018-08-29 01:06:37 +0900 |
---|---|---|
committer | Takeshi KOMIYA <i.tkomiya@gmail.com> | 2018-08-29 01:06:37 +0900 |
commit | 04d2afdaeaf576bcc65c0b9b91c53c91a8337de0 (patch) | |
tree | 20ed28435f1550058e289536516e0e517c6ea178 /sphinx/cmd/quickstart.py | |
parent | bb55118e68f3683582594f2a06ce970d8dc4b024 (diff) | |
parent | 2429cc5bbf9e3c17217c81ead4e473541b7c491d (diff) | |
download | sphinx-git-04d2afdaeaf576bcc65c0b9b91c53c91a8337de0.tar.gz |
Merge branch '1.7' into 1.8
Diffstat (limited to 'sphinx/cmd/quickstart.py')
-rw-r--r-- | sphinx/cmd/quickstart.py | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/sphinx/cmd/quickstart.py b/sphinx/cmd/quickstart.py index fdc42725b..0cb2350c6 100644 --- a/sphinx/cmd/quickstart.py +++ b/sphinx/cmd/quickstart.py @@ -26,10 +26,12 @@ try: import readline if readline.__doc__ and 'libedit' in readline.__doc__: readline.parse_and_bind("bind ^I rl_complete") + USE_LIBEDIT = True else: readline.parse_and_bind("tab: complete") + USE_LIBEDIT = False except ImportError: - pass + USE_LIBEDIT = False from docutils.utils import column_width from six import PY2, PY3, text_type, binary_type @@ -197,7 +199,13 @@ def do_prompt(text, default=None, validator=nonempty): prompt = prompt.encode('utf-8') except UnicodeEncodeError: prompt = prompt.encode('latin1') - prompt = colorize(COLOR_QUESTION, prompt, input_mode=True) + if USE_LIBEDIT: + # Note: libedit has a problem for combination of ``input()`` and escape + # sequence (see #5335). To avoid the problem, all prompts are not colored + # on libedit. + pass + else: + prompt = colorize(COLOR_QUESTION, prompt, input_mode=True) x = term_input(prompt).strip() if default and not x: x = default |