Reedline is a line editor in the tradition of bash's readline and zsh's zle, built for what people expect from a modern shell: syntax highlighting, completions, interactive menus, history hints, multiline editing and more.
It is currently primarily developed as the interactive editor for nushell, striving to provide a pleasant interactive experience.
Talk to us in the #reedline channel of the Nushell Discord, ideally before you start a larger change.
Roadmap:
- Prompt, history, hints and the API
- Edit modes: emacs, vi and helix
- Completion menu: actions, insertion and display
EditMode: Emacs, Vi and Helix with configurable keybindings, switchable at runtime.Validator: multiline editing.Highlighter: syntax highlighting.CompleterandMenu: completions in a columnar, list, IDE-style or description menu.History: plain file or SQLite, shared between sessions, with interactive search.Hinter: fish-style autosuggestions.Prompt: custom and transient prompts, semantic prompt markers (OSC 133).StatusLine: a live line under the buffer.ExternalPrinter: output from other threads while the prompt is active.- Undo and redo, system clipboard, visual selection, abbreviations and auto pairs.
- External editor, bracketed paste, kitty keyboard protocol and mouse click to move the cursor.
cargo add reedlineuse reedline::{DefaultPrompt, Reedline, Signal};
let mut line_editor = Reedline::create();
let prompt = DefaultPrompt::default();
loop {
match line_editor.read_line(&prompt) {
Ok(Signal::Success(buffer)) => println!("We processed: {buffer}"),
Ok(Signal::CtrlD) | Ok(Signal::CtrlC(_)) => {
println!("\nAborted!");
break;
}
x => println!("Event: {x:?}"),
}
}examples/: one runnable program per feature. Start withcargo run --example demo.- docs.rs/reedline: the API documentation.
- KEYBINDINGS.md: the default keybindings.
All off by default.
system_clipboard: cut, copy and paste to the system clipboard, beside reedline's own cut buffer.bashisms: history expansion such as!!and!$.sqlite:SqliteBackedHistory, with SQLite linked statically.sqlite-dynlib: the same, linked dynamically. Requiressqlite >= 3.45.3.libc: crossterm useslibcinstead ofrustix.
See CONTRIBUTING.md.