From 568b9517b63282ac781a907d82b0c2965242be54 Mon Sep 17 00:00:00 2001 From: Will McGugan Date: Thu, 10 Mar 2022 10:37:15 +0000 Subject: [PATCH] simplify prompt --- rich/console.py | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) diff --git a/rich/console.py b/rich/console.py index d9564abed..1fa66e4ee 100644 --- a/rich/console.py +++ b/rich/console.py @@ -1995,23 +1995,15 @@ def input( Returns: str: Text read from stdin. """ - prompt_str = "" if prompt: - with self.capture() as capture: - self.print(prompt, markup=markup, emoji=emoji, end="") - prompt_str = capture.get() - if self.legacy_windows: - # Legacy windows doesn't like ANSI codes in getpass or input (colorama bug)? - self.file.write(prompt_str) - prompt_str = "" + self.print(prompt, markup=markup, emoji=emoji, end="") if password: - result = getpass(prompt_str, stream=stream) + result = getpass("", stream=stream) else: if stream: - self.file.write(prompt_str) result = stream.readline() else: - result = input(prompt_str) + result = input() return result def export_text(self, *, clear: bool = True, styles: bool = False) -> str: