diff options
| author | Jonas Maier <> | 2026-03-07 09:53:18 +0100 |
|---|---|---|
| committer | Jonas Maier <> | 2026-03-07 09:53:18 +0100 |
| commit | 424a1f5e4039e40dd714f8172f0b34d0f25782ec (patch) | |
| tree | 4da1e74921f5886d562a51869e0e95f8a973441b /src/main.rs | |
| parent | 7bd6e6253268ec626a7191344ce9ff77358f94db (diff) | |
| download | pish-424a1f5e4039e40dd714f8172f0b34d0f25782ec.tar.gz | |
compiles again
Diffstat (limited to 'src/main.rs')
| -rw-r--r-- | src/main.rs | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/src/main.rs b/src/main.rs index 36868ca..33193f2 100644 --- a/src/main.rs +++ b/src/main.rs @@ -5,6 +5,7 @@ use std::os::unix::ffi::OsStrExt; use std::os::unix::io::AsRawFd; use std::path::Path; use std::process::{Command, Stdio}; +use std::sync::{Arc, Mutex}; use std::thread::sleep; use std::time::Duration; @@ -205,6 +206,8 @@ fn event_loop() { print!("{}", se.prompt()); + let session = Arc::new(Mutex::new(se)); + loop { let mut buf = [0u8; 1]; @@ -212,6 +215,8 @@ fn event_loop() { break; }; + let mut se = session.lock().unwrap(); + match buf[0] { // Ctrl+A 1 => { @@ -253,7 +258,8 @@ fn event_loop() { print!("\r\n"); se.history.push(line.clone()); se.history_visit = 0; - run::run(&mut se, line); + drop(se); + run::run(session.clone(), line); } } @@ -367,7 +373,7 @@ fn event_loop() { } } - se.raw.disable(); + session.lock().unwrap().raw.disable(); } fn main() { |
