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
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:
nix,unicode-width,utf8parseclipboard-win,error-code,unicode-widthShould probably be feature-flagged the same way Arti currently is