Expand description
TUI REPL for rl, built on [ratatui] and [crossterm].
§Layout
|---------------------------------|
| output area (scrollable) |
| >> dec int x = 10 |
| >> x + 1 |
| 11 |
|---------------------------------|
| >> _ (input bar) |
|---------------------------------|§Key bindings
| Key | Action |
|---|---|
Enter | Submit / continue multiline |
Ctrl+C | Exit |
Esc | Cancel multiline input |
↑ / ↓ | History navigation |
Shift+↑/↓ | Scroll output |
Ctrl+←/→ | Word jump |
Home / End | Line start / end |
Modules§
- command_
handler 🔒 - REPL command dispatcher - handles all
:prefixed commands. - depth_
checker 🔒 - Determines whether a multiline input block is complete and ready to evaluate.
- input_
eval 🔒 - Evaluates a complete input string and appends results to the output buffer.
- lines_
types 🔒 - Output line variants used by the REPL output buffer.
- logic_
loop 🔒 - The main REPL event loop - input handling, rendering, and evaluation dispatch.
- output_
render 🔒 - Converts the
OutputLinebuffer into ratatui [Line]s for rendering. - syntax_
highlighting 🔒 - Token-based syntax highlighting for the REPL input bar and output.
- utils 🔒
- Small shared utilities for the REPL.
Functions§
- start_
repl - Initializes the ratatui terminal, runs the REPL loop, and restores the terminal on exit. Prints any IO error to stderr.