1
0
Fork 0
mirror of https://forgejo.ellis.link/continuwuation/continuwuity.git synced 2025-07-29 19:28:31 +00:00

add basic tab completion to console

Signed-off-by: Jason Volk <jason@zemos.net>
This commit is contained in:
Jason Volk 2024-07-05 07:52:05 +00:00
parent b31e81a469
commit 5254eb4f72
4 changed files with 134 additions and 52 deletions

View file

@ -118,6 +118,7 @@ impl Console {
let _suppression = log::Suppress::new(&services().server);
let (mut readline, _writer) = Readline::new(PROMPT.to_owned())?;
readline.set_tab_completer(Self::tab_complete);
self.set_history(&mut readline);
let future = readline.readline();
@ -185,6 +186,13 @@ impl Console {
history.push_front(line);
history.truncate(HISTORY_LIMIT);
}
fn tab_complete(line: &str) -> String {
services()
.admin
.complete_command(line)
.unwrap_or_else(|| line.to_owned())
}
}
fn configure_output(mut output: MadSkin) -> MadSkin {