pub struct Tmux<'a> { /* private fields */ }
Expand description
store all information relevant to a remote Tmux session accessed via SSH
Implementations§
Source§impl<'a> Tmux<'a>
impl<'a> Tmux<'a>
Sourcepub fn new(tmux_socket: TmuxSocket, openssh_session: &'a Session) -> Self
pub fn new(tmux_socket: TmuxSocket, openssh_session: &'a Session) -> Self
create a new Tmux object
Sourcepub async fn list_sessions(&self) -> Result<Vec<TmuxSession>, Error>
pub async fn list_sessions(&self) -> Result<Vec<TmuxSession>, Error>
return all the tmux sessions on the remote tmux server
§Errors
this fails if either something goes wrong on the SSH transport or tmux returns an error exit code
Sourcepub async fn list_windows(
&self,
session: &TmuxSession,
) -> Result<Vec<TmuxWindow>, Error>
pub async fn list_windows( &self, session: &TmuxSession, ) -> Result<Vec<TmuxWindow>, Error>
return all tmux windows in the given session
§Errors
this fails if either something goes wrong on the SSH transport or tmux returns an error exit code
Sourcepub async fn list_panes(
&self,
window: &TmuxWindow,
) -> Result<Vec<TmuxPane>, Error>
pub async fn list_panes( &self, window: &TmuxWindow, ) -> Result<Vec<TmuxPane>, Error>
return all tmux panes in the given window
§Errors
this fails if either something goes wrong on the SSH transport or tmux returns an error exit code
Sourcepub async fn new_session(
&self,
session_name: &TmuxSessionName,
) -> Result<TmuxSession, Error>
pub async fn new_session( &self, session_name: &TmuxSessionName, ) -> Result<TmuxSession, Error>
create a new tmux session in the background
§Errors
this fails if either something goes wrong on the SSH transport or tmux returns an error exit code
Sourcepub async fn new_window(
&self,
session: &TmuxSession,
) -> Result<TmuxWindow, Error>
pub async fn new_window( &self, session: &TmuxSession, ) -> Result<TmuxWindow, Error>
create a new tmux window and return an identifier for it
§Errors
this fails if either something goes wrong on the SSH transport or tmux returns an error exit code
Sourcepub fn option_scope_arguments(option_scope: TmuxOptionScope) -> Vec<String>
pub fn option_scope_arguments(option_scope: TmuxOptionScope) -> Vec<String>
returns the scope arguments needed for set-option to set options in the scope described by the parameter
Sourcepub async fn set_option(
&self,
option_scope: TmuxOptionScope,
option_name: &str,
option_value: &str,
) -> Result<(), Error>
pub async fn set_option( &self, option_scope: TmuxOptionScope, option_name: &str, option_value: &str, ) -> Result<(), Error>
set tmux option
§Errors
this fails if either something goes wrong on the SSH transport or tmux returns an error exit code
Sourcepub async fn set_hook(
&self,
option_scope: TmuxOptionScope,
hook_name: &str,
hook_command: &str,
) -> Result<(), Error>
pub async fn set_hook( &self, option_scope: TmuxOptionScope, hook_name: &str, hook_command: &str, ) -> Result<(), Error>
set tmux hook
§Errors
this fails if either something goes wrong on the SSH transport or tmux returns an error exit code
Sourcepub async fn pipe_pane_output_to(
&self,
pane: &TmuxPane,
pipe_command: &str,
) -> Result<(), Error>
pub async fn pipe_pane_output_to( &self, pane: &TmuxPane, pipe_command: &str, ) -> Result<(), Error>
pipe tmux pane
§Errors
this fails if either something goes wrong on the SSH transport or tmux returns an error exit code