inner tmux errors are now hidden

This commit is contained in:
Valerie Wolfe 2024-07-06 21:10:39 -04:00
parent 1acc7aeb7b
commit cdc68986fa
4 changed files with 10 additions and 7 deletions

View file

@ -1,6 +1,6 @@
[package]
name = "remux"
version = "0.3.4"
version = "0.3.5"
edition = "2021"
authors = [ "Valerie Wolfe <sleeplessval@gmail.com>" ]
description = "A friendly command shortener for tmux"

View file

@ -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) {

View file

@ -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();
}

View file

@ -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<StdIO> = Some(StdIO::Null);
pub fn session_name() -> Option<String> {
let message = commands::DisplayMessage::new().print().message("#{session_name}");
@ -37,6 +39,7 @@ pub fn session_exists<S: Into<String>>(target: S) -> bool {
let has_session = commands::HasSession::new()
.target_session(target.into());
Tmux::new().add_command(has_session)
.stderr(NULL)
.status()
.unwrap()
.success()