spectral-m2
A new face for the M2 prompt. It’s still the good old REPL underneath, just with a TUI that doesn’t feel like 1995.
cargo install spectral-m2 --locked
sp2
What’s nicer
- Highlighting as you type, and Enter on an unfinished expression just continues it on the next line.
- Rendered output: TeX becomes actual maths in the terminal (stacked fractions,
ℚif you like), long outputs fold, andhelppages show up inline with clickable links. - Side views of your session: just the code, just the values, printed output, or the syntax tree of what you typed.
- History with prefix search: type
ide, press Up, get only things starting withide. Shared live between open shells. - Sessions: your code is saved on exit and
/resumebrings it back (by re-running it)./saveand/loadwork with any.m2file. - Colour schemes: catppuccin, tokyo night, gruvbox, everforest, rosé pine, kanagawa… light and dark.
Your init.m2 and installed packages load as usual.
Getting around
Type / on an empty line and everything is listed. The ones you’ll use most:
| Alt+C / V / P / T | View code / values / printed output / syntax tree |
| Shift+Enter | New line |
| Alt+R | Restart M2 |
| Ctrl+O | Settings (theme lives here) |
| Alt+K | Rebind keys |
| Ctrl+C | Quit |
You’ll need
M2on yourPATH- A terminal with true colour. Kitty, WezTerm, Ghostty, foot and the like are perfect.
- A Nerd Font for the icons, or
SPECTRAL_M2_BASIC_GLYPHS=1
Not yet
You can’t interrupt a running computation yet (a cell gives up after 5 minutes), and it’s one evaluation at a time.