diff options
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 |