Repository navigation
Speculative Terminal StandardForm
Speculative. A proposal, not adopted.
The Ideas page lists "StandardForm in the terminal" as an enriched text rendering of the boxes (Unicode, script characters, colour, a second line where the terminal allows) instead of a fall back to InputForm. Most of that is built. The CLI has a two-dimensional StandardForm on character cells, with a golden test, and the REPL still prints InputForm unless the reader asks for it. What is missing is the default, a fit to the terminal's width, a settled colour story, and tests that hold the rendering to the expression. This page says what is built, what the gaps are, and the smallest slice that closes them.
"Measured" means read or counted from the tree at origin/main (bfa63e225), with a path:line; nothing here was run (no node_modules, no builds, no tests). "Assumed" means reasoned from that reading and not executed. Paths are under the repository root.
Do not write a new text renderer. Keep the split that exists: StandardForm is the 2-D cell layout (layout with cell metrics, drawn by packages/cli/src/cell-layout.ts), and OutputForm is the one-line Unicode serialiser (toText). Change four things:
-
Default. The Node REPL and the one-shot CLI print StandardForm when stdout is a TTY, and InputForm otherwise, unless a config file or
:formsays otherwise. Today only show mode does this. -
Width. Lay out against the terminal's columns. A block wider than the terminal falls back, per result, to
toTextof the same boxes, then to InputForm. -
Environment. Describe the terminal's text capabilities (columns, Unicode, colour) in the environment record and read them in one place, so the REPL, the CLI and show mode stop deciding separately. Honour
NO_COLORin the REPL too. - Fidelity. Add a small set of tests that hold the drawing to the expression, beyond the nine-case golden that exists.
InputForm stays one command away (:form inputform, -f inputform) for copy and paste.
-
The CLI's StandardForm is 2-D already.
renderDrawnsends"standardform"todrawLaid(makeBoxes(expr.json), …), with a comment "the web's boxes, laid out on character cells: stacked fractions, raised scripts" (packages/cli/src/engine.ts:122-126). Every other form goes through the format registry (engine.ts:97-110,:125). -
The default is InputForm.
form: Form = "inputform"(packages/cli/src/engine.ts:224); the README saysinputformis "the default" andstandardform"the notation the web shows, laid out on character cells", styled on a terminal and plain when piped or withNO_COLOR(packages/cli/README.md:57-63). It is chosen with:form(packages/cli/src/core.ts:191-196),-f/--form(packages/cli/src/command.ts:48) or a config file'sform(packages/cli/src/config.ts:32-35). -
Show mode opts in by capability.
presentsetssession.form = "standardform"whencan.interact(env, "keys"), with the comment "Someone at a terminal reads 2-D StandardForm; a pipe keeps the one-line form" (packages/cli/src/present.ts:64-65). That is the docs terminal (packages/components/src/notatio-terminal.ts:262-264). The interactive REPL (packages/cli/src/repl.ts:20-22) builds aNodeHostwith no environment and no form default, so it prints InputForm. -
Two one-line renderers in
boxes.toText(Unicode glyphs, script characters where every character has one, fractionsa/bparenthesised "wherever the linear form would misread") andtoAscii(AsciiMath spelling) (packages/boxes/src/render/text.ts:1-5,:212-218; the tables inpackages/boxes/src/render/linear.ts:9-158). Other renderers inpackages/boxes/src/render/:latex.ts,mathml.ts,html.ts,markdown.ts(render/index.ts:5-21). None of them lays out in two dimensions; that ispackages/boxes/src/layout.ts, which is renderer-neutral and takes aMetricswith acellflag (layout.ts:1-10,:53). -
OutputFormmeans one line. The formatOutputForm(aliasesoutputform,text) encodestoText(makeBoxes(…)), "Not read back" (packages/formats/src/formats.ts:92-101). The wiki agrees: "StandardForm as one line of Unicode text … terminals, outlines, titles, logs" (Syntax-and-Formats.md:111). Wolfram'sOutputFormis the 2-D character form, so our name is the opposite of its precedent.OutputFormis inpackages/wolfram/src/system-names.ts:5120as a name only; there is noreference/OutputFormrecord (a search ofpackages/*/referencefinds onlyDisplayFormandFormBoxnear it,packages/boxes/reference/). -
The cell drawer.
drawLaidrunslayout(box, DEFAULT_STYLE, metrics)withcell: true,em: 1, text width = code points minus combining marks, and paints items onto a canvas of cells (packages/cli/src/cell-layout.ts:56-80,:262-277); rules and frames join as box-drawing characters (cell-layout.ts:189-208, joints fromcell-draw.ts). It returns the text and a baseline row soOut[n]=sits beside it (cell-layout.ts:235-259;packages/cli/src/core.ts:129-136). -
Colour.
styledmode paints weight, slant and colour as SGR: a lone letter italic, a number cyan unless coloured (cell-layout.ts:126-146). The SGR helpers are inpackages/cli/src/ansi.ts:5-17, errors arered(core.ts:114), theOut[n]=labeldim(core.ts:136), the promptbold(core.ts:96).stripAnsiexists for tests (ansi.ts:22-23). -
Colour switches.
cli-main.tssetscolor = isTTY && !NO_COLOR(packages/cli/src/cli-main.ts:49).runReplsetscolor = Boolean(process.stdout.isTTY)with noNO_COLORcheck (packages/cli/src/repl.ts:21).presentusesenv.colour !== "mono"(present.ts:38). -
The environment record.
Environmenthasengine,interaction,time,surface,form,layout,colour,theme,static(packages/frontend/src/environment.ts:33-46).TTYissurface: ["text"],layout: "grid",colour: "256",form: "AsciiMathForm"(environment.ts:78-89);PIPEisTTYwith no engine, no interaction andcolour: "mono"(:92-100).nodeEnvironment({isTTY, env})returnsPIPEoff a TTY, and on a TTY addsrasterfor kitty, iTerm2 or WezTerm and setscolourfromCOLORTERMandTERM(:119-134). Nothing readsEnvironment.form: the only match forAsciiMathFormoutside the record is a symbol table entry (packages/frontend/src/symbols.ts:1126), andgrepofpackages/cli/srcforenv.formfinds nothing. The record has no column count. -
Inline images.
detectProtocolreturnskittyoritermfromTERM,KITTY_WINDOW_ID,TERM_PROGRAM,LC_TERMINAL, only on a TTY (packages/cli/src/node-graphics.ts:30-40); otherwise plots draw on braille cells (packages/cli/src/textual.ts:1-4,packages/cli/src/cell-draw.ts). No sixel support exists. -
Tests.
packages/cli/tests/standardform.test.tsholds nine cases (powers, fraction, radical, nested fraction, sum, binomial, matrix, functions, constants) tostandardform.golden.json, regenerated withUPDATE_STANDARDFORM=1; checks that SGR strips back to the plain text and that a pipe gets no escapes (standardform.test.ts:9-15,:17-30,:41-60).present-standardform.test.tsholds two cases and checks a pipe's output is one line (:21-30).packages/boxes/tests/layout.test.tsandlayout.golden.jsoncover the layout. -
Docs are behind the code. The speculative environments page says terminal typesetting is "the only part of the terminal column with no existing code behind it. The REPL prints notatio (InputForm) meanwhile" (
Speculative-Rendering-Environments.md:278-281). The Boxes page already says that with cell metricslayout"writes a small math (stacked fractions, raised scripts)" (Boxes.md:112).Syntax-and-Formats.md:110calls StandardForm "typeset (KaTeX)", which is the web only.
The union has 62 heads: 47 named in the BoxNode type plus the 15 in CONTROL_BOX_HEADS (packages/boxes/src/box.ts:25-41, :52-125); ARITY lists the same 62 (box.ts:133-196). The table sorts them by what a character grid can do. "Built" is what the cell layout does today (layout.ts:347-414 dispatch, :571-596 math), "text" what toText writes (text.ts:79-208).
| Class | Heads | On a grid | Built in the cell layout |
|---|---|---|---|
| (a) one line |
RowBox, TextBox, TextData, StyleBox, TagBox, InterpretationBox, FormBox, TooltipBox, ButtonBox, TextCell, ErrorBox, PaneSelectorBox (first pane) |
text runs; Greek and operators are already Unicode in the boxes; operators spaced (layout.ts:697-738) |
yes (layout.ts:350-384) |
| (a) one line when it fits |
SuperscriptBox, SubscriptBox, SubsuperscriptBox
|
Unicode script characters when every character has one (digits, + − = ( ), n i up; a e o x down); no x²ⁿ-style guess for the rest |
yes, else stacked (layout.ts:609-623; tables :761-803). toText has a wider subscript table (h k l m n p s t, linear.ts:147-149) |
| (a) or (b) |
SqrtBox, RadicalBox
|
√x is one line only for a one-line radicand; otherwise a bar over the radicand with ┌│√ on the left |
yes (layout.ts:625-642) |
| (a) or (b) |
OverscriptBox, UnderscriptBox, UnderoverscriptBox
|
a repeat bar becomes a combining overline on each digit; otherwise stacked, centred | yes (layout.ts:644-666) |
| (b) more than one line | FractionBox |
numerator, a rule of ─, denominator, each centred, bar two cells wider; no bar when FractionLine -> False
|
yes (layout.ts:597-607). A vulgar-fraction glyph (½) is not produced by the layout |
| (b) |
GridBox, and the TagBox formatters Row, Column, Grid, Labeled
|
padded columns, optional frame and dividers as box drawing; spans | yes (layout.ts:416-528) |
| (b) | a fence beside something taller than a line |
⎛⎜⎝ ⎞⎟⎠ ⎡⎢⎣ ⎤⎥⎦, │, and ╔║╚ ╗║╝ for white brackets |
yes (layout.ts:443-456, :750-759) |
| (b) |
PanelBox, FrameBox, PaneBox
|
box-drawing frame; a PaneBox clips |
yes (layout.ts:530-565) |
| (c) cannot be shown |
GraphicsBox, GraphicsComplexBox, DiskBox, LineBox, PointBox, ArrowBox, RectangleBox, PolygonBox, PolyhedronBox, InsetBox, RasterBox
|
braille or box-drawing cells; an inline image where raster is declared; toText writes -Graphics-
|
cells: leafLines -> drawGraphicsBox (cell-layout.ts:40-42); toText: -Graphics- (text.ts:165-176) |
| (c) |
Graphics3DBox, GraphicsComplex3DBox, Polygon3DBox, Line3DBox, Point3DBox, CuboidBox
|
toText writes -Graphics3D-; the cell layout reserves a slot |
slot; no 3-D drawing in the cell layout that I found, so ? fills it (cell-layout.ts:50) |
| (c) | the 15 control boxes (SliderBox … RadioButtonBox) |
a one-line text control, driven from the keyboard in a TTY; toText writes -Slider-
|
yes (cell-layout.ts:42-45, packages/cli/src/control-draw.ts, drive.ts) |
| (c) |
DynamicBox, DynamicModuleBox, TableViewBox
|
DynamicBox read at the controls' starting values; TableViewBox is paged by pager; toText writes -Dynamic-, -TableView-
|
DynamicBox yes (cell-layout.ts:46-49); table via table.ts, pager.ts
|
| holes |
TemplateSlot, TemplateExpression
|
${name} |
plain (layout.ts:822-824) |
Measured exceptions to read as gaps: a "?" stands in for any leaf the drawer has no picture for (cell-layout.ts:50), which names nothing; toText's -Graphics- names the family but not the head. A placeholder that names the head (-Graphics3D-, -DiskBox-) would be one line of code in leafLines.
This is what Layout does today (packages/boxes/src/layout.ts), stated so a builder can extend it.
A block is {width, height, baseline, items}: a rectangle of cells, with baseline the count of rows from the top to the row text sits on (layout.ts:218-224). On cells the baseline of a leaf is ceil(height / 2) (cell-layout.ts:74), of a grid the same (layout.ts:524). across places blocks left to right aligned on their baselines (layout.ts:333-345), with a one-cell gap (CELLS.rowGap = 1, :200-212) where spaceBetween asks for one (around a binary operator, after a comma, :697-748).
Rules.
-
Text. A token row is one run, spaced by
spaced(): a space either side of a binary operator inSPACEDunless it begins the row or follows another operator or an opening fence; a space after a comma (layout.ts:697-738). Width isvisibleWidth: code points, minus combining marks, minus the invisible function-application and times (cell-layout.ts:53-56). -
Fraction.
width = max(num, den) + 2with a bar,maxwithout; numerator and denominator centred byfloor((width - w) / 2);height = num + 1 + den; baseline is the bar's row (layout.ts:597-607). -
Script. If every script character has a Unicode form, the script is appended to the base as text and the block stays one line. Otherwise the superscript block sits above the base, the subscript below, both at the right edge; baseline is the base's (
layout.ts:609-623). -
Radical. A bar of
─over the radicand,√on the baseline row; a radicand more than one row tall gets┌and│down the left; an index is a small superscript or a block to the left (layout.ts:625-642). -
Big operators.
UnderoverscriptBoxstacks over, base, under, centred (layout.ts:644-666);Sum(1/k^2, {k,1,n})drawsnabove∑ k⁻²abovek = 1(goldensum). -
Grid. Column width = widest cell, row height = tallest; centred by default,
Columnleft; gutters of 2 cells between columns and 1 row between rows (CELLS.gridColumns = 2,rowGap = 1,layout.ts:200-212,:458-528). -
Fence. A string
(,[,|,⟦,⟧next to a block more than one row tall becomes a column of bracket pieces as tall as the tallest sibling (layout.ts:443-456).
Worked examples, copied from packages/cli/tests/standardform.golden.json and present-standardform.golden.json:
a + b
─────── (a + b)/(c + d)
c + d
⎛n⎞ + 1 Binomial(n, k) + 1
⎝k⎠
⎛1 2⎞ Matrix([[1, 2], [3, 4]])
⎝3 4⎠
─────
√x + 1 Sqrt(x + 1)
Width, not yet built. The layout has no maximum width: a result takes the room it needs. The width and height of CellOptions bound a figure, not a formula (packages/cli/src/cell-draw.ts:26-33); present passes 60 as the width to textOf only for plots (present.ts:43-44). Show mode hands the terminal's columns to a driver, not to the layout (packages/cli/src/drive-node.ts:25, packages/cli/src/present.ts:35). Proposed rule: lay out, and if block.width > columns - labelWidth, try, in order, (1) toText of the same boxes if it fits on one line, (2) InputForm, which the terminal soft-wraps. A fraction does not wrap inside a block. The Out[n]= label width is the one formatOut computes (core.ts:133-136), so the available width is columns minus that.
Character width. Measured: width is a code-point count with combining marks removed (cell-layout.ts:56, :98); a wide East Asian character or an emoji counts as one cell, though a terminal gives it two. Assumed: math output rarely carries them, but TextBox and strings can. Rule to add: width is wcwidth-style, 0 for combining marks (\p{M}) and zero-width, 2 for East Asian Wide and Fullwidth (Unicode East_Asian_Width W or F), 1 otherwise; ambiguous-width characters (Greek, ∑, box drawing) count 1, which is what most terminals do and is the setting the user's terminal may change. The canvas stores one string per cell, so a wide character occupies its cell and the next one is left empty.
Two names, kept, with one decision to record.
-
StandardForm is the layout that may take several rows. It is what the web shows, drawn on cells (
engine.ts:123). -
OutputForm is the one-line serialiser, never more than one row (
formats.ts:92-101). It exists for places that need a line: a pipe, a title, a log, a search string (Syntax-and-Formats.md:111).
Recommend against a single renderer with a maxHeight option. Reasons: the one-line serialiser makes choices the layout does not (it parenthesises a non-unit operand of / and of a script, text.ts:54-56, :128-130; it has a second alphabet in linear.ts), and merging them couples the pipe format to the layout's spacing. What the environment can say instead is a width, and the fallback chain in §2 does the rest. The environment record gains two fields beside layout: "grid" (assumed names): columns: number | undefined and unicode: boolean; can.fit(env, width) is not needed.
Naming cost: our OutputForm is Wolfram's OutputForm flattened. A reader who knows Wolfram expects the 2-D one. The wiki already decided (Syntax-and-Formats.md:111), so this page does not reopen it; the open question below asks whether to.
The form field of Environment ("AsciiMathForm" on TTY, environment.ts:84) is unused. Either remove it or make it mean the fallback form for the environment (TTY: StandardForm; PIPE: InputForm), read by the CLI when no :form was chosen. The second gives the default in §Recommendation 1 a single home.
-
Where colour is used today. The
Out[n]=label dim (core.ts:136), the prompt bold (core.ts:96), errors red (core.ts:114,present.ts:48), a variable italic and a number cyan in StandardForm (cell-layout.ts:130-146), aStyleBox's weight andFontColor(cell-layout.ts:104-124,:129-135; named colours and#rrggbbas 24-bit),figure/braille marks (cell-draw.ts:30-32). -
Heads, strings. Not coloured. Assumed useful: a head name before
(in aHead(args)fallback, and a string inTextBoxwithShowStringCharacters. Keep to the 16 basic colours plus the 24-bitFontColorthe layout already writes, sinceEnvironment.colourdistinguishesmono,16,256andtrue(environment.ts:19) but the drawer writes 24-bit codes regardless (cell-layout.ts:119-122). Assumed: a 16-colour terminal garbles those; downgrade38;2;…to the nearest basic code whencolouris16. -
Switches.
NO_COLORis honoured bycli-main(cli-main.ts:49) and not by the REPL (repl.ts:21); a pipe isPIPE,colour: "mono"(environment.ts:92-100), andpresentand the CLI passcolor: falsefor it (present.ts:38). Proposal: one functioncolourOf(env, signals)returnsmonofor a non-TTY, for any non-emptyNO_COLOR, and forTERM=dumb; the REPL, the CLI andpresentcall it. The rule: the text with the SGR codes stripped is identical to the text without them (standardform.test.ts:41-48already holds that for nine cases). -
Copy. StandardForm on a grid cannot be selected as one line.
:form inputformre-prints in the retypeable form,-fis repeatable (command.ts:48),--jsonreturns the InputForm, TeX, MathJSON and WL together (command.ts:357), and%substitution is in the session (engine.ts:3; not re-read for its syntax). Proposal: when StandardForm printed a block taller than one row, a dim hint line says:form inputformonce per session, and:copywrites InputForm to the clipboard through OSC 52 where the terminal accepts it (assumed; OSC 52 support varies and is not read anywhere in the tree).
Rule. The text rendering must not show something that reads as a different expression. Concretely: no parentheses dropped on flattening; a script is written in Unicode only when every character has a Unicode script form (scriptChars, linear.ts:151-158; raised, layout.ts:805-808), else it is laid out raised or written ^(…); a fraction that goes to one line is a/b with a non-unit operand in parentheses (text.ts:19-30, :128-130); a result that does not fit its width goes to a rendering that is still faithful, never to a truncated one.
Measured on the code.
-
toTextholds the rule by construction:unit()parenthesises anything that is not a token or an already fenced row (text.ts:54-56). - The cell layout draws a fraction as two rows with no parentheses, which is faithful because the stacking carries the grouping; a fraction inside a script is drawn stacked, since
/has no script form (layout.ts:609-623). - Case to test, not a finding: a script whose base is itself scripted.
toTextwrites(x²)ⁿ(viaunit), and the cell layout'sscriptedlays the base and appends the script, sox²thenⁿreads asx²ⁿ. WhethermakeBoxeshands it a fenced base is not something I read. -
x^(n+1): a RowBox script ofn,+,1is written byplainasn + 1, which has spaces and so no script form, so it is stacked (layout.ts:697-738). Faithful. - The golden shows the engine's canonical order and form, not what was typed:
x^2 + y^3printsy³ + x²,1/k^2printsk⁻²(standardform.golden.json,powers,sum). That is the result of evaluation or canonicalisation, not of the renderer, but a reader may take it for the renderer's doing.
Tests that hold it (proposed; the repo's rule: a drawing is a golden, regenerated behind an UPDATE_* flag, never toMatchSnapshot, AGENTS.md "Testing"; the flag exists as UPDATE_STANDARDFORM, standardform.test.ts:11).
-
Corpus golden. Run the shared box corpus (
packages/boxes/tests/corpus.ts) throughdrawLaidat width 80 and 40, compared with a golden; regenerated withUPDATE_STANDARDFORM=1. A change to a rendering is a visible diff. (Assumed: the corpus is the right set; I did not read it.) -
Single-row agreement. For every corpus entry whose cell layout is one row, the stripped text equals
toTextof the same boxes after collapsing spaces. This is checkable without a parser and catches a dropped parenthesis or a script silently written another way. -
No-fallback-silence. For a script with no Unicode form (
x^(a+b),x_kwithkin the table andx_qnot), the layout is stacked, ortoTextwrites^; never a mixed Unicode form missing a character. - Fit. For widths 20, 40, 80, every result is no wider than the width, or is one InputForm line.
-
Parse back, where meant.
toTextis "not read back" (formats.ts:92), so no parse-back test for StandardForm. Where a golden for the one-line rendering of a reference example should read back, the reader to use is AsciiMath's, throughtoAsciiand theasciimathformat (formats.ts:104-111), whose round trip is pinned inpackages/formats/tests/asciimath.golden.json(Syntax-and-Formats.md:122-126); the CLI's text rendering is not that. -
Colour strip. SGR-stripped equals plain, for the corpus (extends
standardform.test.ts:41-48).
A head's expected value stays in its reference examples; none of these tests touch it (AGENTS.md "Testing": golden JSON "only for output that isn't a head's value").
The smallest first slice is the default and the width fit, in packages/cli only, plus one environment field.
-
nodeEnvironmentgainscolumns(from the caller; the function takes signals as arguments,environment.ts:113-119, soNodeSignalsgets an optionalcolumns).Environmentgainscolumns?: number. No other package changes. -
colourOfinpackages/frontend/src/environment.ts(or besideansi.ts): non-TTY,NO_COLOR,TERM=dumbgive mono.repl.ts:21andcli-main.ts:49call it. -
Default form.
runReplandcli-mainsetdefaults.form = "standardform"when stdout is a TTY and no configformis set. The one-shot CLI's piped output stays InputForm. Configformwins (config.ts:32-35). -
Width fallback. In
Session.renderDrawn(engine.ts:344-350), when the drawn block is wider thancolumnsless the label, returntoText(makeBoxes(json))if it fits, else InputForm.Sessiongains acolumnsfield next tocolor(engine.ts:225). -
Placeholder that names the head for an undrawn leaf in
leafLines(cell-layout.ts:50). -
Tests. Extend
standardform.test.tswith the fit test (4) and single-row agreement (2) over the nine existing cases plus a few that overflow; regeneratestandardform.golden.jsonwithUPDATE_STANDARDFORM=1. Packages touched:cli(engine, repl, cli-main, cell-layout, tests),frontend(environment).boxesis untouched.
Second slice, after answers 3 and 4 below: wide-character widths, colour: "16" downgrade, the head-name colouring, and the corpus golden at several widths.
-
Is StandardForm the REPL default on a TTY? Recommend yes. The code and the README already offer it, the docs terminal already does it, and the idea's complaint ("falls back to InputForm") is only true because the REPL's default was never changed. Risk: the ambiguous-width and font issues (box-drawing and bracket pieces
⎛⎜⎝) on terminals with a font missing them. Mitigation::form inputformand a configform. -
Keep our
OutputFormas the one-line form? Recommend keep. The wiki has it (Syntax-and-Formats.md:111) and the format is registered with that meaning. Cost: it is Wolfram's name for the 2-D form. If the owner wants parity, rename the one-line formatTextFormand letOutputFormalias the 2-D layout; that is a rename acrossformats.ts:92-101, the CLI aliases (engine.ts:143) and the wiki table, best done as a codemod (AGENTS.md"Git hygiene"). -
Is the fallback on overflow
toText, then InputForm? Recommend yes. It keeps a faithful, shorter form before the retypeable one. Alternative: scroll horizontally in a pager (pager.tsexists for tables); more work, and not for a first slice. -
Wide characters: build
wcwidthourselves or take a standard library? Recommend a small standard library (string-widthor the platform'sIntl.Segmenterfor graphemes plus a width table), per AGENTS.md ("common/standard libraries"), added toclionly. Assumed:string-widthis not yet a dependency; I did not readpackages/cli/package.json. -
Sixel? Recommend no. Kitty and iTerm are detected (
node-graphics.ts:30-40); sixel support needs a query of the terminal (DA1) that a first slice should not add. Plots already draw on braille. -
Copy button. Recommend the dim hint now and OSC 52
:copylater; the hint costs one line of output, the clipboard needs terminal cooperation. -
Should the environment's
formbe the default's source? Recommend yes (see §3), replacing the unused"AsciiMathForm"onTTYwithStandardForm,PIPEwithInputForm. -
Update the wiki pages (
Speculative-Rendering-Environments.md:278-281,Syntax-and-Formats.md:110) and remove the item from Ideas when the first slice lands. Recommend yes.
Measured (read): the REPL default form and the opt-in paths (engine.ts:224, core.ts:191-196, present.ts:64-65, repl.ts:20-22); the cell layout's rules for fractions, scripts, radicals, stacks, grids, fences (layout.ts); the drawer and its width function (cell-layout.ts); toText, toAscii and their script tables; OutputForm as one line (formats.ts); the environment presets and detector (environment.ts); that Environment.form has no reader; NO_COLOR in cli-main.ts and not in repl.ts; image protocol detection; the tests and goldens named; the head count (62: 47 named, 15 controls; ARITY has 62 lines, box.ts:133-196).
Assumed (not run, not read to the end): that the goldens match what the code produces today (nothing was executed); the parenthesisation of a scripted base by makeBoxes; the contents of packages/boxes/tests/corpus.ts; that no 3-D drawing exists in the cell layout (I found none by search); how terminals render ambiguous-width and bracket-piece characters; the support for OSC 52, 16-colour downgrades and string-width; the % history's syntax. Not determined: the cost of the width fallback on very large results, and what the CLI does with a Session that has no columns today (assumed: nothing).