Skip to content

Commit ac1f73b

Browse files
committed
feat(_progress[spinner]): add Spinner, BuildTree, templates, and presets
why: The CLI needs an animated progress display during workspace builds. A dedicated module keeps display logic decoupled from builder and load. what: - Add Spinner context manager with atexit cursor restore and non-TTY fallback - Add BuildTree for tracking build state (session, windows, panes) - Add scrolling output panel for before_script output lines - Add PROGRESS_PRESETS (default, minimal, window, pane, verbose) with format_template using {session}, {window}, {bar}, {progress}, etc. - Add render_bar() with marching indicator during before_script - Add SUCCESS_TEMPLATE and format_success() for persistent completion line - Add _SafeFormatMap, ANSI-aware truncation, dynamic terminal width refresh
1 parent 46cf411 commit ac1f73b

3 files changed

Lines changed: 1134 additions & 0 deletions

File tree

src/tmuxp/_internal/colors.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -610,6 +610,7 @@ def get_color_mode(color_arg: str | None = None) -> ColorMode:
610610
# ANSI styling utilities (originally from click, via utils.py)
611611

612612
_ansi_re = re.compile(r"\033\[[;?0-9]*[a-zA-Z]")
613+
ANSI_SEQ_RE = _ansi_re
613614

614615

615616
def strip_ansi(value: str) -> str:

src/tmuxp/cli/_colors.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
import logging
1313

1414
from tmuxp._internal.colors import (
15+
ANSI_SEQ_RE,
1516
ColorMode,
1617
Colors,
1718
UnknownStyleColor,
@@ -25,6 +26,7 @@
2526
logger = logging.getLogger(__name__)
2627

2728
__all__ = [
29+
"ANSI_SEQ_RE",
2830
"ColorMode",
2931
"Colors",
3032
"UnknownStyleColor",

0 commit comments

Comments
 (0)