16 lines
328 B
Rust
16 lines
328 B
Rust
|
|
||
|
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)
|
||
|
}
|
||
|
|