A cross-platform readline implementation in Rust with Emacs/vi keybindings, history, and completion.
RustyLine is a readline library for Rust that provides line-editing features for interactive command-line applications. It is based on Antirez's Linenoise but extends it with Unicode support, advanced completion, and multi-platform compatibility. It solves the problem of building command-line interfaces with rich editing capabilities like history search, word completion, and multi-line input in a cross-platform Rust environment.
Rust developers building interactive command-line applications, such as REPLs, shells, or any terminal-based tool requiring user input with line-editing features. It is also suitable for developers needing a cross-platform readline alternative with support for both Emacs and vi keybindings.
Developers choose RustyLine for its robust feature set, including full Unicode support, flexible completion, history search, and a kill ring, all in pure Rust. Its unique selling point is cross-platform compatibility (Unix and Windows) combined with extensibility through traits like Validator for multi-line editing, offering a familiar readline experience without external dependencies.
Readline Implementation in Rust
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Handles UTF-8 encoding, unlike the ASCII-only Linenoise it's based on, ensuring compatibility with international text and symbols in command-line inputs.
Supports customizable word and filename completion through the Completer trait, allowing for tailored suggestions in REPLs or shells, as demonstrated in the example code.
Includes Ctrl-R/Ctrl-S for forward and backward history search, working consistently on Unix and Windows (cmd.exe, PowerShell) for efficient command recall.
Features an Emacs-style kill ring for cutting and pasting text, plus undo functionality, enhancing text editing efficiency similar to GNU Readline.
Explicitly does not support PowerShell ISE or Mintty, and highlighting/colors are limited on Windows < 10 except with ConEmu, restricting use in some environments.
Multi-line editing requires implementing the Validator trait, adding development overhead compared to libraries with built-in multi-line modes, as noted in the README.
Relies on ANSI escape codes for advanced features, which may not work on all terminal emulators without configuration, potentially limiting portability in niche setups.