A readline replacement written in Rust

Overview

A readline replacement written in Rust

GitHub Crates.io docs.rs CI status Discord Twitch Status

Basic example

// Create a default reedline object to handle user input

use reedline::{DefaultPrompt, Reedline, Signal};

fn main() {
    let mut line_editor = Reedline::create()?;
    let prompt = DefaultPrompt::default();

    loop {
        let sig = line_editor.read_line(&prompt).unwrap();
        match sig {
            Signal::Success(buffer) => {
                println!("We processed: {}", buffer);
            }
            Signal::CtrlD | Signal::CtrlC => {
                line_editor.print_crlf().unwrap();
                break;
            }
            Signal::CtrlL => {
                line_editor.clear_screen().unwrap();
            }
        }
    }
}

Integrate with custom Keybindings

// Configure reedline with custom keybindings

//Cargo.toml
//	[dependencies]
//	crossterm = "*"

use {
  crossterm::event::{KeyCode, KeyModifiers},
  reedline::{default_emacs_keybindings, EditCommand, Reedline},
};

let mut keybindings = default_emacs_keybindings();
keybindings.add_binding(
	KeyModifiers::ALT,
  KeyCode::Char('m'),
  vec![EditCommand::BackspaceWord],
);

let mut line_editor = Reedline::create()?.with_keybindings(keybindings);

Integrate with custom History

// Create a reedline object with history support, including history size limits

use reedline::{FileBackedHistory, Reedline};

let history = Box::new(
  FileBackedHistory::with_file(5, "history.txt".into())
  	.expect("Error configuring history with file"),
);
let mut line_editor = Reedline::create()?
	.with_history(history)
	.expect("Error configuring reedline with history");

Integrate with custom Highlighter

// Create a reedline object with highlighter support

use reedline::{DefaultHighlighter, Reedline};

let commands = vec![
  "test".into(),
  "hello world".into(),
  "hello world reedline".into(),
  "this is the reedline crate".into(),
];
let mut line_editor =
Reedline::create()?.with_highlighter(Box::new(DefaultHighlighter::new(commands)));

Integrate with custom Tab-Handler

// Create a reedline object with tab completions support

use reedline::{DefaultCompleter, DefaultCompletionActionHandler, Reedline};

let commands = vec![
  "test".into(),
  "hello world".into(),
  "hello world reedline".into(),
  "this is the reedline crate".into(),
];
let completer = Box::new(DefaultCompleter::new_with_wordlen(commands.clone(), 2));

let mut line_editor = Reedline::create()?.with_completion_action_handler(Box::new(
  DefaultCompletionActionHandler::default().with_completer(completer),
));

Integrate with custom Hinter

// Create a reedline object with in-line hint support

//Cargo.toml
//	[dependencies]
//	nu-ansi-term = "*"

use {
  nu_ansi_term::{Color, Style},
  reedline::{DefaultCompleter, DefaultHinter, Reedline},
};

let commands = vec![
  "test".into(),
  "hello world".into(),
  "hello world reedline".into(),
  "this is the reedline crate".into(),
];
let completer = Box::new(DefaultCompleter::new_with_wordlen(commands.clone(), 2));

let mut line_editor = Reedline::create()?.with_hinter(Box::new(
  DefaultHinter::default()
  .with_completer(completer) // or .with_history()
  // .with_inside_line()
  .with_style(Style::new().italic().fg(Color::LightGray)),
));

Integrate with custom Edit Mode

// Create a reedline object with custom edit mode

use reedline::{EditMode, Reedline};

let mut line_editor = Reedline::create()?.with_edit_mode(
  EditMode::ViNormal, // or EditMode::Emacs or EditMode::ViInsert
);

Are we prompt yet? (Development status)

This crate is currently under active development in JT's live-coding streams. If you want to see a feature, jump by the streams, file an issue or contribute a PR!

  • Basic unicode grapheme aware cursor editing.
  • Configurable prompt
  • Basic EMACS-style editing shortcuts.
  • Configurable keybindings.
  • Basic system integration with clipboard or optional stored history file.
  • Content aware highlighting or validation.
  • Autocompletion.
  • Advanced multiline unicode aware editing.

For a more detailed roadmap check out TODO.txt.

Join the vision discussion in the vision milestone list by contributing suggestions or voting.

Alternatives

For currently more mature Rust line editing check out:

Comments
  • [Add] first implementation of auto completion

    [Add] first implementation of auto completion

    Initial commits for adding the autocomplete feature; I would need to understand how we want to recognize the tab event and especially how to recognize multiple tabs event in series to go on with the suggestions; let me know if you have some ideas

    opened by mzanrosso 29
  • SQLite History (third version)

    SQLite History (third version)

    This is the third version of a history database for reedline, based on the previous discussions on Github and Discord.

    • The history trait is modified to be more flexible and support all the interesting metadata:

      https://github.com/nushell/reedline/blob/5fc904e0750f54a065720c1b74acecc6d208f890/src/history/base.rs#L116-L153

      The FileBackedHistory was rewritten to be based on this new trait, returning errors if the user tries to filter by things it doesn't support.

      Each history item stores the command line plus some additional info:

      https://github.com/nushell/reedline/blob/5fc904e0750f54a065720c1b74acecc6d208f890/src/history/item.rs#L44-L64

    • All the stateful cursor functionality (back, forward) is removed from the History trait and moved to a separate HistoryCursor struct that works with any history. I also moved all the history tests in there because they use the cursor.

    • The historical metadata is stored is used by using the new update_last_command_context function so as to not make this a breaking change:

              Ok(Signal::Success(buffer)) => {
                  line_editor
                      .update_last_command_context(&|mut c: reedline::HistoryItem| {
                          c.start_timestamp = Some(chrono::Utc::now());
                          c.hostname = Some(gethostname::gethostname().to_string_lossy().to_string());
                          c.cwd = std::env::current_dir()
                              .ok()
                              .map(|e| e.to_string_lossy().to_string());
                          c.session_id = Some(session_id);
                          c
                      })?;
      

      This can be called multiple times to set values that are only known after the command has run (e.g. duration, exit_status)

    Stuff that should be considered (later):

    • Errors: Most methods of the history trait are fallible and IMO should stay that way. Right now the Error type is String because I don't know how you want to handle errors. Right now it seems like only std::io::Error is used in other places, but there's no specific Error struct. Errors from the history are handled as .except("todo: error handling") right now because I didn't want to change the signature of any public reedline methods.
    • Right now there's no UI or anything to use the additional features. Also the history is instantly merged across all shells for SQLite. These should be changed later.

    References:

    • https://github.com/nushell/reedline/issues/66
    • https://github.com/nushell/reedline/pull/376
    • https://github.com/nushell/reedline/pull/131
    opened by phiresky 28
  • Cannot type curly brackets in engine-q

    Cannot type curly brackets in engine-q

    After building and running engine-q, I cannot type { or }. I use an italian keyboard, where opening and closing curly brackets implies pressing: Shift + Alt Gr + Key.

    Note that even just typing [ or ] seems to present a problem, and it implies pressing: Alt Gr + Key. In this case, the square brackets are printed, but they can only be cancelled by pressing Backspace twice; it looks like "two characters were pushed" instead of one.

    bug A-Events P-medium 
    opened by aslynatilla 25
  • On a mac running engine-q get Command k to work.

    On a mac running engine-q get Command k to work.

    In nushell when I type Command-k it clears the screen and we are happy...

    In engine-q it clears the screen and then on the next keystroke it takes me back to where I was in the terminal when I typed Command-k

    It is remembering where I last was and goes back there...

    It would be great to have this working as I use it all the time...

    bug A-Display P-high 
    opened by stormasm 22
  • Add duplicate column in sqlite history

    Add duplicate column in sqlite history

    Fix part of https://github.com/nushell/nushell/issues/6502, specifically, address @sholderbach's comment

    The history menu we provide out of the box could be more helpful to have functionality to filter for success and dedup afterwards.

    image
    opened by Kangaxx-0 18
  • feat: migrate and extend history search

    feat: migrate and extend history search

    • This PR addresses this Issue #55
    • BasicSearch was removed, and its behavior was migrated to the history module.
    • Additional features are an interactively displayed list, that is scrollable with CTRL-n/CTRL-r or CTRL-p
    • Maybe in the future make the displayed list optional?
    • The logic that makes this behavior possible is contained inside the history module.
    • The result is, that the main loop in readline_helper no longer needs to handle history_state and clean up in the right places

    https://user-images.githubusercontent.com/44893716/122376014-0dcab600-cf64-11eb-8c57-362789f107d4.mp4

    I wrote this PR against an earlier version of reedline. Now, pressing CTRL-r doesn't bring up the history_search anymore?

    opened by ahkrr 18
  • Move the clear screen/`Ctrl-L` logic inside the line editor engine

    Move the clear screen/`Ctrl-L` logic inside the line editor engine

    We currently handle the Ctrl-L screen clearing command by exiting the read_line() method with the Signal::CtrlL and keeping the line buffer state as is. This requires the read_line() method to respect the previous state of Reedline and collaboration from the side of the consumer. This might be less than optimal. We might consider moving the Ctrl-L handling into the Reedline engine with a call to the painter and maybe provide the Option to disable this. A public method to clear from the side of the consumer is already existing.

    enhancement good first issue A-Display A-API 
    opened by sholderbach 16
  • Minimal / simple implementation of SQLite-backed history

    Minimal / simple implementation of SQLite-backed history

    This PR implements a SQLite-based history. I kept it minimal for easy merging and future expansion.

    It should reproduce all features of the txt-backed history (arrow navigation, prefix filtering, history menu etc) and passes all the tests from file_backed. The History trait stayed almost the same so far.

    It doesn't really offer any additional features currently except storing an arbitrary context together with each history entry. In the future there should be functionality to filter by session, PWD, hostname, etc, but those will require deeper changes.

    when run with --features sqlite, the demo binary will store the history into history.sqlite3 and also add the run timestamp as metadata.

    some notes:

    • most of the history methods I think should probably be fallible. i didn't change this since i don't know what kind of error propagation you want - so right now there's more unwrap than should be.
    • the tests for file and sqlite backend should probably be merged (same for every "History" impl). right now i copy-pasted all the tests to the sqlite backed history, but barely modified anything.
    • i think the "cursor" functionality (back, forward, etc) should be separated out into a separate trait, but it works as is
    • i (intentionally) didn't implement the capacity limiting feature
    • the iterator currently loads everything in memory (like the file-based one does), to fix that some of the ownership / lifetimes would need changing
    • right now i json-serialize the context so the library user can decide what to store. this is inefficient in regards to storage, but it's going to be hard to store structured data in a generic manner otherwise. One solution might be to use a binary serialization method that's more efficient, but due to the sqlite json functions it's easy to create efficient indices on the schema as it is right now (e.g. create index on history(context->>'cwd', context->>'timestamp') for directory-based history
    opened by phiresky 14
  • prompt moves based on hint

    prompt moves based on hint

    The prompt moves and gives space to hint when it is located at the bottom.

    image the prompt moves upwards based on the suggestion image

    Note: This also removes the issue when the suggestion was being redrawn every second

    opened by elferherrera 14
  • Make reedline handling cursor shapes more configurable

    Make reedline handling cursor shapes more configurable

    This pr is a follow-up to #494. There were various complaints about my implementation being to invasive, so for now I made it toggleable, but I would like not only be able to toggle this, but to actually make it configurable.

    If merged, this should resolve #514.

    opened by CozyPenguin 12
  • render right prompt on the last line of the left prompt

    render right prompt on the last line of the left prompt

    This PR makes nushell+starship behave like other shells (e.g. zsh). Related: starship/starship#3982 Closes nushell/nushell#4909

    • nushell native prompt Screenshot from 2022-10-16 00-06-28
    • nushell + starship(disable line_break and add_newline) Screenshot from 2022-10-16 00-07-09
    • nushell + starship(enable line_break and disable add_newline) Screenshot from 2022-10-16 00-07-51
    • nushell + starship(enable line_break and add_newline) Screenshot from 2022-10-16 00-08-34
    opened by nibon7 11
  • ExecuteHostCommand doesnt run the command

    ExecuteHostCommand doesnt run the command

    hello

    im trying to run a simple command that returns output

    i've modified the demo example by adding a new keybiding:

    fn add_extra_keybindings(keybindings: &mut Keybindings) {
        // This doesn't work for macOS
        keybindings.add_binding(
            KeyModifiers::CONTROL,
            KeyCode::Char('f'),
            ReedlineEvent::ExecuteHostCommand("echo 'its working'".into()),
            // doesnt work
            // ReedlineEvent::ExecuteHostCommand(
            //     "/usr/bin/exa --all --icons".into(),
            // ),
        );
    }
    

    here i've setup the binding ctrl+f to run the command echo 'its working'

    what im expecting: reedline to print the output of the command in the prompt, just like a real shell. isnt that the expected behaviour?

    what im getting instead is:

    Our buffer: echo 'its working'
    prompt 〉
    

    that indicates that the buffer state after running the command is the command itself.

    i want the output to be printed in the terminal or maybe run another inner prompt that gets input which then will exit the result into reedline.

    what am i missing?

    i've looked a little in the source: engine.rs

                ReedlineEvent::ExecuteHostCommand(host_command) => {
                    // TODO: Decide if we need to do something special to have a nicer painter state on the next go
                    Ok(EventStatus::Exits(Signal::Success(host_command)))
                }
    

    but im not seeing any Command::new().arg() ... .spawn() etc, rusty stuff here; just a signal success with the command as string

    is this code running the command? seems to not.

    thanks in advance.

    more advanved extra topic: how can i run an external shell command that prompts a UI, for example skim the fuzzy finder inside reedline? (but that is after im solving the first problem)

    opened by alexzanderr 6
  • Rendering issue with ColumnarMenu and Suggestions that have a description

    Rendering issue with ColumnarMenu and Suggestions that have a description

    Platform I found this on Windows 11, but believe it to be not specific. Terminal software Windows Terminal, both nushell and powershell

    Describe the problem you are observing.

    Steps to reproduce

    1. create a sample program that shows the issue. The fastest way to do this is to use the "completions" example in the repo. The only problem is, it uses the DeafultCompleter, which doesn't take descriptions for the completion items. However, we can apply a very small diff to reedline itself:
    diff --git a/src/completion/default.rs b/src/completion/default.rs
    index 812c740..d4ac027 100644
    --- a/src/completion/default.rs
    +++ b/src/completion/default.rs
    @@ -98,7 +98,7 @@ impl Completer for DefaultCompleter {
    
                                         Suggestion {
                                             value: format!("{}{}", span_line, ext),
    -                                        description: None,
    +                                        description: Some(String::from("extra")),
                                             extra: None,
                                             span,
                                             append_whitespace: false,
    

    And now cargo run --example completions will show the issue.

    1. Run the example
    2. type "he" and then hit tab

    The very first time you do this, you'll get weird rendering:

    image

    If you hit tab again, or an arrow key, or anything else, it'll fix itself:

    image

    and then on future renderings, it does the right thing.

    This makes me really suspect it's some initial state being set up just incorrectly, but have not yet tried to actually diagnose the issue.

    bug A-Display A-Completions 
    opened by steveklabnik 1
  • nushell consumes CPU when idle

    nushell consumes CPU when idle

    Describe the bug

    nushell in interactive mode consumes some CPU time

    How to reproduce

    1. Launch nu in a terminal (interactive mode)
    2. Observe that nu process consumes some amount of CPU time, about 1%

    Expected behavior

    0% CPU consumed, sleeping in epoll_wait or something

    Screenshots

    No response

    Configuration

    | key | value | | ------------------ | ---------------------------------------- | | version | 0.72.1 | | branch | main | | commit_hash | fcdc4747311dd9075bdfd24bbc846144fda924f8 | | build_os | linux-x86_64 | | build_target | x86_64-unknown-linux-gnu | | rust_version | rustc 1.65.0 (gentoo) | | cargo_version | cargo 1.65.0 | | pkg_version | 0.72.1 | | build_time | 2022-12-02 16:08:55 +03:00 | | build_rust_channel | debug | | features | database, default, trash, which, zip | | installed_plugins | |

    Additional context

    strace:

    <...>
    epoll_wait(5, [], 3, 0)                 = 0
    epoll_wait(5, [], 3, 0)                 = 0
    epoll_wait(5, [], 3, 99)                = 0
    epoll_wait(5, [], 3, 0)                 = 0
    epoll_wait(5, [], 3, 99)                = 0
    epoll_wait(5, [], 3, 0)                 = 0
    epoll_wait(5, [], 3, 0)                 = 0
    epoll_wait(5, [], 3, 99)                = 0
    epoll_wait(5, [], 3, 0)                 = 0
    epoll_wait(5, [], 3, 99)                = 0
    epoll_wait(5, [], 3, 99)                = 0
    epoll_wait(5, [], 3, 99)                = 0
    epoll_wait(5, [], 3, 99)                = 0
    epoll_wait(5, [], 3, 0)                 = 0
    <...>
    

    Stack trace:

    (gdb) bt
    #0  0x00007f2adee3990a in epoll_wait (epfd=5, events=0x556afffb23d0, maxevents=3, timeout=99)
        at ../sysdeps/unix/sysv/linux/epoll_wait.c:30
    nushell/nushell#1  0x0000556afdf07585 in mio::sys::unix::selector::epoll::Selector::select (self=0x556affdf68c0, events=0x556affdf68d0,
        timeout=...) at src/sys/unix/selector/epoll.rs:68
    nushell/nushell#2  0x0000556afdf0a852 in mio::poll::Poll::poll (self=0x556affdf68c0, events=0x556affdf68d0, timeout=...) at src/poll.rs:400
    nushell/nushell#3  0x0000556afded5eed in crossterm::event::source::unix::{impl#1}::try_read (self=0x556affdf68c0, timeout=...)
        at src/event/source/unix.rs:83
    nushell/nushell#4  0x0000556afdec28d2 in crossterm::event::read::InternalEventReader::poll<crossterm::event::filter::EventFilter> (
        self=0x556afec79828 <crossterm::event::INTERNAL_EVENT_READER+8>, timeout=..., filter=0x556afe24c59d)
        at src/event/read.rs:64
    nushell/nushell#5  0x0000556afdec6958 in crossterm::event::poll_internal<crossterm::event::filter::EventFilter> (timeout=...,
        filter=0x556afe24c59d) at src/event.rs:223
    nushell/nushell#6  0x0000556afdec6288 in crossterm::event::poll (timeout=...) at src/event.rs:158
    nushell/nushell#7  0x0000556afcc0c676 in reedline::engine::Reedline::read_line_helper (self=0x7ffc16b85fe8, prompt=...) at src/engine.rs:501
    nushell/nushell#8  0x0000556afcc0c30c in reedline::engine::Reedline::read_line (self=0x7ffc16b85fe8, prompt=...) at src/engine.rs:440
    nushell/nushell#9  0x0000556afc98e2fe in nu_cli::repl::evaluate_repl (engine_state=0x7ffc16b91280, stack=0x7ffc16b92e90, nushell_path=...,
        prerun_command=...) at crates/nu-cli/src/repl.rs:307
    nushell/nushell#10 0x0000556afb694954 in nu::main () at src/main.rs:440
    
    opened by WGH- 3
  • Support for custom event handler

    Support for custom event handler

    Support for custom event handler

    I am currently using Reedline to develop a console for a custom language. And I am trying to implement the following feature:

    • Automatically add indent when enter is hit but validator says input is incomplete.
    >>> if 3:
    ...     a = 5
    ...     a<-- next line should start here
    
    • Automatic delete 4 spaces when delete is hit. My console treats tab as 4 spaces so I bind Tab key to automatically insert 4 spaces but I can not let delete to behave correspondingly. For example, delete 4 space if there are 4 before the cursor, otherwise delete a single character if there is any.
    >>>     <-- delete all 4 previous space here
    >>> asbds<-- only delete `s` from buffer
    

    There are also an option that a special event is made for indent handling. But it could be more useful and extensive if user defined handler for ReedlineEvent can be supported.

    enhancement 
    opened by TerenceNg03 1
  • Add history exclusion configuration

    Add history exclusion configuration

    A rough draft PR to solve #516, by letting users configure which command lines get excluded from history. For example, users can configure reedline so that command lines starting with a space are not saved.

    @sholderbach Let me know what you think, happy to revise this.

    opened by rgwood 8
  • Make insertion to the history optional (e.g. with leading space)

    Make insertion to the history optional (e.g. with leading space)

    Currently all submitted entries are directly appended to the history. (With the sqlite history we support amending the history entry afterwards based on an ID that is not part of the text based history) This might not always be desired (e.g. dangerous operation, something containing a secret key/password). Some shells support ignoring all lines that start with a space.

    Goal: allow us to make history insertion conditional/optional

    Requirements:

    • Needs to also work with the simple text based history.
    • hardcoding space at the beginning might be bad in some context (other programming languages)

    References

    bash/zsh support it

    enhancement help wanted good first issue A-History 
    opened by sholderbach 1
Releases(v0.14.0)
  • v0.14.0(Nov 7, 2022)

    New release for nushell 0.71.0

    This release adds some small improvements and slightly adjust how quick_completions are accepted.

    New features

    • Option to render the right prompt on the last line input by @nibon7 in https://github.com/nushell/reedline/pull/492 https://github.com/nushell/reedline/pull/501
    • Change of cursor shape depending on Vi edit mode by @CozyPenguin in https://github.com/nushell/reedline/pull/494

    Improvements

    • Support the h/j/k/l normal mode moves beyond buffer movements @sholderbach in https://github.com/nushell/reedline/pull/510
    • Custom validator and prompt code examples by @perlindgren in https://github.com/nushell/reedline/pull/500

    Bug fixes

    • Actually make sqlite-dynlib feature usable by @jcgruenhage in https://github.com/nushell/reedline/pull/504

    Breaking changes

    • Tab inline completion by @dandavison in https://github.com/nushell/reedline/pull/498
    • Split the main.rs example binary into examples/ by @sholderbach in https://github.com/nushell/reedline/pull/506

    New Contributors

    • @CozyPenguin made their first contribution in https://github.com/nushell/reedline/pull/494
    • @dandavison made their first contribution in https://github.com/nushell/reedline/pull/498

    Full Changelog: https://github.com/nushell/reedline/compare/v0.13.0...v0.14.0

    Source code(tar.gz)
    Source code(zip)
  • v0.13.0(Oct 17, 2022)

    New release for nushell 0.70.0

    This release adds some small improvements and makes it configurable how a line is accepted when pressing Enter.

    New features

    • Add Submit and SubmitOrNewline editor events by @tailhook in https://github.com/nushell/reedline/pull/490

    Improvements

    • Remove flicker on external print by @tailhook in https://github.com/nushell/reedline/pull/488
    • Added executable examples for individual reedline components by @perlindgren in https://github.com/nushell/reedline/pull/493
    • Documentation improvements by @perlindgren and @sholderbach in https://github.com/nushell/reedline/pull/493, https://github.com/nushell/reedline/pull/496, and https://github.com/nushell/reedline/pull/497

    New Contributors

    • @tailhook made their first contribution in https://github.com/nushell/reedline/pull/488
    • @perlindgren made their first contribution in https://github.com/nushell/reedline/pull/493

    Full Changelog: https://github.com/nushell/reedline/compare/v0.12.0...v0.13.0

    Source code(tar.gz)
    Source code(zip)
  • v0.12.0(Sep 28, 2022)

    New release for nushell 0.69.0

    This release adds some helpful new experimental features and improves the vi mode.

    Improvements

    • Allow external manipulation of the command line buffer, fixes #423. Very useful to integrate tools that don't directly work with our completion API (@unrelentingtech in https://github.com/nushell/reedline/pull/472)
    • You are now not forced to statically link sqlite by using the sqlite-dynlib feature instead of sqlite (@jcgruenhage, @sholderbach in https://github.com/nushell/reedline/pull/474)
    • Nushell specific: List that space can be bound through Char(' ') (@sholderbach in https://github.com/nushell/reedline/pull/486)
    • Vi-Refactor: Properly parse motions separate from the actions (@sholderbach in https://github.com/nushell/reedline/pull/484)
      • Improves . behavior: now useable with a count and only affecting editing operations.
      • Improvement to ; and .: Now picking up the last search from an editing operation and also usable in an editing operation
      • Finally: support for dh and dl
      • Fix vi character search (f/F/t/T) parsing (additonal work in https://github.com/nushell/reedline/pull/483)

    Breaking changes

    • Change history session_id to a systematically generated number (@fdncred) in https://github.com/nushell/reedline/pull/481, https://github.com/nushell/reedline/pull/485)

    Experimental new features

    • Basic external printer to output from a concurrent thread by @GrxE in https://github.com/nushell/reedline/pull/467

    New Contributors

    • @GrxE made their first contribution in https://github.com/nushell/reedline/pull/467
    • @jcgruenhage made their first contribution in https://github.com/nushell/reedline/pull/474

    Full Changelog: https://github.com/nushell/reedline/compare/v0.11.0...v0.12.0

    Source code(tar.gz)
    Source code(zip)
  • v0.11.0(Sep 6, 2022)

    New release for nushell 0.68.0

    This release helps to fix bugs around the use of our history.

    Improvements

    • Avoid a panic when accessing history entries (@nibon7)
    • Add has_last_command_context to test before trying to modify the history metadata (@unrelentingtech)

    This release was made possible by contributions from @morzel85, @nibon7, and @unrelentingtech

    Source code(tar.gz)
    Source code(zip)
  • v0.10.0(Aug 15, 2022)

    New release for nushell 0.67.0

    This release improves the undo/redo handling and several keybindings.

    Breaking changes

    • The API to change the buffer from a custom Menu has been changed to use the Editor struct to track undo relevant behavior (@bnprks)
    • The CircularCompletionHandler implementing the basic bash like completion and the associated ReedlineEvent::ActionHandler have been removed as they are not used in nushell and haven't been tested in a while
    • Update to crossterm 0.24 (@sholderbach)
      • We now reexport the KeyCode and KeyModifiers types directly so consumers don't have to explicit import the correct crossterm version (@ajeetdsouza, @sholderbach)

    Improvements

    • Undo/Redo will coalesce individual consecutive keypresses and deletions to words correctly, history navigation and menus are tracked correctly (@bnprks)
    • vi mode: Support for d0, d^, c0, and c^ (@bnprks)
    • Default for all editing modes: support Ctrl-h as Backspace (@morzel85)

    This release was made possible by contributions from @bnprks, @fdncred, @morzel85, and @sholderbach

    Source code(tar.gz)
    Source code(zip)
  • v0.9.0(Jul 28, 2022)

    New release for nushell 0.66.0

    This release adds support for more common vi commands and motions and removes the problematic periodic repaint for animations

    Breaking changes

    • The option to periodically repaint the prompt and content (initially used by an animated clock in the prompt) has been removed to remove a source of unexpected drawing behavior (@jntrnr)
    • Similarly we don't immediately redraw on resize and instead let the text wrapping flow regularly (@jntrnr)
    • Update the rusqlite dependency to 0.28 (@fdncred)

    Improvements

    • vi mode: Change the case of a character with ~ (@drbrain)
    • vi mode: Support repeating character search moves with ; and , (@drbrain)

    This release was made possible by contributions from @drbrain, @fdncred, and @jntrnr

    Source code(tar.gz)
    Source code(zip)
  • v0.8.0(Jul 5, 2022)

    New release for nushell 0.65.0

    This release adds support for more common vi commands and motions and includes several bugfixes

    Improvements

    • vi mode: Character replacement with r works (@drbrain)
    • vi mode: The whitespace delimited WORD motions W, E, and B are now supported (@drbrain)

    Bug fixes

    • Expose the new history IDs as strings via Display (@fdncred)
    • Fix of the bash style history substitutions like !! (@WindSoilder)
    • Fix of a potential underflow (@nibon7)

    This release was made possible by contributions from @drbrain, @fdncred, @nibon7, and @WindSoilder

    Source code(tar.gz)
    Source code(zip)
  • v0.7.0(Jun 14, 2022)

    New release for nushell 0.64.0

    This release introduces a new history API and thus enables addition of different history storage backends to support storing additional metadata that can in the future be used to present more relevant history entries to the user.

    Breaking changes

    • New API for the History, addition of several types to query the history independent of a running reedline session, addition of the SqliteBackedHistory (@phiresky)
    • We now use nu-ansi-term 0.46.0 to avoid an unsound Deref impl that confuses the clippy lint clippy::unnecessary_to_owned

    Improvements

    • Default keybindings were overhauled to support more common bindings in vi mode and make the code more readable (@Artturin, @sholderbach)

    Bug fixes

    • Don't panic if the history directory gets deleted during a running session (@WindSoilder)

    This release was made possible by contributions from @Artturin, @elferherrera, @fdncred, @phiresky, @sholderbach. @WindSoilder

    Source code(tar.gz)
    Source code(zip)
  • v0.6.0(May 23, 2022)

    New release for nushell 0.63

    This release contains several bug fixes and improvements to the vi-emulation and documentation.

    • Improvements to the vi-style keybindings (@sadmac7000):
      • w now correctly moves to the beginning of the word.
      • e to move to the end of the word.
    • Bugfixes:
      • Support terminal emulators that erroneously report a size of 0x0 by assuming a default size to avoid panics and draw nevertheless (@DhruvDh)
      • Fix ListMenu layout calculations. Avoids scrolling bug when wrapping occurs due to the line numbering (@ahkrr)
      • Avoid allocating to the total history capacity which can cause the application to go out of memory (@sholderbach)
    • Documentation improvements including addition of documentation intended for reedline developers (@petrisch, @sholderbach)

    This release was made possible with contributions from: @ahkrr, @DhruvDh, @petrisch, @sadmac7000, @sholderbach

    Source code(tar.gz)
    Source code(zip)
  • v0.5.0(May 3, 2022)

    New release for nushell 0.62

    This release contains several fixes to completions and vi-emulation as well as other small quality of life improvements.

    • vi keybindings:
      • Fix: deleting a character with x correctly adds it to the clipboard
      • new bindings: I to insert at the beginning of the line, C change to the end of the line, s/S substitute character/whole line with the insert mode
    • Completions:
      • partial completions will require matching prefix to not exhibit surprising behavior with fuzzy matching completions.
      • API break: Suggestion struct now has the append_whitespace field to optionally add a space after accepting the Suggestion, this avoids that a shell-like Completer will try to continue to complete the token
    • New EditCommands and ReedlineEvents:
      • ReedlineEvent::OpenEditor to shell out to a configurable external editor for long commands.
      • ReedlineEvent::ClearScrollback for screen clearing that also removes the scrollback buffer content
      • EditCommand::InsertNewline to insert the newline character that is correct for the platform (CRLF on Windows, LF on Unix) at the current position (Can be bound to Alt-Enter for multiline editing without Validator implementation)

    This release was made possible with contributions from: @elferherrera, @gipsyh, @sholderbach, @Tropid, @zim0369

    Source code(tar.gz)
    Source code(zip)
  • v0.4.0(Apr 12, 2022)

    New release for nushell 0.61.0

    This release contains several API breaks:

    • The default constructor Reedline::create() and Reedline.with_history are not fallible anymore
    • Changes to the provided menus to have more flexibility

    Further changes:

    • Per default Hinter and Validator are not added as DefaultHinter or DefaultValidator anymore, you have to explicitly add them via the builder pattern.
    • The definition of the word boundaries was changed to respect non alphanumeric characters better.
    • Keybindings support the removal of existing bindings
    • More colorful default prompt
    Source code(tar.gz)
    Source code(zip)
  • v0.3.0(Mar 16, 2022)

Owner
JT
Current: @nushell. Previously: @rust-lang, PM for TypeScript @microsoft. (they/them)
JT
Readline Implementation in Rust

RustyLine Readline implementation in Rust that is based on Antirez' Linenoise Supported Platforms Unix (tested on FreeBSD, Linux and macOS) Windows cm

Katsu Kawakami 1.1k Dec 29, 2022
A minimal readline with multiline and async support

RustyLine Async A minimal readline with multiline and async support. Inspired by rustyline , async-readline & termion-async-input.

Zyansheep 16 Dec 15, 2022
procs is a replacement for ps written in Rust.

procs is a replacement for ps written in Rust. Documentation quick links Features Platform Installation Usage Configuration Features Output by t

null 3.6k Dec 30, 2022
A drop-in replacement for `dapp` and `seth` in Rust

dapptools.rs Rust port of DappTools dapp example Usage Run Solidity tests Any contract that contains a function starting with test is being tested. Th

Georgios Konstantopoulos 5k Jan 1, 2023
🦀️atos for linux by rust - A partial replacement for Apple's atos tool for converting addresses within a binary file to symbols.

atosl-rs ??️ atos for linux by rust - A partial replacement for Apple's atos tool for converting addresses within a binary file to symbols. tested on

everettjf 60 Dec 29, 2022
exa is a modern replacement for ls.

exa exa is a modern replacement for ls. README Sections: Options — Installation — Development exa is a modern replacement for the venerable file-listi

Benjamin Sago 20.3k Jan 8, 2023
zoxide is a blazing fast replacement for your cd command

zoxide A smarter cd command for your terminal zoxide is a blazing fast replacement for your cd command, inspired by z and z.lua. It keeps track of the

Ajeet D'Souza 8.7k Dec 31, 2022
fastmod is a fast partial replacement for the codemod tool

fastmod is a fast partial replacement for codemod. Like codemod, it is a tool to assist you with large-scale codebase refactors, and it supports most of codemod's options.

Facebook Incubator 1.4k Dec 29, 2022
Fls - Ferris-LS, a very bad LS replacement. Besides that, proves that I suck at clean & good code.

FLS A handy ls remake, purely for learning. Why FLS? There's no reason, at all, don't use it. I just want to learn Rust :D Usage Flags: -i = Use icons

florida 6 Jan 24, 2022
xcp is a (partial) clone of the Unix cp command. It is not intended as a full replacement

xcp is a (partial) clone of the Unix cp command. It is not intended as a full replacement, but as a companion utility with some more user-friendly feedback and some optimisations that make sense under certain tasks (see below).

Steve Smith 310 Jan 5, 2023
drop-in replacement for libfuzzer

Fazi A reimplementation of libfuzzer in Rust with some improvements Supported Features libFuzzer's mutations SanCov feedback Building without a main()

Lander Brandt 56 Nov 2, 2022
Xcode Neovim Replacement-ish.

An XCode replacement-ish development environment that aims to be your reliable XCode alternative to develop exciting new [apple] software products ??

null 272 Dec 30, 2022
A more convenient `#[target_feature]` replacement

A more convenient #[target_feature] replacement To get good performance out of SIMD everything on the SIMD codepath must be inlined. With how SIMD is

Koute 3 Apr 10, 2023
Simpler and more powerful replacement for `find`

FindFile (FF) An simple, ergonomic, and powerful replacement for find. Note: this repo is under active development The syntax is (mostly) figured out,

Sam Westerman 4 Jun 20, 2023
A lightweight, no-fuss, drop-in replacement for Rudderstack

Welcome to Stilgar! Stilgar is a lightweight, no-fuss, drop-in replacement for Rudderstack. Key features: Seamlessly compatible with all Rudderstack c

Withings 4 Jul 21, 2023
A modern, maintained replacement for ls

eza eza is a modern, maintained replacement for ls, built on exa. README Sections: Options — Installation — Development eza is a modern, maintained re

eza 13 Aug 7, 2023
Drop-in replacement for the Actix Web HTTP Logger middleware

actix-contrib-logger Logger middleware for the Actix Web framework. Actually it's a copy & paste from the official Logger middleware (original source

Mariano Ruiz 5 Aug 28, 2023
Patch binary file using IDA signatures and defined replacement bytes in YAML.

fabricbin Patch binary file using IDA signatures and defined replacement bytes in YAML. Install: cargo install --git https://github.com/makindotcc/fab

makin 3 Oct 24, 2023
Rust Imaging Library's Python binding: A performant and high-level image processing library for Python written in Rust

ril-py Rust Imaging Library for Python: Python bindings for ril, a performant and high-level image processing library written in Rust. What's this? Th

Cryptex 13 Dec 6, 2022