remux/src/util.rs

16 lines
328 B
Rust
Raw Normal View History

2023-04-06 13:34:32 -04:00
use tmux_interface::{
Session, Sessions,
variables::session::session::SESSION_ALL
};
pub fn get_sessions() -> Option<Vec<Session>> {
let i_sessions = Sessions::get(SESSION_ALL);
if i_sessions.is_err() { return None; }
let sessions = i_sessions.ok();
if sessions.is_none() { return None; }
Some(sessions.unwrap().0)
}