Replace the current console REPL (src/Interpreter) with a brand-new, full-screen,
IDE-like TUI for G#. The new REPL adopts the AppShell chrome model and widget stack
proven in ..\Oahu\src\Oahu.Cli.Tui (Spectre.Console), borrows the keyboard-first,
calm-color UI language of OpenCode, and reuses G#'s existing LanguageServer
analysis (completions, hover, diagnostics, semantic tokens, formatting) so the prompt
behaves like a real editor rather than a line reader.
Program.cs— entry point; runs file mode (.gspath) orrepl.Run();--logflag.Repl.cs— generic line/multiline editor over the primary console buffer; manual cursor math (SubmissionView), history via PageUp/Down,#-prefixed meta-commands,IsCompleteSubmissionfor continuation.GSharpRepl.cs— G# specialization: per-token coloring inRenderLine, incremental state viaCompilation.ContinueWith,#showTree/#showProgram/#cls/#reset.
Limits: no alt-screen, single-prompt-at-cursor model, no completion/hover, no resize
handling, no panes, ad-hoc ConsoleColor, no themes/accessibility.
CoreCompilation:ContinueWith,Evaluate(variables), diagnostics with severity, tree/IL dumps — keep as the eval core.LanguageServer:HoverComputer, completion (TypeClauseCompletions),SemanticTokensHandler,FormattingEngine,CodeActionComputer, diagnostics. These are in-process libraries we can call directly (no LSP socket) for IDE features.
Shell/AppShell.cs— header + tab strip + body + pinned hint bar, modal overlay, logs overlay, progressive Ctrl+C, two-tier render loop,IKeyReader(testable input).Shell/AltScreen.cs— alt-screen, synchronized update (DEC 2026), erase-to-EOL.Themes/Theme.cs+Tokens/Tokens.cs+Tokens/SemanticColor.cs— semantic palette (Default/Mono/HighContrast/Colorblind),NO_COLOR/screen-reader → Mono.- Widgets:
HintBar,TabStrip,StatusLine,Pager,SortableTable,PulseSpinner,Dialog,TextInput,SelectList,TimelineItem,ITabScreen, modal/broker.
- Calm by default: static chrome, one animated element (status verb), color reserved for diagnostics/run state — same restraint as Oahu's tokens.
- Keyboard-first:
1-6tabs,:command palette,/search,?help, progressive Ctrl+C. - A session is a transcript: each submission becomes a collapsible "cell" (input + result/diagnostics), OpenCode-style, scrolled in the body with a Pager.
- IDE editor pane: gutter line numbers, live syntax tokens, inline diagnostics squiggles, ghost completions, hover on demand.
╭─ gsharp ─────────────────────────────── session · 12 cells · idle ─ v1.0 ─╮
│ 1 REPL 2 History 3 Variables 4 Diagnostics 5 Help 6 Settings │
├───────────────────────────────────────────────────────────────────────────┤
│ [1] » let xs = [1,2,3].Select(x => x*2) │
│ = [2, 4, 6] │
│ │
│ [2] » func fib(n int) int { n < 2 ? n : fib(n-1)+fib(n-2) } │
│ ✓ defined fib(int) int │
│ │
│ [3] » fib(10 │
│ 1 │ fib(10| │
│ ╰── GS0019 expected ')' │
│ ┌ completions ────────────┐ │
│ │ ❯ fib(n int) int │ │
│ │ filter · stdlib │ │
│ └─────────────────────────┘ │
├───────────────────────────────────────────────────────────────────────────┤
│ ⏎ run · ⇧⏎ newline · Tab complete · K hover · : palette · L logs · ^C quit│
╰───────────────────────────────────────────────────────────────────────────╯
Command palette (:), same as Oahu §11 language:
╭─ : ───────────────────────────────────────────╮
│ : reset_ │
│ reset clear session state │
│ show tree toggle parse-tree dump │
│ show il toggle bound/IL dump │
│ load <file.gs> run a file into session │
│ ↑↓ navigate · Tab complete · Enter run · Esc │
╰────────────────────────────────────────────────╯
New project src/Repl (GSharp.Repl, exe, net10.0) replaces Interpreter.
src/Repl/
Program.cs # arg parse (--log, file mode), TTY guard, alt-screen
ReplHost.cs # owns AppShell lifecycle (port of Oahu TuiHost)
Engine/
SessionEngine.cs # wraps Compilation.ContinueWith + variables; cells
AnalysisBridge.cs # calls LanguageServer computers (hover/complete/tokens)
Shell/ (port of Oahu) # AppShell, AltScreen, IKeyReader, CtrlCState, IModal
Themes/ Tokens/ # port verbatim
Widgets/ # HintBar, TabStrip, StatusLine, Pager, completions popup
Screens/
ReplScreen.cs # editor pane + transcript (tab 1)
HistoryScreen.cs VariablesScreen.cs DiagnosticsScreen.cs
HelpScreen.cs SettingsScreen.cs
Two-tier loop, alt-screen, themes, modals, IKeyReader → keep Oahu semantics so unit
tests drive a fixed key queue. Console.ForegroundColor highlighting is replaced by
semantic tokens.
- REPL — editor pane (highlight, gutter, completions, hover, inline diagnostics) + scrollable transcript of cells.
- History — past submissions; Enter re-loads into editor.
- Variables — live
variablesmap: name · type · value (SortableTable). - Diagnostics — full list, jump-to-cell.
- Help — keybindings/
:verbs. - Settings — theme, show-tree/IL, ascii fallback.
: palette gives parity verbs for everything (reset, load, show tree/il, theme).
- Highlight:
SemanticTokensHandler/SyntaxTree.ParseTokens→ token markup. - Completion:
TypeClauseCompletions+ symbols → popup; Tab = LCP. - Hover (
K):HoverComputerflyout. Diagnostics: live squiggles + Diagnostics tab. - Format (
⇧⌥F):FormattingEngine. Continuation: keepIsCompleteSubmission.
- Scaffold
GSharp.Repl, port Shell/Themes/Tokens/widgets, empty REPL tab. - SessionEngine: cells, run, transcript Pager, ⏎/⇧⏎.
- Editor pane: highlight + gutter + inline diagnostics.
- Completions + hover. 5.
:palette + other tabs. 6. Logs/accessibility/Ctrl+C. - Delete
src/Interpreter: swap sln, repoint tooling, port tests toRepl.
StyleCop-as-error (order fields/public first), net10.0; add Spectre.Console
PackageReference. IKeyReader/StyledTable deterministic tests like Oahu. Wholesale
eval tests can OOM — filter + capped threads. Accessibility themes ship but are not a v1
gate.
-
Spectre.Console: yes — added as a dependency of
GSharp.Repl. -
Project:
src/Repl(GSharp.Repl) is the only REPL project;src/Interpreteris deleted (sln, tooling, andInterpreter.Testsrepointed toReplin phase 7). -
Accessibility (Mono/HighContrast/Colorblind themes, screen-reader/
NO_COLORfallback): nice-to-have, not required for v1 — port tokens but don't gate ship on it. -
Meta-commands: drop
#-prefixed commands entirely; the:command palette is the only meta surface (:reset,:show tree,:show il,:load <file.gs>,:theme).
None — ready to scaffold.