Skip to content

Use a readline implementation for the interactive command loop #623

Description

@redsh4de

What

I propose using a readline-style line editor for the interactive command loop.

This also can bring command history, and if the library supports it - a stable prompt that log output renders above, instead of cutting through what the user types. Opens the door for tab autocomplete and other non-essential UX improvements down the line.

Why

Better UX in interactive terminals. monerod supports GNU Readline for this

Where

cuprated's command listener and stdout logging path.

How

Two capabilities are needed: line editing with history, and a external writer for async output (logs and command results) above the prompt so it isn't corrupted by it.

From the options i looked at, rustyline is a solid choice for this, due to its maturity (since 2015, active maintenance), and minimal new deps, aside from rustyline itself:

Platform Transitive deps added
Unix nix, unicode-width, utf8parse
Windows clipboard-win, error-code, unicode-width

Should probably be feature-flagged the same way Arti currently is

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-proposalCategory: A proposal of some kind, and a request for comments.

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions