[F] Fix raw mode
This commit is contained in:
@@ -434,8 +434,9 @@ fn run() -> Result<()> {
|
|||||||
|
|
||||||
// Set terminal to raw mode
|
// Set terminal to raw mode
|
||||||
let mut out = std::io::stdout();
|
let mut out = std::io::stdout();
|
||||||
if env::var("TN_TERM_SIZE").is_err() {
|
let raw = std::io::stdout().into_raw_mode();
|
||||||
std::io::stdout().into_raw_mode().unwrap();
|
if raw.is_ok() {
|
||||||
|
print!("Successfully set terminal to raw mode");
|
||||||
}
|
}
|
||||||
|
|
||||||
// Clear the screen
|
// Clear the screen
|
||||||
@@ -443,13 +444,13 @@ fn run() -> Result<()> {
|
|||||||
out.write(HIDE_CURSOR.as_ref())?;
|
out.write(HIDE_CURSOR.as_ref())?;
|
||||||
out.flush()?;
|
out.flush()?;
|
||||||
|
|
||||||
|
|
||||||
// Start update_loop and pull_input concurrently and wait for them to finish
|
// Start update_loop and pull_input concurrently and wait for them to finish
|
||||||
let rt = tokio::runtime::Runtime::new().unwrap();
|
let rt = tokio::runtime::Runtime::new().unwrap();
|
||||||
rt.block_on(async {
|
rt.block_on(async {
|
||||||
let update_loop = start_update_loop( mt.clone(), cn);
|
let update_loop = start_update_loop( mt.clone(), cn);
|
||||||
let pull_input = pull_input(mt.clone(), cn);
|
let pull_input = pull_input(mt.clone(), cn);
|
||||||
tokio::try_join!(update_loop, pull_input)?;
|
tokio::try_join!(update_loop, pull_input)?;
|
||||||
// tokio::try_join!(pull_input)?;
|
|
||||||
Ok::<(), Error>(())
|
Ok::<(), Error>(())
|
||||||
})?;
|
})?;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user