From f201c41b6b54a6221ab7fec08b255e25468d922f Mon Sep 17 00:00:00 2001 From: Daylin Morgan Date: Sun, 14 May 2023 15:14:02 -0500 Subject: [PATCH] fix: demo's uses it's own console --- src/yartsu/cli.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/yartsu/cli.py b/src/yartsu/cli.py index 292d2f0..b9daaa7 100644 --- a/src/yartsu/cli.py +++ b/src/yartsu/cli.py @@ -1,3 +1,4 @@ +import io import sys import textwrap from argparse import SUPPRESS, FileType @@ -67,9 +68,7 @@ def get_parser() -> ArgumentParser: def main() -> None: parser = get_parser() args = parser.parse_args() - console = Console( - record=True, force_terminal=args.demo, force_interactive=args.demo - ) + console = Console(record=True, force_terminal=True) if args.list_themes: themes.list() @@ -111,6 +110,7 @@ def main() -> None: parsed_input = Text.from_ansi(args.input.read()) elif args.demo: + console = Console(file=io.StringIO(), record=True, force_terminal=True) parsed_input = make_test_card() # type: ignore title = args.title or cmd or "yartsu"