From fa92aa7c34e9b5b5c1da6da9801e9ceb16c33fa4 Mon Sep 17 00:00:00 2001 From: Tianyu Yuan <62664574+paperplane110@users.noreply.github.com> Date: Mon, 11 Nov 2024 16:50:30 +0000 Subject: [PATCH] Fix(prompt.py): #2994 --- rich/prompt.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/rich/prompt.py b/rich/prompt.py index c7cf25bae..3eeecc00c 100644 --- a/rich/prompt.py +++ b/rich/prompt.py @@ -1,3 +1,4 @@ +import sys from typing import Any, Generic, List, Optional, TextIO, TypeVar, Union, overload from . import get_console @@ -290,6 +291,9 @@ def __call__(self, *, default: Any = ..., stream: Optional[TextIO] = None) -> An self.pre_prompt() prompt = self.make_prompt(default) value = self.get_input(self.console, prompt, self.password, stream=stream) + if ("readline" in sys.modules) and (value == ""): + + print("") if value == "" and default != ...: return default try: