Skip to content

Commit

Permalink
Replace atty with std is_terminal
Browse files Browse the repository at this point in the history
  • Loading branch information
AmrDeveloper committed Nov 3, 2024
1 parent 46f4404 commit 151a2ff
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 25 deletions.
23 changes: 1 addition & 22 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 Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,3 @@ gitql-cli = "0.29.0"
inkwell = { version = "0.5.0", features = ["llvm16-0"] }
lineeditor = "0.4.1"
dyn-clone = "1.0.17"
atty = "0.2.14"
7 changes: 5 additions & 2 deletions src/main.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
use std::io;
use std::io::IsTerminal;
use std::path::Path;

use arguments::Arguments;
use arguments::Command;
use atty::Stream;
use functions::llvm_ir_function_signatures;
use functions::llvm_ir_functions;
use gitql_cli::arguments::OutputFormat;
Expand Down Expand Up @@ -146,8 +147,10 @@ fn launch_llql_repl(arguments: Arguments) {

let mut input = String::new();
loop {
let stdin = io::stdin();

// Render Prompt only if input is received from terminal
if atty::is(Stream::Stdin) {
if stdin.is_terminal() {
print!("llql > ");
}

Expand Down

0 comments on commit 151a2ff

Please sign in to comment.