← Winnitude! Search  ·  Reader Mode (650 ms)
Links: Stay in Reader Retro Site Converter Retro Mode: OFF Original Page ↗
GITHUB · 69 LINKS

GitHub - nushell/reedline: A feature-rich line editor - powering Nushell

Repository navigation

reedline
Public

About

A feature-rich line editor - powering Nushell

docs.rs/reedline/

Topics

line-editor nushell rust

Resources

Readme MIT license

Contributing

Contributing Activity Custom properties

Stars

832 stars

Watchers

8 watching

Forks

270 forks Report repository
Branches

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:

Features

  • EditMode: Emacs, Vi and Helix with configurable keybindings, switchable at runtime.
  • Validator: multiline editing.
  • Highlighter: syntax highlighting.
  • Completer and Menu: 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:?}"),
    }
}

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. Requires sqlite >= 3.45.3.
  • libc: crossterm uses libc instead of rustix.

Contributing

See CONTRIBUTING.md .

Alternatives

License

MIT

About

A feature-rich line editor - powering Nushell

docs.rs/reedline/

Topics

line-editor nushell rust

Resources

Readme MIT license

Contributing

Contributing Activity Custom properties

Stars

832 stars

Watchers

8 watching

Forks

270 forks Report repository

Releases

Used by

Contributors

Languages