Rolls back changes to the open terminal file

pull/704/head
Ahmed ElSamhaa 2 months ago
parent a6fb695ff9
commit 5240b3904b

@ -1,5 +1,3 @@
use std::thread::current;
use crate::node::Node;
use serde::{Deserialize, Serialize};
use time::OffsetDateTime;
@ -52,7 +50,7 @@ impl ScrollState {
// When focus goes to last node
total.saturating_sub(height)
} else if (start_cushion_row..=end_cushion_row).contains(&current_focus) {
// IF within cushioned area; do nothing
// If within cushioned area; do nothing
first_visible_row
} else if current_focus > last_focus.unwrap() {
// When scrolling down outside the view port

@ -27,8 +27,8 @@ use tui::Terminal;
use tui_input::Input;
pub fn get_tty() -> Result<fs::File> {
let tty = "/dev/stdout";
match fs::File::create(tty) {
let tty = "/dev/tty";
match fs::OpenOptions::new().read(true).write(true).open(tty) {
Ok(f) => Ok(f),
Err(e) => {
bail!(format!("could not open {tty}. {e}"))

Loading…
Cancel
Save