Skip to content

Commit 2e9f8cd

Browse files
committed
docs(progress): document progress display, env vars, and API reference
why: Users need documentation for the progress spinner feature. what: - Add "Progress display" section to docs/cli/load.md with presets, tokens, panel lines, disabling, and before-script behavior - Add TMUXP_PROGRESS, TMUXP_PROGRESS_FORMAT, TMUXP_PROGRESS_LINES to environmental-variables.md - Add docs/api/cli/progress.md API reference page
1 parent 2528c59 commit 2e9f8cd

4 files changed

Lines changed: 161 additions & 0 deletions

File tree

docs/api/cli/index.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ freeze
1616
import_config
1717
load
1818
ls
19+
progress
1920
search
2021
shell
2122
utils

docs/api/cli/progress.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# tmuxp progress - `tmuxp.cli._progress`
2+
3+
```{eval-rst}
4+
.. automodule:: tmuxp.cli._progress
5+
:members:
6+
:show-inheritance:
7+
:undoc-members:
8+
```

docs/cli/load.md

Lines changed: 101 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -152,3 +152,104 @@ $ tmuxp load [filename] --log-file [log_filename]
152152
```console
153153
$ tmuxp --log-level [LEVEL] load [filename] --log-file [log_filename]
154154
```
155+
156+
## Progress display
157+
158+
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.
159+
160+
### Presets
161+
162+
Five built-in presets control the spinner format:
163+
164+
| Preset | Format |
165+
|--------|--------|
166+
| `default` | `Loading workspace: {session} {bar} {progress} {window}` |
167+
| `minimal` | `Loading workspace: {session} [{window_progress}]` |
168+
| `window` | `Loading workspace: {session} {window_bar} {window_progress_rel}` |
169+
| `pane` | `Loading workspace: {session} {pane_bar} {session_pane_progress}` |
170+
| `verbose` | `Loading workspace: {session} [window {window_index} of {window_total} · pane {pane_index} of {pane_total}] {window}` |
171+
172+
Select a preset with `--progress-format`:
173+
174+
```console
175+
$ tmuxp load --progress-format minimal myproject
176+
```
177+
178+
Or via environment variable:
179+
180+
```console
181+
$ TMUXP_PROGRESS_FORMAT=verbose tmuxp load myproject
182+
```
183+
184+
### Custom format tokens
185+
186+
Use a custom format string with any of the available tokens:
187+
188+
| Token | Description |
189+
|-------|-------------|
190+
| `{session}` | Session name |
191+
| `{window}` | Current window name |
192+
| `{window_index}` | Current window number (1-based) |
193+
| `{window_total}` | Total number of windows |
194+
| `{window_progress}` | Window fraction (e.g. `1/3`) |
195+
| `{window_progress_rel}` | Completed windows fraction (e.g. `1/3`) |
196+
| `{windows_done}` | Number of completed windows |
197+
| `{windows_remaining}` | Number of remaining windows |
198+
| `{pane_index}` | Current pane number in the window |
199+
| `{pane_total}` | Total panes in the current window |
200+
| `{pane_progress}` | Pane fraction (e.g. `2/4`) |
201+
| `{progress}` | Combined progress (e.g. `1/3 win · 2/4 pane`) |
202+
| `{session_pane_progress}` | Panes completed across the session (e.g. `5/10`) |
203+
| `{overall_percent}` | Pane-based completion percentage (0–100) |
204+
| `{bar}` | Composite progress bar |
205+
| `{pane_bar}` | Pane-based progress bar |
206+
| `{window_bar}` | Window-based progress bar |
207+
| `{status_icon}` | Status icon (⏸ during before_script) |
208+
209+
Example:
210+
211+
```console
212+
$ tmuxp load --progress-format "{session} {bar} {overall_percent}%" myproject
213+
```
214+
215+
### Panel lines
216+
217+
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.

docs/configuration/environmental-variables.md

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,3 +24,54 @@ building sessions. For this case you can override it here.
2424
```console
2525
$ env LIBTMUX_TMUX_FORMAT_SEPARATOR='__SEP__' tmuxp load [session]
2626
```
27+
28+
(TMUXP_PROGRESS)=
29+
30+
## `TMUXP_PROGRESS`
31+
32+
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}`:
46+
47+
```console
48+
$ TMUXP_PROGRESS_FORMAT=minimal tmuxp load myproject
49+
```
50+
51+
Custom format example:
52+
53+
```console
54+
$ TMUXP_PROGRESS_FORMAT="{session} {bar} {overall_percent}%" tmuxp load myproject
55+
```
56+
57+
Equivalent to the `--progress-format` CLI flag.
58+
59+
(TMUXP_PROGRESS_LINES)=
60+
61+
## `TMUXP_PROGRESS_LINES`
62+
63+
Number of script-output lines shown in the spinner panel. Defaults to `3`.
64+
65+
Set to `0` to hide the panel entirely (script output goes to stdout):
66+
67+
```console
68+
$ TMUXP_PROGRESS_LINES=0 tmuxp load myproject
69+
```
70+
71+
Set to `-1` for unlimited lines (capped to terminal height):
72+
73+
```console
74+
$ TMUXP_PROGRESS_LINES=-1 tmuxp load myproject
75+
```
76+
77+
Equivalent to the `--progress-lines` CLI flag.

0 commit comments

Comments
 (0)