Skip to content
This repository was archived by the owner on Sep 20, 2026. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 0 additions & 10 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion scopeql/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@ indicatif = { version = "0.18.6" }
jiff = { version = "0.2.35", features = ["serde"] }
log = { version = "0.4.33" }
logforth = { version = "0.30.1", features = ["starter-log"] }
mea = { version = "0.6.5" }
memchr = { version = "2.8.3" }
nu-ansi-term = { version = "0.50.3" }
reedline = { version = "0.49.0" }
Expand Down
33 changes: 16 additions & 17 deletions scopeql/src/repl/entrypoint.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ use clap::Parser;
use exn::Result;
use indicatif::ProgressBar;
use indicatif::ProgressStyle;
use mea::latch::Latch;
use nu_ansi_term::Color;
use nu_ansi_term::Style;
use reedline::DefaultHinter;
Expand Down Expand Up @@ -249,9 +248,20 @@ pub fn entrypoint(config: &Config) {
}

loop {
let input = line_editor
.read_line(&repl.prompt)
.expect("failed to read next line");
let input = match line_editor.read_line(&repl.prompt) {
Ok(input) => input,
Err(err) => {
if matches!(err.kind(), std::io::ErrorKind::Other) {
let err = err.to_string();
if err.contains("cursor position could not be read within a normal duration") {
continue;
}
}
eprintln!("error: failed to read input: {err}");
return;
}
};

let input = match input {
Signal::Success(input)
if input == CTRL_C_PROMPT_COMMAND || input == CTRL_D_PROMPT_COMMAND =>
Expand Down Expand Up @@ -388,18 +398,7 @@ pub fn entrypoint(config: &Config) {
let pb_style = "{spinner:.green} [{elapsed_precise}] {msg:.green.bold.bright} [{wide_bar:.cyan/blue}] {bytes}/{total_bytes} ({bytes_per_sec})";
let pb = ProgressBar::no_length()
.with_style(ProgressStyle::with_template(pb_style).unwrap());
let stop_pb = Arc::new(Latch::new(1));

global::rt().spawn({
let pb = pb.clone();
let stop_pb = stop_pb.clone();
async move {
while stop_pb.try_wait().is_err() {
tokio::time::sleep(Duration::from_millis(42)).await;
pb.tick();
}
}
});
pb.enable_steady_tick(Duration::from_millis(42));

let client = &repl.client;
let output_format = repl.output_format;
Expand Down Expand Up @@ -432,7 +431,7 @@ pub fn entrypoint(config: &Config) {
}
});

stop_pb.count_down();
pb.disable_steady_tick();
pb.finish_and_clear();

match output {
Expand Down