Skip to content

Commit

Permalink
Merge branch 'master' into reset-height
Browse files Browse the repository at this point in the history
  • Loading branch information
willmcgugan committed Mar 10, 2022
2 parents 5a3c6e6 + 8c6d1cd commit b1f02ab
Showing 1 changed file with 3 additions and 11 deletions.
14 changes: 3 additions & 11 deletions rich/console.py
Original file line number Diff line number Diff line change
Expand Up @@ -2006,23 +2006,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:
Expand Down

0 comments on commit b1f02ab

Please sign in to comment.