diff --git a/Cargo.toml b/Cargo.toml index 6678e6c..05b7d7b 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "remux" -version = "0.3.4" +version = "0.3.5" edition = "2021" authors = [ "Valerie Wolfe " ] description = "A friendly command shortener for tmux" diff --git a/src/command/session.rs b/src/command/session.rs index 86ae726..0ececee 100644 --- a/src/command/session.rs +++ b/src/command/session.rs @@ -8,7 +8,7 @@ use tmux_interface::{ use crate::{ error, state::State, - util + util::{ self, NULL } }; pub fn path(state: &mut State) { @@ -48,7 +48,7 @@ pub fn switch(state: &mut State) { Tmux::new() .add_command(switch) - .output().ok(); + .stderr(NULL).output().ok(); } pub fn title(state: State) { diff --git a/src/command/share.rs b/src/command/share.rs index e7229e7..edae1b3 100644 --- a/src/command/share.rs +++ b/src/command/share.rs @@ -13,7 +13,7 @@ use crate::{ error, flag, state::State, - util + util::{ self, NULL } }; pub fn attach(state: &mut State) { @@ -51,7 +51,7 @@ pub fn attach(state: &mut State) { // build dispatch let mut tmux = Tmux::new().add_command(attach); if let Some(select_window) = select_window { tmux = tmux.add_command(select_window); } - tmux.output().ok(); + tmux.stderr(NULL).output().ok(); state.nest_deinit(); } @@ -188,6 +188,6 @@ pub fn new(state: &mut State) { tmux = tmux.add_command(auto_name); } - tmux.output().ok(); + tmux.stderr(NULL).output().ok(); } diff --git a/src/util.rs b/src/util.rs index c215717..424befa 100644 --- a/src/util.rs +++ b/src/util.rs @@ -4,7 +4,7 @@ use std::{ }; use tmux_interface::{ - Session, Tmux, + Session, StdIO, Tmux, commands, variables::session::SessionsCtl @@ -12,6 +12,8 @@ use tmux_interface::{ use crate::error; +pub const NULL: Option = Some(StdIO::Null); + pub fn session_name() -> Option { let message = commands::DisplayMessage::new().print().message("#{session_name}"); @@ -37,6 +39,7 @@ pub fn session_exists>(target: S) -> bool { let has_session = commands::HasSession::new() .target_session(target.into()); Tmux::new().add_command(has_session) + .stderr(NULL) .status() .unwrap() .success()