Support notifications via terminal bell (#227)

Co-authored-by: Benjamin Grosse <ste3ls@gmail.com>
This commit is contained in:
Ulyssa 2024-03-24 10:19:34 -07:00 committed by GitHub
parent db9cb92737
commit 99996e275b
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
6 changed files with 78 additions and 27 deletions

View file

@ -19,7 +19,7 @@ use std::collections::VecDeque;
use std::convert::TryFrom;
use std::fmt::Display;
use std::fs::{create_dir_all, File};
use std::io::{stdout, BufWriter, Stdout};
use std::io::{stdout, BufWriter, Stdout, Write};
use std::ops::DerefMut;
use std::process;
use std::sync::atomic::{AtomicUsize, Ordering};
@ -293,6 +293,10 @@ impl Application {
let sstate = &mut self.screen;
let term = &mut self.terminal;
if store.application.ring_bell {
store.application.ring_bell = term.backend_mut().write_all(&[7]).is_err();
}
if full {
term.clear()?;
}