pi-zentui 0.23.0 → 0.24.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +28 -25
- package/docs/configuration.md +158 -30
- package/docs/footer-format.md +169 -0
- package/extensions/zentui/accent-rail-editor.ts +13 -2
- package/extensions/zentui/codex-quota-display.ts +34 -0
- package/extensions/zentui/codex-quota.ts +296 -0
- package/extensions/zentui/component-colors.ts +158 -0
- package/extensions/zentui/component-settings.ts +99 -0
- package/extensions/zentui/config.ts +278 -100
- package/extensions/zentui/editor-metadata-format.ts +55 -20
- package/extensions/zentui/editor-mouse.ts +94 -0
- package/extensions/zentui/footer.ts +187 -55
- package/extensions/zentui/format.ts +9 -0
- package/extensions/zentui/index.ts +69 -1
- package/extensions/zentui/minimalist-editor.ts +79 -24
- package/extensions/zentui/runtime.ts +59 -29
- package/extensions/zentui/selector-border.ts +9 -3
- package/extensions/zentui/settings-command.ts +959 -664
- package/extensions/zentui/settings-keys.ts +59 -0
- package/extensions/zentui/settings-list-selection.ts +30 -0
- package/extensions/zentui/settings-previews.ts +10 -4
- package/extensions/zentui/style.ts +6 -0
- package/extensions/zentui/thinking-experimental.ts +62 -10
- package/extensions/zentui/ui.ts +200 -65
- package/extensions/zentui/user-message-styles.ts +65 -34
- package/extensions/zentui/user-message.ts +172 -34
- package/extensions/zentui/working-line.ts +11 -17
- package/package.json +4 -2
package/README.md
CHANGED
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
|
|
15
15
|
## What is this?
|
|
16
16
|
|
|
17
|
-
Zentui gives Pi surfaces
|
|
17
|
+
Zentui gives Pi surfaces independently selectable treatments:
|
|
18
18
|
|
|
19
19
|
- **Editor** — Opencode, Opencode copy-friendly, Accent Rail, and Minimalist input treatments
|
|
20
20
|
- **User messages** — framed, framed copy-friendly, compact, and labeled transcript messages
|
|
@@ -91,7 +91,7 @@ pi install git:github.com/lmilojevicc/pi-zentui
|
|
|
91
91
|
|
|
92
92
|
## Configure
|
|
93
93
|
|
|
94
|
-
Run `/zentui` inside Pi to configure Appearance, Editor, User messages, Thinking (Experimental), Working line, Footer, Segments
|
|
94
|
+
Run `/zentui` inside Pi to configure Appearance, Editor, User messages, Thinking (Experimental), Working line, and Footer. With Starship selected, Footer contains **Segments →**, **Git →**, and **Extension statuses →** child pages. Use `Tab` and `Shift+Tab` to switch sections; compact help follows your configured selection keys. Every section has a direct route (for example, `/zentui footer`). `/zentui segments`, `/zentui git`, and `/zentui extensions` open the Footer child pages when Starship is active; under Native or Hidden they open Footer with a requires-Starship explanation, without changing style or saved preferences. The configured cancel key returns from a child to Footer; at the top level it closes settings. Extension statuses are published keyed Footer statuses, not extension management or Working line integrations. Inactive options retain their saved preferences. Most changes apply live. Active Streaming can switch live to Rail or Tree, and Rail and Tree can switch live between each other. Entering Streaming from a structural mode, first enable, and re-enable after a live disable require restarting Pi. Configuration is saved to:
|
|
95
95
|
|
|
96
96
|
```text
|
|
97
97
|
~/.pi/agent/zentui.json
|
|
@@ -112,36 +112,37 @@ Presets apply once, saving only these component selections. Colors, color source
|
|
|
112
112
|
|
|
113
113
|
The displayed preset is derived from your current selections: individual changes may show **Custom**, and returning to a matching combination restores its name. No `preset` config key is saved or reapplied at startup. Defaults are unchanged and match Opencode. Selecting a preset keeps settings open for further adjustments. Editor installation waits until the panel closes; if editor ownership prevents application, the saved choice may require reloading Pi.
|
|
114
114
|
|
|
115
|
-
|
|
115
|
+
### Minimal overrides
|
|
116
|
+
|
|
117
|
+
Installation enables Opencode Editor, Framed User messages, Zentui selector borders, and Starship Footer. Working line and Thinking (Experimental) remain disabled. Missing fields retain those defaults; there is no automatic migration. Auto icons assume a Nerd Font without detecting one; ASCII changes icons, not the entire UI.
|
|
118
|
+
|
|
119
|
+
Change only what you need. For example, this changes only the Editor's accent:
|
|
116
120
|
|
|
117
121
|
```json
|
|
118
122
|
{
|
|
119
123
|
"components": {
|
|
120
|
-
"editor": {
|
|
121
|
-
"enabled": true,
|
|
122
|
-
"style": "accent-rail"
|
|
123
|
-
},
|
|
124
|
-
"userMessages": {
|
|
125
|
-
"enabled": true,
|
|
126
|
-
"style": "framed"
|
|
127
|
-
},
|
|
128
|
-
"thinkingSteps": {
|
|
129
|
-
"enabled": false,
|
|
130
|
-
"mode": "tree"
|
|
131
|
-
},
|
|
132
|
-
"workingLine": {
|
|
133
|
-
"enabled": false
|
|
134
|
-
},
|
|
135
|
-
"footer": {
|
|
136
|
-
"style": "starship"
|
|
137
|
-
}
|
|
138
|
-
},
|
|
139
|
-
"icons": {
|
|
140
|
-
"mode": "auto"
|
|
124
|
+
"editor": { "colors": { "accent": "bold blue" } }
|
|
141
125
|
}
|
|
142
126
|
}
|
|
143
127
|
```
|
|
144
128
|
|
|
129
|
+
Each owner's **Color overrides** action edits raw styles independently. **Reset / inherit** deletes the local key; an empty string intentionally removes styling. Shared `colors` remain live historical fallbacks before **and after** migration. Color sources remain independent too.
|
|
130
|
+
|
|
131
|
+
To adopt **only User messages**, explicitly leave the other default-enabled surfaces alone:
|
|
132
|
+
|
|
133
|
+
```json
|
|
134
|
+
{
|
|
135
|
+
"components": {
|
|
136
|
+
"editor": { "enabled": false },
|
|
137
|
+
"userMessages": { "enabled": true, "style": "framed" },
|
|
138
|
+
"selectorBorders": { "enabled": false },
|
|
139
|
+
"footer": { "style": "native" }
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
```
|
|
143
|
+
|
|
144
|
+
Disabled/Native leaves Pi or a predecessor in control. Hidden instead intentionally owns zero Footer rows. Ordinary saves snapshot only the edited owner. `/zentui migrate` is a separate confirmed all-owner selection/source/style-option snapshot; it preserves aliases, unknown fields, and shared color inheritance, and never copies generated palettes. See the configuration reference for exact owner color keys and reset behavior.
|
|
145
|
+
|
|
145
146
|
Detailed reference:
|
|
146
147
|
|
|
147
148
|
- [Configuration, component styles, defaults, runtime detection, and compatibility](https://github.com/lmilojevicc/pi-zentui/blob/main/docs/configuration.md)
|
|
@@ -161,7 +162,7 @@ Useful shortcuts:
|
|
|
161
162
|
/zentui format clear
|
|
162
163
|
```
|
|
163
164
|
|
|
164
|
-
**Thinking (Experimental)** uses one private `AssistantMessageComponent` renderer for Rail, Tree, and Streaming, tested against exact Pi versions 0.80.5, 0.82.1, 0.83.0, 0.84.0,
|
|
165
|
+
**Thinking (Experimental)** uses one private `AssistantMessageComponent` renderer for Rail, Tree, and Streaming, tested against exact Pi versions 0.80.5, 0.82.1, 0.83.0, 0.84.0, 0.84.4, and 0.85.1. It is disabled by default and may break after Pi updates. Zentui installs an enabled startup mode before transcript restoration. A healthy installed controller lets active Streaming switch live to Rail or Tree, and lets Rail and Tree switch live between each other, without reinstalling its patch. Entering Streaming from Rail or Tree saves the choice but keeps the active structural mode until restart. Disabling live restores native thinking and releases Streaming resources. First enable and re-enable after a live disable are also restart-gated. Mode changes while disabled only preconfigure the next enable. Startup failures, missing constructors, incompatible private child layouts, parser limits, theme/render/width errors, and displaced patch ownership fail open to complete native thinking. If cleanup throws while leaving Streaming, disabling still restores native thinking and a structural selection still becomes active; the successful change warns that Streaming is unavailable for the rest of the session.
|
|
165
166
|
|
|
166
167
|
Rail shows every parsed label in each native contiguous thinking run (`│ Label`, with only the open final phase shown as `│ • Label`). Tree independently shows the latest five labels in each run (`├─ · Label`, settled `└─ · Label`, open `└─ • Label`); it never aggregates across intervening text or tool blocks. Rail and Tree follow Pi's thinking visibility. Complete strict SGR styling is stripped before parsing; every other terminal control and unsafe or unstructured content keeps the complete run native. Labels are rendered by fresh host-shaped Pi Markdown instances before cropping, so emphasis, code, links, HTML, LaTeX, custom transforms, and native `thinkingText` styling remain host-controlled. Every label occupies one terminal row: ANSI/OSC/grapheme-aware cropping adds `…` only when needed. Native horizontal padding stays external. Connectors are styled directly with the current theme's `accent` callback on every render, so custom themes control them independently. Hidden native thinking remains hidden and keeps Pi's native hidden label.
|
|
167
168
|
|
|
@@ -169,6 +170,8 @@ Streaming retains Pi's host-rendered final five rows under `Thinking 7.1s`, fold
|
|
|
169
170
|
|
|
170
171
|
Pi 0.84 also provides a native fullscreen TUI with a sticky editor and Footer. Pi 0.84.4 is covered by a fullscreen live-transition PTY smoke in addition to the standard matrix. Zentui does not enable fullscreen automatically; select it from Pi's `/settings`, set `"tuiMode": "fullscreen"` in Pi settings, or launch Pi with `--tui-mode fullscreen`.
|
|
171
172
|
|
|
173
|
+
**Codex quota (opt-in):** Show remaining 5-hour/weekly quota for `openai-codex` through independent Editor and Starship Footer settings, both off by default. See [configuration and private-endpoint limitations](./docs/configuration.md#codex-account-quota), including `$codex_quota` for custom templates.
|
|
174
|
+
|
|
172
175
|
## Requirements
|
|
173
176
|
|
|
174
177
|
- [Pi](https://pi.dev) coding agent 0.80.5 or newer
|
package/docs/configuration.md
CHANGED
|
@@ -4,27 +4,75 @@
|
|
|
4
4
|
|
|
5
5
|
Zentui reads optional user configuration from `~/.pi/agent/zentui.json`. Missing or invalid known values fall back to defaults. Unknown fields are ignored at runtime but preserved on disk by component save operations where they are user-owned migration or future-style data.
|
|
6
6
|
|
|
7
|
+
## Start with minimal overrides
|
|
8
|
+
|
|
9
|
+
Do not copy the complete defaults into your file. Omitted fields keep defaults and source-aware inheritance. New installs enable Opencode Editor, Framed User messages, Zentui selector borders, and Starship Footer; Working line and Thinking (Experimental) are disabled.
|
|
10
|
+
|
|
11
|
+
Change just one surface:
|
|
12
|
+
|
|
13
|
+
```json
|
|
14
|
+
{
|
|
15
|
+
"components": {
|
|
16
|
+
"footer": { "colors": { "cwd": "bold green" } }
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
To adopt only User messages while leaving the other default-enabled surfaces native or predecessor-controlled:
|
|
22
|
+
|
|
23
|
+
```json
|
|
24
|
+
{
|
|
25
|
+
"components": {
|
|
26
|
+
"editor": { "enabled": false },
|
|
27
|
+
"userMessages": { "enabled": true, "style": "framed" },
|
|
28
|
+
"selectorBorders": { "enabled": false },
|
|
29
|
+
"footer": { "style": "native" }
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
Native releases Zentui's ownership; Hidden deliberately installs a zero-row Footer. Disabling a component preserves its dormant preferences. See [color overrides and inheritance](#component-color-overrides-and-inheritance) and [explicit migration](#compatibility-and-migration) before snapshotting legacy settings.
|
|
35
|
+
|
|
7
36
|
## `/zentui` settings
|
|
8
37
|
|
|
9
|
-
The interactive `/zentui` menu is split into
|
|
38
|
+
The interactive `/zentui` menu is split into six component-oriented sections. Use `Tab` and `Shift+Tab` to switch sections. Selection/Change/Back/Close hints follow injected host keybindings (with older-host defaults when unavailable). Narrow help retains Change, Sections, and Back (on child pages) or Close guidance:
|
|
10
39
|
|
|
11
|
-
1. **Appearance** — component Preset; selector-border enablement, style, and colors; icon mode.
|
|
12
|
-
2. **Editor** — enablement, style, colors, model label, border behavior, viewport indicators, settings for the selected editor style, and a static synthetic preview.
|
|
40
|
+
1. **Appearance** — component Preset; selector-border enablement, informational fixed style, and colors; icon mode.
|
|
41
|
+
2. **Editor** — enablement, style, colors, Codex quota, model label, border behavior, viewport indicators, settings for the selected editor style, and a static synthetic preview.
|
|
13
42
|
3. **User messages** — enablement, style, colors, and a static synthetic Markdown preview.
|
|
14
43
|
4. **Thinking (Experimental)** — private Rail, Tree, or Streaming rendering; active Streaming can switch live to Rail or Tree, Rail and Tree can switch live between each other, and the private renderer may break after Pi updates.
|
|
15
44
|
5. **Working line** — ownership, settled Turn summary, spinner and text speeds, optional spinner-color motion, text animation, color source, custom messages, Tool/Elapsed/Thinking time/Tokens segments, and animated preview.
|
|
16
|
-
6. **Footer** — Native, Starship, or Hidden. Starship additionally exposes colors, model label, responsive layout, separator, context style, and path display.
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
45
|
+
6. **Footer** — Native, Starship, or Hidden. Starship additionally exposes colors, Codex quota, model label, responsive layout, separator, context style, and path display.
|
|
46
|
+
- **Segments →** — visibility toggles for non-Git Starship segments.
|
|
47
|
+
- **Git →** — Starship Footer Git segment and probe controls, not Editor Git controls.
|
|
48
|
+
- **Extension statuses →** — Starship placement and color controls for active published keyed Footer statuses; not extension management or Working line integrations.
|
|
49
|
+
|
|
50
|
+
The three Footer child entries appear only with Starship selected. Child headings show their scope (for example, **Footer > Git**). The configured cancel key returns to Footer focused on the originating child entry; at the top level it still closes settings. `Tab` / `Shift+Tab` remain available on child pages to move to the next / previous top-level section relative to Footer. Visiting or backing out of a page does not save settings or change component ownership.
|
|
20
51
|
|
|
21
|
-
Editor, User messages, Thinking (Experimental), and Working line retain independent configuration. Editor, User-message, and Thinking previews remain visible while their component is disabled. Only the Working-line preview owns an animation timer.
|
|
52
|
+
Editor, User messages, Thinking (Experimental), and Working line retain independent configuration. Editor, User-message, and Thinking previews remain visible while their component is disabled. Only the Working-line preview owns an animation timer. Starship-specific rows are shown only while Starship is selected. Footer Color overrides remain available for preconfiguration under every Footer style and say **Saved for Starship** when inactive. Native and Hidden hide the three child entries without changing their saved preferences. Other dormant choices explain their scope without rewriting values. Auto icons assume a Nerd Font without detecting one; ASCII replaces icons only, not all borders or UI glyphs.
|
|
22
53
|
|
|
23
|
-
Free-form values such as custom formats, Opencode metadata formats,
|
|
54
|
+
Free-form values such as custom formats, Opencode metadata formats, and inactive extension keys remain JSON-only. Component raw colors are editable through each component’s **Color overrides** action, with explicit **Reset / inherit**. Working-line speed accepts validated custom milliseconds in `/zentui`.
|
|
24
55
|
|
|
25
|
-
|
|
56
|
+
Every section and Footer child page has a direct route and completion:
|
|
26
57
|
|
|
27
58
|
```text
|
|
59
|
+
/zentui appearance
|
|
60
|
+
/zentui editor
|
|
61
|
+
/zentui user-messages
|
|
62
|
+
/zentui thinking
|
|
63
|
+
/zentui working-line
|
|
64
|
+
/zentui footer
|
|
65
|
+
/zentui segments
|
|
66
|
+
/zentui git
|
|
67
|
+
/zentui extensions
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
`/zentui segments`, `/zentui git`, and `/zentui extensions` open the corresponding **Footer > …** child page when Starship is active. Under Native or Hidden, they instead open Footer with a requires-Starship explanation; they do not show active child controls, enable Starship, or write configuration.
|
|
71
|
+
|
|
72
|
+
`messages` and `thinking-steps` remain section aliases; Footer also accepts the aliases below. Useful slash-command shortcuts:
|
|
73
|
+
|
|
74
|
+
```text
|
|
75
|
+
/zentui migrate
|
|
28
76
|
/zentui editor enable
|
|
29
77
|
/zentui editor disable
|
|
30
78
|
/zentui editor toggle
|
|
@@ -85,7 +133,10 @@ URL when an extension supplies only a label.
|
|
|
85
133
|
|
|
86
134
|
## Complete default configuration
|
|
87
135
|
|
|
88
|
-
|
|
136
|
+
Reference only—not a starter file. Prefer the minimal overrides above. Optional editor source-aware overrides such as `editorRail`, `editorGitBranch`, and `editorThinkingMax` are intentionally omitted.
|
|
137
|
+
|
|
138
|
+
<details>
|
|
139
|
+
<summary>Expand the complete defaults</summary>
|
|
89
140
|
|
|
90
141
|
```json
|
|
91
142
|
{
|
|
@@ -93,6 +144,7 @@ Copy this example and change only the values you need. Optional editor source-aw
|
|
|
93
144
|
"components": {
|
|
94
145
|
"editor": {
|
|
95
146
|
"enabled": true,
|
|
147
|
+
"codexQuota": false,
|
|
96
148
|
"style": "opencode",
|
|
97
149
|
"colorSource": "theme",
|
|
98
150
|
"borderColorMode": "static",
|
|
@@ -100,11 +152,11 @@ Copy this example and change only the values you need. Optional editor source-aw
|
|
|
100
152
|
"viewportIndicators": true,
|
|
101
153
|
"styles": {
|
|
102
154
|
"opencode": {
|
|
103
|
-
"metadataFormat": "$model $provider( $thinking)",
|
|
155
|
+
"metadataFormat": "$model $provider( $thinking)( $codex_quota)",
|
|
104
156
|
"completionMenu": "palette"
|
|
105
157
|
},
|
|
106
158
|
"opencode-copy-friendly": {
|
|
107
|
-
"metadataFormat": "$model $provider( $thinking)",
|
|
159
|
+
"metadataFormat": "$model $provider( $thinking)( $codex_quota)",
|
|
108
160
|
"completionMenu": "palette"
|
|
109
161
|
},
|
|
110
162
|
"accent-rail": {
|
|
@@ -186,13 +238,14 @@ Copy this example and change only the values you need. Optional editor source-aw
|
|
|
186
238
|
},
|
|
187
239
|
"footer": {
|
|
188
240
|
"style": "starship",
|
|
241
|
+
"codexQuota": false,
|
|
189
242
|
"colorSource": "theme",
|
|
190
243
|
"modelLabel": "id",
|
|
191
244
|
"styles": {
|
|
192
245
|
"starship": {
|
|
193
246
|
"format": "",
|
|
194
247
|
"responsive": true,
|
|
195
|
-
"compactFormat": "$cwd$wrap(in $session_name)$wrap(on $git_branch) $git_status$wrap$context$wrap_sep$tokens",
|
|
248
|
+
"compactFormat": "$cwd$wrap(in $session_name)$wrap(on $git_branch) $git_status$wrap$context$wrap_sep$tokens$wrap_sep($codex_quota)",
|
|
196
249
|
"compactMaxLines": 2,
|
|
197
250
|
"separator": "pipe",
|
|
198
251
|
"contextStyle": "text",
|
|
@@ -303,15 +356,17 @@ Copy this example and change only the values you need. Optional editor source-aw
|
|
|
303
356
|
}
|
|
304
357
|
```
|
|
305
358
|
|
|
359
|
+
</details>
|
|
360
|
+
|
|
306
361
|
## Core configuration
|
|
307
362
|
|
|
308
363
|
- Style values accept Starship/terminal strings such as `bold purple`, `fg:202`, `#89b`, `#89b4fa`, and `bg:blue fg:bright-green`, or Pi theme tokens such as `accent`, `borderMuted`, and `thinkingHigh`. Short `#rgb` values expand to `#rrggbb`.
|
|
309
|
-
- `projectRefreshIntervalMs` controls project-status polling. `0` disables polling. Values `1..4999` clamp to the five-second minimum; invalid or non-finite values use `30000`.
|
|
364
|
+
- `projectRefreshIntervalMs` controls project-status polling, not opt-in quota refresh. `0` disables project polling. Values `1..4999` clamp to the five-second minimum; invalid or non-finite values use `30000`.
|
|
310
365
|
- `components.editor` owns Editor enablement, `opencode | opencode-copy-friendly | accent-rail | minimalist` style selection, color source, border mode, model label, viewport indicators, and all four style configurations.
|
|
311
366
|
- Editor `modelLabel` uses `id` by default; `name` uses the display name with ID fallback. Footer has an independent `modelLabel` control.
|
|
312
367
|
- `components.userMessages` owns User-message enablement, `framed | framed-copy-friendly | compact | labeled` style selection, and color source. Disabling it delegates byte-for-byte to Pi's native renderer.
|
|
313
368
|
- `components.thinkingSteps` independently owns opt-in **Thinking (Experimental)** display. It defaults to `{ "enabled": false, "mode": "tree" }`; canonical modes are `rail | tree | streaming`. The former persisted `streaming-experimental` value is accepted only as a migration alias and is normalized to `streaming` on save.
|
|
314
|
-
- All three modes decorate Pi's private host renderer and are tested on exact Pi versions 0.80.5, 0.82.1, 0.83.0, 0.84.0,
|
|
369
|
+
- All three modes decorate Pi's private host renderer and are tested on exact Pi versions 0.80.5, 0.82.1, 0.83.0, 0.84.0, 0.84.4, and 0.85.1. Active Streaming can switch live to Rail or Tree, and Rail and Tree can switch live between each other. Entering Streaming from a structural mode, first enable, and re-enable after live disable require restart; live disable restores native thinking. Disabled mode changes only preconfigure.
|
|
315
370
|
- `components.workingLine.enabled` is the sole Working-line ownership switch. Thinking (Experimental) never enables, configures, or owns the Working line and leaves the existing **Thinking time** option unchanged.
|
|
316
371
|
- `components.selectorBorders` owns selector-border enablement, fixed `zentui` style, and color source. Disable it for native Pi behavior.
|
|
317
372
|
- `components.footer` owns `native | starship | hidden` style selection, color source, model label, and Starship options. Hidden installs an empty component with zero rows.
|
|
@@ -319,6 +374,41 @@ Copy this example and change only the values you need. Optional editor source-aw
|
|
|
319
374
|
- Active third-party statuses from `ctx.ui.setStatus()` can be placed left, middle, or right, hidden per key, and assigned independent color modes.
|
|
320
375
|
- The shown `editor*` colors match the default `theme` source. Omit them to preserve source-aware defaults when switching between `theme` and `terminal`.
|
|
321
376
|
|
|
377
|
+
### Codex account quota
|
|
378
|
+
|
|
379
|
+
`components.editor.codexQuota` and `components.footer.codexQuota` are independent booleans, both `false` by default. Enable either from its **Codex quota** settings row, or merge these leaves into your existing file:
|
|
380
|
+
|
|
381
|
+
```json
|
|
382
|
+
{
|
|
383
|
+
"components": {
|
|
384
|
+
"editor": { "codexQuota": true },
|
|
385
|
+
"footer": { "codexQuota": false }
|
|
386
|
+
}
|
|
387
|
+
}
|
|
388
|
+
```
|
|
389
|
+
|
|
390
|
+
This example enables only Editor quota, without changing any component's style or enablement. Minimalist with Hidden Footer is supported. Footer quota requires Starship. Neither toggle enables another surface or changes a color source, and presets preserve both choices.
|
|
391
|
+
|
|
392
|
+
- Only the exact active provider `openai-codex` with native Codex API and ChatGPT-origin model/provider routing is eligible, not `openai`, proxies (including same-ID overrides), or similarly named models. Resolved-auth routing overrides must also use the ChatGPT origin. Use Pi's existing ChatGPT/Codex login; API billing balances are not supported.
|
|
393
|
+
- Values are **remaining**, rounded percentages: `5h 80% | week 60%`. Only exact 18,000-second and 604,800-second windows are recognized, independently of response ordering. Other durations stay unknown rather than acquiring incorrect labels.
|
|
394
|
+
- `--` means unavailable, including a missing window, unsupported auth API/account, or no successful request. `0%` means exhausted. A newer partial response replaces the previous snapshot completely.
|
|
395
|
+
- Transient HTTP/network/schema failures and refresh deadlines (including slow authentication lookups) retain successful values with a textual `stale` warning. Values older than two minutes also become stale. Missing, failed, or rejected authentication clears the cache, as do account changes, provider changes, loss of all consumers, and teardown. Credentials and quota are never persisted by Zentui.
|
|
396
|
+
- One shared poller refreshes roughly every minute, including idle time, only in a TUI session with an owned, enabled eligible consumer. Both toggles off means no quota auth lookup or request. Editor templates without `$codex_quota` do not create demand; Footer considers both wide and responsive compact paths. HTTP 429 can delay the next request via `Retry-After`. Each refresh has a ten-second deadline; late uncancelable auth results are ignored.
|
|
397
|
+
- Opencode variants include quota conditionally in their shipped metadata defaults. Minimalist adds it beside context when space allows. Accent Rail adds one editor-owned row beneath input and viewport indicators, before autocomplete. At narrow widths quota is omitted as a unit rather than clipping away labels or `stale`. Input text and Working line are unaffected.
|
|
398
|
+
- Quota reuses the selected component's `contextNormal`, `contextWarning`, and `contextError` color roles. Remaining quota at or below 50% uses warning, at or below 20% uses error; stale values use at least warning. Editor never borrows Footer overrides. Settings previews use synthetic values only.
|
|
399
|
+
|
|
400
|
+
**Custom templates remain authoritative.** Saved nonempty formats, including copies of old defaults, are never rewritten or augmented outside the template. Add `( $codex_quota)` to either Opencode variant's `metadataFormat`, `($sep$codex_quota)` to a Footer wide `format`, or `$wrap_sep($codex_quota)` to `compactFormat`. Tokens remain empty when the corresponding quota toggle is off or the provider is ineligible. Unlike ordinary Footer `segments` flags, quota consent cannot be bypassed by a template.
|
|
401
|
+
|
|
402
|
+
**Compatibility and privacy:** Zentui uses Pi's public active-model metadata, `modelRegistry.getProvider("openai-codex")`, and `getProviderAuth("openai-codex")`, available on tested Pi 0.84.0 and 0.85.1. Hosts without safe model/provider routing metadata do not collect or display quota; unavailable auth shows placeholders. There is no fallback to private storage or older credential APIs; the overall Pi minimum is unchanged. Auth is sent only to `https://chatgpt.com/backend-api/wham/usage`, with redirects rejected. JWT decoding is limited to the account-routing claim and is not identity verification. An opaque credential change invalidates cached data conservatively.
|
|
403
|
+
|
|
404
|
+
The endpoint is undocumented and may change or reject some plans. Its path and seconds-based window field are corroborated by [OpenAI's Codex client](https://github.com/openai/codex/blob/rust-v0.98.0/codex-rs/backend-client/src/client.rs); this is not a public API guarantee. Automated verification uses synthetic responses, not a live account. No reset times, countdowns, alerts, or quota history are provided.
|
|
405
|
+
|
|
406
|
+
### Footer layout authority
|
|
407
|
+
|
|
408
|
+
Under `components.footer.styles.starship`, `segments` toggles choose the **built-in wide layout** when `format` is empty. An explicit wide `format` chooses its own variables instead. With `responsive` enabled, Zentui tries the wide layout, then reflows it, then uses the independent `compactFormat` template if it still cannot fit. `compactMaxLines` limits compact rows, not their segment selection.
|
|
409
|
+
|
|
410
|
+
Templates can show a disabled built-in segment or omit an enabled one: disabling Current directory and enabling Session cost can hide cwd and show cost at wide widths, while the default compact template still shows `$cwd` and omits `$cost`. Edit `format` or `compactFormat` to change those templates; `/zentui format clear` resets only the wide layout. Git counts remain a formatting choice for git-status values in both built-in and template layouts. `/zentui` segment descriptions disclose these boundaries; toggles never rewrite templates.
|
|
411
|
+
|
|
322
412
|
### Footer path display
|
|
323
413
|
|
|
324
414
|
`components.footer.styles.starship.pathDisplay.mode` accepts `basename`, `full`, or the opt-in `repository`; the unchanged default is `basename`. Repository mode removes the repository directory name: at `/repo` it renders `.`, and at `/repo/extensions/zentui` it renders `extensions/zentui`. Zentui finds the nearest ancestor with a `.git` directory or worktree `.git` file without starting an extra Git process.
|
|
@@ -327,22 +417,53 @@ For `full` and `repository`, `depth` is the number of final components to retain
|
|
|
327
417
|
|
|
328
418
|
Repository roots are associated with the cwd that produced them. While the current root is missing, stale, outside the cwd, still being refreshed, or unavailable after a lookup failure or Git-to-non-Git transition, Zentui silently renders the unlimited `full` path, including `~` home abbreviation. Built-in and custom `$cwd` layouts use the same result at wide and compact widths. These options belong only to the Starship Footer; Minimalist Editor path semantics are unchanged.
|
|
329
419
|
|
|
330
|
-
###
|
|
420
|
+
### Component color overrides and inheritance
|
|
331
421
|
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
422
|
+
Use sparse `components.<owner>.colors` objects to change only one surface:
|
|
423
|
+
|
|
424
|
+
```json
|
|
425
|
+
{
|
|
426
|
+
"colors": { "editorAccent": "blue", "cwdText": "bold cyan" },
|
|
427
|
+
"components": {
|
|
428
|
+
"editor": { "colors": { "accent": "fg:202", "gitBranch": "bold blue" } },
|
|
429
|
+
"userMessages": { "colors": { "accent": "", "border": "bright-black" } },
|
|
430
|
+
"selectorBorders": { "colors": { "border": "borderMuted" } },
|
|
431
|
+
"footer": { "colors": { "cwd": "bold green" } },
|
|
432
|
+
"workingLine": { "colors": { "high": "bold cyan" } }
|
|
433
|
+
}
|
|
434
|
+
}
|
|
435
|
+
```
|
|
436
|
+
|
|
437
|
+
Resolution is **component override → historical shared `colors` fallback → existing selected-source default**, both before and after explicit migration. Absent overrides preserve historical output. Shared colors remain optional live fallbacks indefinitely: changing a shared fallback can affect every owner that still inherits it. An override never changes another owner or its color source. There is no generated palette or resolved ANSI snapshot in these objects.
|
|
438
|
+
|
|
439
|
+
Empty strings and whitespace-only strings mean deliberately **unstyled**, not missing. **Reset / inherit** deletes the local key; hand-deleting a key does the same. Unsupported values are ignored at runtime, while invalid and unknown future JSON keys remain preserved on disk. The settings editor validates supported style strings, distinguishes Escape from an empty submission, and offers role selection within one **Color overrides** action per component (selector borders use Appearance). Thinking (Experimental) has no raw color object or control.
|
|
440
|
+
|
|
441
|
+
| Owner | Local keys | Historical shared fallback |
|
|
442
|
+
| --- | --- | --- |
|
|
443
|
+
| `footer` | `cwd`, `sessionName`, `gitBranch`, `gitStatus`, `contextNormal`, `contextWarning`, `contextError`, `cost`, `sessionDuration`, `tokens`, `separator`, `runtimePrefix`, `extensionStatus`, `packageVersion`, `gitCommit`, `gitMetricsAdded`, `gitMetricsDeleted`, `username`, `time`, `os` | Same-named shared key |
|
|
444
|
+
| `editor` | `cwd`, `sessionName`, `gitStatus`, `contextNormal`, `contextWarning`, `contextError`, `cost`, `sessionDuration` | Same-named shared key; used by Minimalist metadata and quota |
|
|
445
|
+
| `editor` | `gitBranch` | `editorGitBranch`, then explicitly configured shared `gitBranch` / `git`; never the generated Footer branch default |
|
|
446
|
+
| `editor` | `accent`, `border`, `prompt`, `rail`, `shellRail`, `model`, `provider`, `thinking`, `thinkingMinimal`, `thinkingLow`, `thinkingMedium`, `thinkingHigh`, `thinkingXhigh`, `thinkingMax` | `editorAccent`, `editorBorder`, `editorPrompt`, `editorRail`, `editorShellRail`, `editorModel`, `editorProvider`, `editorThinking`, and matching `editorThinking*` level keys |
|
|
447
|
+
| `userMessages` | `accent`, `border` | `editorAccent`, `editorBorder` |
|
|
448
|
+
| `selectorBorders` | `border` | No shared raw key: defaults to theme `borderMuted` / terminal `bright-black`; never inherits `editorBorder` |
|
|
449
|
+
| `workingLine` | `low`, `mid`, `high` | `workingLineLow`, `workingLineMid`, `workingLineHigh` |
|
|
450
|
+
|
|
451
|
+
Shared aliases `cwdText → cwd` and `git → gitBranch` remain accepted. Footer model/provider are plain text and the detected runtime label uses its runtime module's style, not invented Footer color keys.
|
|
452
|
+
|
|
453
|
+
Role-specific defaults and chains remain intact:
|
|
454
|
+
|
|
455
|
+
- Copy-friendly Opencode prompt uses explicit prompt → configured accent → the existing theme `accent` / terminal `blue` fallback. Model's constant fallback does **not** inherit a configured accent. Minimalist retains its distinct model/thinking defaults.
|
|
456
|
+
- In shell-command mode (`!` or `!!`), Opencode's left rail and model label share `shellRail` → configured `accent` → theme `bashMode` / terminal `bright-cyan`. Normal model coloring is unchanged.
|
|
457
|
+
- Accent Rail uses only `rail` / `editorRail`, then warm theme `syntaxNumber` / terminal `215`; it does not inherit `accent`.
|
|
458
|
+
- Minimalist branch defaults to theme `bold syntaxKeyword` / terminal `bold blue` when no local or explicit shared branch style exists.
|
|
459
|
+
- Thinking levels use their level key then generic `thinking`; Max uses `thinkingMax → thinkingXhigh → thinking`. Static metadata and adaptive borders retain their existing distinct fallback behavior; theme-adaptive borders still defer to Pi's thinking-border callback.
|
|
460
|
+
- Working-line defaults remain theme `dim`, `muted`, `bold accent`, or terminal `bright-black`, `cyan`, `bold cyan`. Both animated rows and summaries consume local overrides. New persisted Turn summaries snapshot the effective high style; when no safe SGR prefix exists (including an unstyled high override), they retain the safe bold-cyan substitute. Existing persisted summaries keep their recorded style; legacy version-1 summaries use current high styling.
|
|
340
461
|
|
|
341
462
|
## Editor styles
|
|
342
463
|
|
|
343
464
|
### Accent Rail
|
|
344
465
|
|
|
345
|
-
Set `components.editor.style` to `accent-rail` or select **Accent Rail** in `/zentui`. Each input row uses its style-owned `rail` glyph (`▎`, or `asciiRail` in ASCII mode), one blank cell before text, and Pi's neutral filled surface.
|
|
466
|
+
Set `components.editor.style` to `accent-rail` or select **Accent Rail** in `/zentui`. Each input row uses its style-owned `rail` glyph (`▎`, or `asciiRail` in ASCII mode), one blank cell before text, and Pi's neutral filled surface. By default it has no prompt glyph, metadata, enclosing border, or blank chrome row. Opt-in eligible Codex quota is the sole metadata exception, adding a separate row beneath input when it fits. Viewport counts appear only while content is clipped.
|
|
346
467
|
|
|
347
468
|
Known autocomplete rows retain Pi's native text, descriptions, and scrolling on the same full-width surface. The selected native `→` becomes the configured rail without replacing Pi's selected-text color. Ambiguous third-party editor layouts fail open using already-rendered native rows.
|
|
348
469
|
|
|
@@ -410,12 +531,13 @@ The configured right zone and Pi's operational right status are right-aligned to
|
|
|
410
531
|
| `$context` | compact current context usage and window, for example `26.8%/272k` |
|
|
411
532
|
| `$tokens` | cumulative session input/output tokens only, for example `↑76k ↓1.6k` |
|
|
412
533
|
| `$cache_hit` | latest assistant prompt cache-hit rate to one decimal; `0.0%` when unavailable |
|
|
534
|
+
| `$codex_quota` | remaining 5-hour/weekly account quota; requires Editor quota consent and active `openai-codex` |
|
|
413
535
|
|
|
414
536
|
`$context` uses Pi's current context snapshot and the live assistant context override, refreshing on the existing 250 ms streaming render cadence. `$tokens` and `$cache_hit` use authoritative persisted session snapshots, so they update at normal session synchronization boundaries rather than estimating in-progress totals. These variables are independent of Footer visibility, style, color source, and configuration.
|
|
415
537
|
|
|
416
|
-
Model variables use `editorModel
|
|
538
|
+
Model variables use Editor `colors.model` (legacy `editorModel`), provider uses `colors.provider` (legacy `editorProvider`), and thinking uses the matching Editor level style. Literal text, session name, and usage metadata use the neutral editor-border theme style. ANSI/VT sequences, controls, and line-breaking whitespace are sanitized without collapsing ordinary spaces.
|
|
417
539
|
|
|
418
|
-
Missing, non-string, or empty values use `$model $provider( $thinking)
|
|
540
|
+
Missing, non-string, or empty values use `$model $provider( $thinking)( $codex_quota)`, with identical spacing while quota is off. A non-empty format that resolves to no metadata preserves the normal blank spacer and metadata rows. This option is JSON-only; `/zentui format` controls the Footer.
|
|
419
541
|
|
|
420
542
|
## User-message styles
|
|
421
543
|
|
|
@@ -445,7 +567,7 @@ Only an actually open thinking phase uses `•`; a text/tool transition or resto
|
|
|
445
567
|
|
|
446
568
|
Streaming keeps the reviewed host-rendered behavior: while open it shows the latest five rendered terminal rows beneath `Thinking 7.1s`; completion folds under `Thought` or current-session `Thought for Ns`. Restored entries have no duration because Pi does not persist a reliable thinking-end timestamp. Only a session started in active Streaming owns its validated configured `app.thinking.toggle` binding and one-second timer. Ctrl+T expands/refolds native reasoning. Startup resource failures and private-shape/render failures use complete native thinking. A cleanup callback that throws while leaving Streaming is contained: Rail or Tree remains active, while Streaming becomes unavailable for that session. Component and timing tracking are bounded to 256; evicted entries are restored natively first.
|
|
447
569
|
|
|
448
|
-
The exact all-mode private matrix covers Pi 0.80.5, 0.82.1, 0.83.0, 0.84.0,
|
|
570
|
+
The exact all-mode private matrix covers Pi 0.80.5, 0.82.1, 0.83.0, 0.84.0, 0.84.4, and 0.85.1 under dark, light, and current themes, narrow/wide widths and resize; Pi 0.84.4 also has a fullscreen live-transition PTY smoke. Thinking (Experimental) never owns or writes the Working line, including its unchanged **Thinking time** option, and does not own Footer, Editor, widgets, statuses, or model behavior.
|
|
449
571
|
|
|
450
572
|
## Working line
|
|
451
573
|
|
|
@@ -593,7 +715,13 @@ Save this in Pi's `~/.pi/agent/settings.json`, select fullscreen in Pi's `/setti
|
|
|
593
715
|
|
|
594
716
|
## Compatibility and migration
|
|
595
717
|
|
|
596
|
-
Canonical `components` paths are the primary JSON interface.
|
|
718
|
+
Canonical `components` paths are the primary JSON interface. Ordinary component saves snapshot and normalize **only the edited owner**: that owner's current legacy-derived selections, sources, and style options become explicit, while unrelated raw JSON values and future styles remain untouched and legacy-derived. Unknown fields do not affect runtime behavior. Color overrides stay sparse and unrelated raw color values are never normalized on save.
|
|
719
|
+
|
|
720
|
+
Run **`/zentui migrate`** or **Appearance → Migrate component selections** for a separate, explicitly confirmed all-owner snapshot. The confirmation explains that component selections, color sources, and style options are frozen against future shared/root legacy selection edits, while shared raw color inheritance remains active. Migration reads the latest disk file after confirmation, preserves unknown fields, aliases and templates, writes atomically (including through a valid symlink), and is idempotent. It never copies generated color defaults or resolved ANSI into owner overrides. Cancellation, unavailable UI, stale session dialogs, corrupt/unreadable config, and failed atomic writes do not change the config. There is **no automatic startup or first-edit migration** and no version marker.
|
|
721
|
+
|
|
722
|
+
Snapshot saves remove the edited owners' obsolete nested copy-friendly/Footer-enabled flags after capturing their effective choices. Deliberately reintroducing an owner-local legacy alias is still an edit to that owner: for example, `components.userMessages.styles.framed.copyFriendly` retains its documented alias behavior with `style: "framed"`. This is distinct from shared/root legacy recoupling, which canonical snapshots prevent.
|
|
723
|
+
|
|
724
|
+
Legacy coupled saver APIs remain explicit multi-owner compatibility transactions; ordinary settings controls never use them. Presets remain sparse, selection-only combinations rather than migrations.
|
|
597
725
|
|
|
598
726
|
- Flat released inputs such as `editorStyle`, `features`, `footerFormat`, and `compactFooterFormat` remain accepted for migration.
|
|
599
727
|
- `components.footer.enabled` and `features.statusLine` migrate to Starship or Native when no valid Footer style exists; Hidden projects `features.statusLine: false`.
|
|
@@ -0,0 +1,169 @@
|
|
|
1
|
+
# Footer format template
|
|
2
|
+
|
|
3
|
+
[Back to README](../README.md) · [Configuration reference](./configuration.md)
|
|
4
|
+
|
|
5
|
+
Set `components.footer.styles.starship.format` for complete control over the Starship Footer. The template supports:
|
|
6
|
+
|
|
7
|
+
- `$variable` and `${variable}` tokens
|
|
8
|
+
- literal text and spaces
|
|
9
|
+
- conditional groups `( ... )` that disappear when every nested variable is empty
|
|
10
|
+
- `$fill` layout boundaries
|
|
11
|
+
|
|
12
|
+
A custom format overrides `components.footer.styles.starship.segments` for the wide layout. Empty or omitted format uses the segment layout. Responsive mode first reflows wide content, then uses the independent `compactFormat` template; compact variables do not follow built-in segment toggles. `compactMaxLines` limits compact rows, not segment selection. No settings toggle rewrites either template. `$codex_quota` is an exception to segment-toggle bypass: it always requires the independent Footer quota consent toggle and active `openai-codex` provider.
|
|
13
|
+
|
|
14
|
+
## Examples
|
|
15
|
+
|
|
16
|
+
A complete left/right layout:
|
|
17
|
+
|
|
18
|
+
```json
|
|
19
|
+
{
|
|
20
|
+
"components": {
|
|
21
|
+
"footer": {
|
|
22
|
+
"styles": {
|
|
23
|
+
"starship": {
|
|
24
|
+
"format": "$os $username $cwd($sep$session_name)( on $git_branch)( $git_status)( via $runtime)$fill($context)($sep$tokens)($sep$cost)($sep$time)"
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
Center the branch between directory and cost:
|
|
33
|
+
|
|
34
|
+
```json
|
|
35
|
+
{
|
|
36
|
+
"components": {
|
|
37
|
+
"footer": {
|
|
38
|
+
"styles": {
|
|
39
|
+
"starship": {
|
|
40
|
+
"format": "$cwd $fill $git_branch $fill $cost"
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
Set or clear the template at runtime:
|
|
49
|
+
|
|
50
|
+
```text
|
|
51
|
+
/zentui format "$cwd( on $git_branch)($git_status)$fill($context)($sep$tokens)"
|
|
52
|
+
/zentui format clear
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
The released flat `footerFormat` and `footerSegments` keys remain accepted only as migration input.
|
|
56
|
+
|
|
57
|
+
## Variables
|
|
58
|
+
|
|
59
|
+
| Token | Aliases | Renders |
|
|
60
|
+
| --- | --- | --- |
|
|
61
|
+
| `$cwd` | `$directory` | current directory |
|
|
62
|
+
| `$session_name` | | current Pi session name |
|
|
63
|
+
| `$git_branch` | `$branch` | Git branch with icon |
|
|
64
|
+
| `$git_status` | `$status` | `[!?↑]` status block |
|
|
65
|
+
| `$git_state` | `$state` | `REBASING`, `MERGING`, and similar state, with optional `n/m` |
|
|
66
|
+
| `$git_commit` | `$commit` | short commit hash and exact-match tag when present |
|
|
67
|
+
| `$git_tag` | `$tag` | exact-match tag at HEAD |
|
|
68
|
+
| `$git_metrics` | | aggregate line changes `+added −deleted` |
|
|
69
|
+
| `$git_added` | | added line count (`+N`) |
|
|
70
|
+
| `$git_deleted` | | deleted line count (`−N`) |
|
|
71
|
+
| `$runtime` | | runtime icon and version |
|
|
72
|
+
| `$model` | | selected Footer model label |
|
|
73
|
+
| `$provider` | | formatted provider label |
|
|
74
|
+
| `$package` | | project package version as `is <glyph> <version>` |
|
|
75
|
+
| `$package_version` | | raw project package version |
|
|
76
|
+
| `$session_duration` | `$duration` | session running time |
|
|
77
|
+
| `$username` | | `user@host` |
|
|
78
|
+
| `$os` | | operating-system icon |
|
|
79
|
+
| `$time` | | current time `HH:MM` |
|
|
80
|
+
| `$context` | | context usage; finite percentages use one decimal |
|
|
81
|
+
| `$codex_quota` | | remaining account quota, for example `5h 80% | week 60%`; gated by `components.footer.codexQuota` |
|
|
82
|
+
| `$tokens` | | input/output totals and existing cache-hit percentage |
|
|
83
|
+
| `$cache_read` | | cache-read total (`R1.2k`); empty at zero or when unavailable |
|
|
84
|
+
| `$cache_write` | | cache-write total (`W300`); empty at zero or when unavailable |
|
|
85
|
+
| `$cost` | | session cost |
|
|
86
|
+
| `$subscription` | | `(sub)` in subscription mode; otherwise empty |
|
|
87
|
+
| `$auto_compaction` | | `(auto)` when automatic compaction is enabled |
|
|
88
|
+
| `$sep` | `$separator` | themed `|` using `colors.separator` |
|
|
89
|
+
| `$fill` | — | wide-format layout boundary |
|
|
90
|
+
|
|
91
|
+
Each variable renders its core value without prose prefixes such as `on` or `via`; add those words as literals.
|
|
92
|
+
|
|
93
|
+
### `$codex_quota` consent and freshness
|
|
94
|
+
|
|
95
|
+
Set `components.footer.codexQuota: true` and select Starship to opt in. The built-in wide layout and shipped compact default include quota conditionally. Saved custom formats are unchanged; add `($sep$codex_quota)` to `format` and `$wrap_sep($codex_quota)` to `compactFormat` where desired. Templates without the token never have quota appended outside them.
|
|
96
|
+
|
|
97
|
+
The token is empty when consent is off or the active provider is not exactly `openai-codex`. With consent, missing values use `--`; exhausted quota uses `0%`; retained values after a transient failure carry `stale`. Quota is omitted as a unit if it cannot fit safely. Editor has its own independent consent toggle. See [quota configuration](./configuration.md#codex-account-quota) for background polling, public auth capability requirements, and private-endpoint limitations.
|
|
98
|
+
|
|
99
|
+
### `$cwd` path modes
|
|
100
|
+
|
|
101
|
+
`$cwd`, the built-in wide directory segment, and responsive compact/final fallback all use `components.footer.styles.starship.pathDisplay`. Its unchanged default is `{ "mode": "basename", "depth": 0 }`.
|
|
102
|
+
|
|
103
|
+
- `basename` renders only the current directory name.
|
|
104
|
+
- `full` renders the full path with `~` home abbreviation.
|
|
105
|
+
- Opt-in `repository` excludes the repository directory name: repository root renders `.`, while `/repo/extensions/zentui` renders `extensions/zentui`.
|
|
106
|
+
|
|
107
|
+
For `full` and `repository`, `depth` keeps the final N components and `0` is unlimited. Repository mode forms the repository-relative path first and then applies depth; for example, `/repo/packages/core/src` at depth `2` renders `…/core/src`. Root always remains `.`. Separator normalization matches the existing cwd formatter.
|
|
108
|
+
|
|
109
|
+
Repository mode recognizes normal repositories and `.git` file worktrees. If the root is missing, stale, unsafe for the current cwd, or unavailable during a cwd/repository transition or failed lookup, `$cwd` silently uses the unlimited `full` path until current root state is safe. This fallback retains `~` abbreviation and never emits a relative path from a stale root.
|
|
110
|
+
|
|
111
|
+
### Compact-only structural tokens
|
|
112
|
+
|
|
113
|
+
`components.footer.styles.starship.compactFormat` also supports:
|
|
114
|
+
|
|
115
|
+
| Token | Behavior |
|
|
116
|
+
| --- | --- |
|
|
117
|
+
| `$wrap` | starts a new compact chunk with a space boundary; the packer keeps it on the current line when it fits or wraps it to the next line |
|
|
118
|
+
| `$wrap_sep` | starts a new compact chunk with the configured `$sep` boundary instead of a plain space |
|
|
119
|
+
| `$extensions` | expands active third-party statuses into independently packable compact chunks, preserving their rendered text and configured color modes |
|
|
120
|
+
|
|
121
|
+
Example:
|
|
122
|
+
|
|
123
|
+
```json
|
|
124
|
+
{
|
|
125
|
+
"components": {
|
|
126
|
+
"footer": {
|
|
127
|
+
"styles": {
|
|
128
|
+
"starship": {
|
|
129
|
+
"compactFormat": "$cwd$wrap(in $session_name)$wrap(on $git_branch) $git_status$wrap$context$wrap_sep$tokens$wrap_sep$extensions"
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
```
|
|
136
|
+
|
|
137
|
+
These tokens are structural in compact mode: `$wrap` and `$wrap_sep` render no text themselves, and `$extensions` is empty when no third-party status is active.
|
|
138
|
+
|
|
139
|
+
## `$fill` behavior
|
|
140
|
+
|
|
141
|
+
| Count | Layout |
|
|
142
|
+
| ---: | --- |
|
|
143
|
+
| 0 | everything left-aligned |
|
|
144
|
+
| 1 | tokens before are left-aligned; tokens after are right-aligned |
|
|
145
|
+
| 2 | before first is left, between is truly centered, after second is right |
|
|
146
|
+
| 3+ | first two count; extras are ignored |
|
|
147
|
+
|
|
148
|
+
The centered middle zone uses `floor((gap - middle) / 2)`, matching third-party statuses placed in the middle.
|
|
149
|
+
|
|
150
|
+
## Conditional groups
|
|
151
|
+
|
|
152
|
+
Wrap optional content in parentheses:
|
|
153
|
+
|
|
154
|
+
```text
|
|
155
|
+
$cwd( on $git_branch)($git_status)$fill($context)
|
|
156
|
+
```
|
|
157
|
+
|
|
158
|
+
If every variable inside a group is empty, the group and its literal text are dropped. `$session_name` is available whenever a custom format is set, independently of segment visibility; use a group such as `($sep$session_name)` so unnamed sessions leave no separator.
|
|
159
|
+
|
|
160
|
+
## Formatting rules
|
|
161
|
+
|
|
162
|
+
- Literal text, pipes, and spaces render verbatim; the template owns spacing.
|
|
163
|
+
- `$session_name` is independent of `components.footer.styles.starship.segments.sessionName` in custom formats.
|
|
164
|
+
- Built-in wide layout appends cache totals to Tokens, `(sub)` to Cost, and `(auto)` to Context when available.
|
|
165
|
+
- Custom formats keep `$tokens`, `$cost`, and `$context` backward-compatible. Add `$cache_read`, `$cache_write`, `$subscription`, and `$auto_compaction` explicitly for atomic telemetry.
|
|
166
|
+
- `DEFAULT_COMPACT_FOOTER_FORMAT` omits model/provider and atomic telemetry. Add variables to `components.footer.styles.starship.compactFormat` to opt in at narrow widths. The flat `compactFooterFormat` key remains migration-only input.
|
|
167
|
+
- Auto-compaction settings refresh at the next normal Footer synchronization. Unsupported Pi capabilities or read errors omit optional markers.
|
|
168
|
+
- Unknown variables render empty.
|
|
169
|
+
- `$fill`, `$wrap`, and `$wrap_sep` are structural and never render visible text.
|