Prohelp and the prompt gutter
Write this so someone with no background can follow.
Stance
Prohelp is a shell-agnostic sibling product â not bundled with Open Shell.
When prohelp is installed, Open Shell may surface help without the user typing --help or help.
All gutter chrome renders on the display overlay layer. Nothing in this page prints to stdout or pollutes the pipeline record.
Automatic help affordance
When the current input buffer matches a prohelp entry, the shell shows an interactive help control immediately â no --help typing required.
This builds trust: users see help appear when the shell recognizes the command, instead of guessing whether documentation exists.
Detection
Open Shell evaluates the input buffer on each edit (debounced):
-
Match the first argv token (or full prefix) against prohelp SDL
detectPattern/matchPrefix -
On match, activate the help affordance for that topic id
-
On no match, hide the affordance (do not leave a stale
?)
Complex matchers stay in prohelp SDL; the shell only runs the cheap prefix/regex pass and asks prohelp whether a topic exists.
Placement (primary and secondary)
Primary â prompt gutter (recommended)
Reserve a gutter band at the left edge of the prompt row â black or terminal-background space before context tokens.
When prohelp recognizes the command, the ? help button is the first context affordance in that band (leftmost clickable/highlight target before [gcloud: â¦] tokens).
[?] [gcloud: ftn ▾] [py: .venv ▾] rjamd@desk:~/code › kubectl get
^ gutter ^ input buffer (matched)
-
Gutter sits on the display overlay â not part of the editable input string
-
Click, Enter-on-focus, or bound key opens prohelp scoped to the matched topic
-
When context chrome is on a separate row, gutter
?leads that row (see Front context integration)
Secondary â inline ghost (optional theme)
When gutter is disabled or the terminal is too narrow:
-
Show a ghost/hover
?immediately after the last character of the matched command prefix on the input line -
Lower contrast until hover/focus; same prohelp route as gutter
-
Themes may enable both; default is gutter-only
Help icon (glyph policy)
| Glyph | Verdict |
|---|---|
U+2370 ( |
Rejected â monospace fonts render it poorly; visibility inconsistent |
Raw |
Acceptable fallback â readable everywhere |
Custom TUI glyph |
v1 target â drawn in overlay layer (not stdout/stdin); theme pack id e.g. |
Ship ? first; swap to custom overlay glyph when terminal host supports styled overlay cells without touching the byte stream.
Prompt gutter zone (shell-owned chrome)
The gutter is a reserved left band on the prompt/display overlay:
-
Prevents command prompts from lining up flush against the terminal left wall
-
Owns basic CLI UX chrome so tools stop printing ad-hoc
>arrows and bullet lists to stdout
Gutter width (sketch)
| Profile | Columns (monospace cells) |
|---|---|
Minimal (help only) |
2 â one |
Standard |
3 â optional |
Choice menu |
4â6 â marker column + help; list markers may extend row below |
Width is fixed per theme (gutterWidthHint in prohelp/SDL theme packs), not computed from stdout.
Dynamic gutter content (overlay only)
All glyphs render on the display overlay â never stdout:
| Glyph / pattern | Role | Notes |
|---|---|---|
|
Line emphasis, input grabber |
Replaces programmer-printed |
|
Compact bullet for equal-option lists |
Shell-owned list chrome |
|
Simple choice menu markers |
Pairs with overlay list; not Readline key spam |
|
Prohelp entry when topic matches |
First affordance when prohelp detects command |
Scope: "good enough" basic CLI UX. Rich layouts (multi-pane help, search, pagination) stay in prohelp TUI and framework overlays.
Deprecated pattern: printf-style ad-hoc formatting in command output for prompts, arrows, and menus â prefer shell-owned gutter + display overlay.
Front context integration
When persistent shell context is active (e.g. gcloud configuration token focused, or namespace loaded):
-
Prohelp scopes to that namespace â
requiresContextkeys filter topics -
Gutter
?appears at the start of the persistent context row (not only on the input line) -
Invoking help while a context token is focused passes namespace + key values to prohelp
[?] [gcloud: ftn ▾] [py: .venv ▾] ← context row (gutter ? scopes to gcloud)
rjamd@desk:~/code › gcloud compute instances list
If both input-buffer match and focused context apply, context scope wins for topic filtering; input match still controls whether ? is visible.
Prohelp SDL extension fields (recommended)
Prohelp topic SDL (names tentative â implement in openshellorg/prohelp schema):
| Field | Type | Purpose |
|---|---|---|
|
string (regex) or array |
Match against input buffer for auto-help (primary) |
|
string |
Cheaper alternative to regex â literal prefix e.g. |
|
enum |
|
|
boolean (default true when detect fields present) |
Whether to show gutter/ghost affordance without user typing help |
|
string[] |
Context keys required; scopes help when token focused (existing field) |
|
string |
Default namespace for context-row help (e.g. |
|
enum |
|
|
string |
|
|
integer |
Theme hint for reserved gutter columns (default 2) |
|
integer |
When multiple topics match, lower number wins |
Example fragment:
topic: gcloud-compute-instances-list
matchPrefix: gcloud compute instances list
autoHelp: true
requiresContext: [gcloud.configuration, gcloud.project]
scopeNamespace: gcloud
gutterPlacement: primary-gutter
gutterIcon: ?
gutterWidthHint: 3
Layer placement
| Layer | Prohelp + gutter |
|---|---|
Display overlay |
Gutter band, |
Context chrome |
Context-row gutter |
Control plane |
Routes focus: gutter |
Base (stdout) |
Never â pipeline record stays clean |
Non-goals
-
Bundling prohelp with Open Shell
-
Requiring prohelp for shell startup
-
Replacing prohelp TUI with gutter alone â gutter is discoverability, not the help viewer
Input-line primary: ▶ in the gutter
The gutter’s primary job on the command input row is to hold ▶ — the type-here grabber.
That is the canonical reason the input line has a gutter.
-
Draw
▶inside the gutter band — not as a separate chevron after an empty gutter cell. -
Auto-
?, list markers (▪, A–Z), and emphasis arrows share the same gutter column(s) when active (e.g.[?▶]). -
Context rows may indent to gutter width for alignment; they do not get a blank faux-gutter that pretends to own
▶.
See prompt spatial layout for 1-line / 2-line placement.
Arrow mode (▶ lifetime)
▶ in the input gutter is not a hard-coded always-on history glyph.
Top-bar arrow mode:
-
ephemeral— reticle while editing; gone after submit; never in copy -
persist— remains on committed history rows; present in copy
Detail and ASCII: prompt spatial layout. Overlay-only persist (visible but stripped from copy) is advanced later.
Line modes and gutter
With prompt spatial layout:
-
2-line: gutter holds
▶(and optional?) on the input row only; command editor to its right; context row indents to gutter width -
1-line: gutter holds
▶at the left of the single combined row
Auto-? still appears when prohelp matches the input buffer — never inserted into the editable command string.
Context-token focus may still scope help; see front-context integration above.
Related
-
Prompt spatial layout — 1-line / 2-line modes; gutter on input row;
▶as type-here marker