Skip to content
Myr

Echo prompts with color on windows

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by Armin Ronacher · committed by Armin Ronacher · parent c13d723 · Browse files · 1 file+8 added−2 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

1 file+8 added−2 removed

  • other:+8 added−2 removed

1 file+8 added−2 removed

modified:click/termui.py+8 added-2 removed
55 unmodified lines
5657 def prompt_func(text):58 f = hide_input and hidden_prompt_func or visible_prompt_func59 try:60 # Write the prompt separately so that we get nice61 # coloring through colorama on windows62 echo(text, nl=False)60 return f(text)63 return f('')64 except (KeyboardInterrupt, EOFError):65 raise Abort()6667 if value_proc is None:
44 unmodified lines
112 prompt = _build_prompt(text, prompt_suffix, show_default,113 default and 'Y/n' or 'y/N')114 while 1:115 try:116 # Write the prompt separately so that we get nice117 # coloring through colorama on windows118 echo(prompt, nl=False)113 value = visible_prompt_func(prompt).lower().strip()119 value = visible_prompt_func('').lower().strip()120 except (KeyboardInterrupt, EOFError):121 raise Abort()122 if value in ('y', 'yes'):123 rv = True
317 unmodified lines