Skip to main content

run_repl

Function run_repl 

Source
pub fn run_repl<F>(config: ReplRunConfig, execute: F) -> Result<ReplRunResult>
Expand description

Runs the interactive REPL and delegates submitted lines to execute.

§Fallback behavior

This prefers the interactive editor loop, but it falls back to basic line-by-line stdin mode when interactive assumptions do not hold. That includes non-terminal stdin and terminals that do not support the cursor position probe used by the editor layer.

When that fallback happens, the function emits a warning to stderr unless the caller explicitly requested basic input mode through the config.

§Errors

Returns an error when the interactive editor layer fails or when the supplied execute callback returns an error for a submitted line.