save history to file

This commit is contained in:
Raptorox 2025-09-20 20:07:21 +02:00
parent ec1a840bb6
commit d7fc72e65d
No known key found for this signature in database
GPG key ID: 8B3556FC3ED1F6D8
2 changed files with 51 additions and 1 deletions

View file

@ -163,6 +163,10 @@ fn rush_loop(data: &mut Data, orig: libc::termios) -> io::Result<()> {
fn main() {
let mut data = Data::default();
let home = env::home_dir().unwrap();
let home_str = home.into_os_string().into_string().unwrap();
data.set_hist_file(&format!("{}/.rush_history", home_str));
data.load_history();
let orig = enable_raw_mode();