loading…

About this thing

foxpro-go is a from-scratch homage to the FoxPro for DOS TUI (and dBASE before it) — floating windows, draggable / resizable / focusable, a menu bar with hotkeys, half-box scrollbars, drop shadows, and a CGA-style palette. It targets a tcell.Screen, so the same widget code runs in a real terminal or, like here, against a WebAssembly canvas. No DOM hacks, no per-platform rewrites — just one cell buffer rendered two ways.


How it's built

  • Go One framework, two front-ends.
  • TUI Native build runs in a real terminal via tcell.
  • WASM The browser build compiles the same code with GOOS=js, drives a tcell.SimulationScreen, and paints the cell buffer to a canvas every animation frame.
  • Keyboard, mouse, wheel, and touch all feed the same event bus the terminal build sees — widgets don't know which one they're running on.

The aesthetic

Late-90s Borland / FoxPro DOS: single-line borders, blue/cyan/yellow chrome, half-box (▌▐) scrollbar gutters, hollow drop shadows. Title bars carry close and zoom glyphs. Modal dialogs darken the desktop behind them.

The whole palette swaps in one line — try ClassicPalette(), DraculaPalette(), or RetroGreenPalette() in your own demo.

What's on screen

  • Hello — a plain text window. Grab the title bar to drag; the bottom-right corner is the resize handle.
  • Scrollback — 80 lines through a vertical scrollbar. Wheel, PgUp/PgDn, or drag the thumb.
  • Status — wide narrow window the menu writes into. Watch it update when you pick a menu item.
  • Menu bar — File / Help across the top. F10 activates, Alt+F / Alt+H jump straight to a menu.

Try this

  • F10 opens the menu. File → New Window spawns more.
  • F2 (or Ctrl+F2 — whichever your browser leaves alone) toggles the command window — type HELP, VER, CLS, ECHO hi, or WAIT saving... for a FoxPro-style toast.
  • Click any window to bring it forward; drag any title bar to move it.
  • Shift+click on the desktop background drags the entire layout.
  • On a phone: tap a window to focus, drag a title bar with your finger — touch events route through the same pointer pipeline as a mouse.

Inside the framework

  • Manager — z-order, focus, hit-testing, event routing.
  • ContentProvider — every window's body is one of these. Text, lists, pane splits, scroll-wrapped, or your own.
  • Canvas — auto-clipping + scroll translation so providers draw in their own coords.
  • Pixel layer — sentinel-rune trick lets bitmaps overlay the cell grid with windows, shadows, and z-order still just working on top.
  • Dialog package — modal popups that block input behind them until dismissed.

Why a TUI in 2026

Terminals are still the densest, fastest, most-keyboard-driven surface we've got for tools that watch live state — debuggers, monitors, simulators. FoxPro's TUI got an enormous amount right: fast keyboard nav, predictable layout, no animation tax. This framework brings that vocabulary to Go and, via wasm, to anywhere a browser runs.

Run it yourself

The whole project is one Go module. The terminal build is go run ./examples/hello; the browser build you're looking at is make inside examples/wasm-hello (builds the wasm, serves it on :8765). Both share the same widget code — only the screen backend differs.

Source & docs: github.com/carledwards/foxpro-go · WASM_PORT.md for the browser-port architecture. The companion project 6502-sim-tui embeds this framework as its host shell.


Carl Edwards · thecarledwards.com