Skip to content

Commit a202bf5

Browse files
authored
Revert console setup changes to fix interactivity (#13145)
1 parent 2ea0fcb commit a202bf5

File tree

2 files changed

+10
-3
lines changed

2 files changed

+10
-3
lines changed

src/prefect/cli/_types.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -168,3 +168,12 @@ def wrapper(fn):
168168
return original_command
169169

170170
return wrapper
171+
172+
def setup_console(self, soft_wrap: bool, prompt: bool):
173+
self.console = Console(
174+
highlight=False,
175+
color_system="auto" if PREFECT_CLI_COLORS else None,
176+
theme=Theme({"prompt.choices": "bold blue"}),
177+
soft_wrap=not soft_wrap,
178+
force_interactive=prompt,
179+
)

src/prefect/cli/root.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -74,9 +74,7 @@ def main(
7474
exit(1)
7575

7676
# Configure the output console after loading the profile
77-
78-
app.console.is_interactive = prompt
79-
app.console.soft_wrap = not PREFECT_CLI_WRAP_LINES.value()
77+
app.setup_console(soft_wrap=PREFECT_CLI_WRAP_LINES.value(), prompt=prompt)
8078

8179
if not PREFECT_TEST_MODE:
8280
# When testing, this entrypoint can be called multiple times per process which

0 commit comments

Comments
 (0)