add ctrl-\ quit support to admin console

Signed-off-by: Jason Volk <jason@zemos.net>
This commit is contained in:
Jason Volk 2024-07-05 01:27:13 +00:00
parent 04e3de08eb
commit 8350aced39
3 changed files with 4 additions and 3 deletions

3
Cargo.lock generated
View file

@ -3274,8 +3274,7 @@ checksum = "955d28af4278de8121b7ebeb796b6a45735dc01436d898801014aced2773a3d6"
[[package]]
name = "rustyline-async"
version = "0.4.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8b6eb06391513b2184f0a5405c11a4a0a5302e8be442f4c5c35267187c2b37d5"
source = "git+https://github.com/girlbossceo/rustyline-async?rev=de26100b0db03e419a3d8e1dd26895d170d1fe50#de26100b0db03e419a3d8e1dd26895d170d1fe50"
dependencies = [
"crossterm",
"futures-channel",

View file

@ -404,7 +404,8 @@ features = [
]
[workspace.dependencies.rustyline-async]
version = "0.4.2"
git = "https://github.com/girlbossceo/rustyline-async"
rev = "de26100b0db03e419a3d8e1dd26895d170d1fe50"
[workspace.dependencies.termimad]
version = "0.29.4"

View file

@ -97,6 +97,7 @@ impl Console {
ReadlineEvent::Line(string) => self.clone().handle(string).await,
ReadlineEvent::Interrupted => continue,
ReadlineEvent::Eof => break,
ReadlineEvent::Quit => services().server.shutdown().unwrap_or_else(error::log),
},
Err(error) => match error {
ReadlineError::Closed => break,