You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat(load[progress]): animated progress spinner for tmuxp load (#1020)
Adds real-time build feedback to `tmuxp load` via an animated
terminal spinner that shows window/pane creation progress. The
spinner runs in a background thread during the build phase only,
stopping cleanly before interactive prompts or tmux attach.
**Builder callbacks**: Four optional callbacks on `WorkspaceBuilder`
(`on_progress`, `on_before_script`, `on_script_output`,
`on_build_event`) decouple progress reporting from build logic,
emitting structured lifecycle events at each build milestone.
**Spinner and BuildTree** (`cli/_progress.py`): `Spinner` handles
ANSI-aware terminal output with atexit cursor restoration and a
scrolling panel for `before_script` output. `BuildTree` tracks
build state and provides template context for format tokens
(`{bar}`, `{progress}`, `{window}`, `{pane_index}`, etc.).
**Five built-in presets**: `default`, `minimal`, `window`, `pane`,
`verbose` — selectable via `--progress-format` or
`TMUXP_PROGRESS_FORMAT`.
**CLI flags**: `--progress-format`, `--progress-lines`,
`--no-progress` with corresponding `TMUXP_PROGRESS*` env vars.
Non-TTY environments automatically disable the spinner.
**Graceful degradation**: `--no-progress` path wraps session
summary access in try/except so killing the session after attach
does not crash.
When loading a workspace, tmuxp shows an animated spinner with build progress. The spinner updates as windows and panes are created, giving real-time feedback during session builds.
The spinner shows script output in a panel below the spinner line. Control the panel height with `--progress-lines`:
218
+
219
+
Hide the panel entirely (script output goes to stdout):
220
+
221
+
```console
222
+
$ tmuxp load --progress-lines 0 myproject
223
+
```
224
+
225
+
Show unlimited lines (capped to terminal height):
226
+
227
+
```console
228
+
$ tmuxp load --progress-lines -1 myproject
229
+
```
230
+
231
+
Set a custom height (default is 3):
232
+
233
+
```console
234
+
$ tmuxp load --progress-lines 5 myproject
235
+
```
236
+
237
+
### Disabling progress
238
+
239
+
Disable the animated spinner entirely:
240
+
241
+
```console
242
+
$ tmuxp load --no-progress myproject
243
+
```
244
+
245
+
Or via environment variable:
246
+
247
+
```console
248
+
$ TMUXP_PROGRESS=0 tmuxp load myproject
249
+
```
250
+
251
+
When progress is disabled, logging flows normally to the terminal and no spinner is rendered.
252
+
253
+
### Before-script behavior
254
+
255
+
During `before_script` execution, the progress bar shows a marching animation and a ⏸ status icon, indicating that tmuxp is waiting for the script to finish before continuing with pane creation.
Master on/off switch for the animated progress spinner during `tmuxp load`.
33
+
Defaults to `1` (enabled). Set to `0` to disable:
34
+
35
+
```console
36
+
$ TMUXP_PROGRESS=0 tmuxp load myproject
37
+
```
38
+
39
+
Equivalent to the `--no-progress` CLI flag.
40
+
41
+
(TMUXP_PROGRESS_FORMAT)=
42
+
43
+
## `TMUXP_PROGRESS_FORMAT`
44
+
45
+
Set the spinner line format. Accepts a preset name (`default`, `minimal`, `window`, `pane`, `verbose`) or a custom format string with tokens like `{session}`, `{bar}`, `{progress}`:
0 commit comments