GitHub - nushell/reedline: A feature-rich line editor - powering Nushell
Repository navigation
reedlinePublic
About
A feature-rich line editor - powering Nushell
docs.rs/reedline/Topics
line-editor nushell rustResources
Readme MIT licenseContributing
Contributing Activity Custom propertiesStars
832 starsWatchers
8 watchingForks
270 forks Report repositoryBranches
Tags
Go to Branches page Go to Tags page
Latest commit
History
890 Commits
View commit history for this file.
Folders and files
| Name | Name | Last commit message | Last commit date |
|---|---|---|---|
| .github | .github | ||
| assets | assets | ||
| examples | examples | ||
| src | src | ||
| .gitignore | .gitignore | ||
| .typos.toml | .typos.toml | ||
| CONTRIBUTING.md | CONTRIBUTING.md | ||
| Cargo.lock | Cargo.lock | ||
| Cargo.toml | Cargo.toml | ||
| KEYBINDINGS.md | KEYBINDINGS.md | ||
| LICENSE | LICENSE | ||
| README.md | README.md | ||
| UX_TESTING.md | UX_TESTING.md | ||
Repository files navigation
A feature-rich line editor - powering Nushell
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.
Community and roadmap
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
Features
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.
Getting started
cargo add reedline
use 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.
Crate features
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.
Contributing
See CONTRIBUTING.md .
Alternatives
License
About
A feature-rich line editor - powering Nushell
docs.rs/reedline/