-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
refactor(cli): replace promptly with dialoguer #3669
base: main
Are you sure you want to change the base?
refactor(cli): replace promptly with dialoguer #3669
Conversation
Ironically, we previously replaced Did |
Alternatively, since we don't really need anything super fancy, we could just roll our own prompts, couldn't we? |
If it's a just a matter of handling Ctrl-C/SIGINT, we can do that through Tokio, but we'd need to run the |
It still happens.
Disappointing 🙄
I may have a simpler idea but first I have to figure out how to restore the cursor. |
|
931540c
to
8bcfc67
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What I was thinking didn't really work. I've tried this other way but it too had problems 🙄
8bcfc67
to
62112e5
Compare
println!("{e}"); | ||
return false; | ||
async fn ask_to_continue_drop(db_url: String) -> bool { | ||
struct RestoreCursorGuard { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It'd be a good idea to comment on why this is necessary.
|
||
select! { | ||
biased; | ||
_ = ctrlc_fut => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should mention why we need to explicitly handle Ctrl-C.
Turns out #3665 didn't fully fix the build for loongarch64 and s390x because the
promptly
crate depends on an old version ofnix
. While looking more into it I found thatpromptly
is unmaintained and is used very little (judging by the reverse dependencies on crates.io and number of downloads). I've decided to replace it withdialoguer
, maintained byconsole-rs
org from which other crates sqlx-cli is already depending on.This also happens to reduce the number of indirect dependencies, which is nice.