Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions examples/menu.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import sys
import random
from typing import List
from rich_toolkit import RichToolkit
Expand Down Expand Up @@ -56,6 +57,10 @@ def get_options() -> List[Option]:
app.print_title("Launch sequence initiated.", tag="astro")
app.print_line()

if not app.confirm("Do you want to continue?"):
app.print("Launch aborted.")
sys.exit(0)

app.ask(
"Where should we create your new project?",
tag="dir",
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[project]
name = "rich-toolkit"
version = "0.14.8"
version = "0.14.9"
description = "Rich toolkit for building command-line applications"
readme = "README.md"
license = "MIT"
Expand Down
5 changes: 4 additions & 1 deletion src/rich_toolkit/container.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
from typing import TYPE_CHECKING, Any, Dict, List, Optional, Tuple

import click
from rich.console import RenderableType
from rich.control import Control, ControlType
from rich.live_render import LiveRender
from rich.segment import Segment
Expand Down Expand Up @@ -42,6 +41,10 @@ def _refresh(self, done: bool = False):
else False
)

# Always show cursor when done to restore terminal state
if done:
should_show_cursor = True

self.console.print(
Control.show_cursor(should_show_cursor),
*self.move_cursor_at_beginning(),
Expand Down