Skip to content

Commit 6ba2b71

Browse files
erikcorryErik Corrysassman
authored
fix: When used with --quiet, don't print a blank line on startup. (#210)
* When used with `--quiet`, don't print a blank line on startup. * Fix empty if. --------- Co-authored-by: Erik Corry <[email protected]> Co-authored-by: Sven Kanoldt <[email protected]>
1 parent 1da917e commit 6ba2b71

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/main.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ use anyhow::{bail, Context};
3333
use clap::ArgMatches;
3434
use image::FlatSamples;
3535
use std::borrow::Borrow;
36+
use std::io::{self, Write};
3637
use std::sync::{mpsc, Arc, Mutex};
3738
use std::time::{Duration, Instant};
3839
use std::{env, thread};
@@ -108,6 +109,7 @@ fn main() -> Result<()> {
108109
let interact = thread::spawn(move || -> Result<()> { sub_shell_thread(&program).map(|_| ()) });
109110

110111
clear_screen();
112+
io::stdout().flush().unwrap();
111113
if args.get_flag("verbose") {
112114
println!(
113115
"Frame cache dir: {:?}",
@@ -119,9 +121,7 @@ fn main() -> Result<()> {
119121
println!("Recording window id: {}", win_id);
120122
}
121123
}
122-
if args.get_flag("quiet") {
123-
println!();
124-
} else {
124+
if !args.get_flag("quiet") {
125125
println!("[t-rec]: Press Ctrl+D to end recording");
126126
}
127127
thread::sleep(Duration::from_millis(1250));

0 commit comments

Comments
 (0)