use crate::options::session::common::constants::*;
use crate::options::{SetOptionTr, SetUserOption};
#[cfg(feature = "tmux_3_4")]
use crate::MessageLine;
use crate::{
Action, Activity, DestroyUnattached, DetachOnDestroy, Status, StatusJustify, StatusKeys,
StatusPosition, Switch, TmuxCommand, TmuxCommands,
};
use std::borrow::Cow;
pub trait SetSessionOptionTr: SetOptionTr + SetUserOption {
#[cfg(feature = "tmux_2_6")]
fn activity_action<'a, T: Into<Cow<'a, str>>>(
target: Option<T>,
action: Option<Action>,
) -> TmuxCommand<'a> {
Self::set_ext(target, ACTIVITY_ACTION, action.map(|s| s.to_string()))
}
#[cfg(feature = "tmux_1_8")]
fn assume_paste_time<'a, T: Into<Cow<'a, str>>>(
target: Option<T>,
milliseconds: Option<usize>,
) -> TmuxCommand<'a> {
Self::set_ext(
target,
ASSUME_PASTE_TIME,
milliseconds.map(|s| s.to_string()),
)
}
#[cfg(feature = "tmux_1_0")]
fn base_index<'a, T: Into<Cow<'a, str>>>(
target: Option<T>,
index: Option<usize>,
) -> TmuxCommand<'a> {
Self::set_ext(target, BASE_INDEX, index.map(|s| s.to_string()))
}
#[cfg(feature = "tmux_1_0")]
fn bell_action<'a, T: Into<Cow<'a, str>>>(
target: Option<T>,
action: Option<Action>,
) -> TmuxCommand<'a> {
Self::set_ext(target, BELL_ACTION, action.map(|s| s.to_string()))
}
#[cfg(all(feature = "tmux_1_5", not(feature = "tmux_2_6")))]
fn bell_on_alert<'a, T: Into<Cow<'a, str>>>(
target: Option<T>,
switch: Option<Switch>,
) -> TmuxCommand<'a> {
Self::set_ext(target, BELL_ON_ALERT, switch.map(|s| s.to_string()))
}
#[cfg(all(feature = "tmux_1_0", not(feature = "tmux_1_4")))]
fn buffer_limit<'a, T: Into<Cow<'a, str>>>(
target: Option<T>,
limit: Option<usize>,
) -> TmuxCommand<'a> {
Self::set_ext(target, BUFFER_LIMIT, limit.map(|s| s.to_string()))
}
#[cfg(feature = "tmux_1_0")]
fn default_command<'a, T: Into<Cow<'a, str>>, S: Into<Cow<'a, str>>>(
target: Option<T>,
shell_command: Option<S>,
) -> TmuxCommand<'a> {
Self::set_ext(target, DEFAULT_COMMAND, shell_command)
}
#[cfg(feature = "tmux_1_0")]
fn default_shell<'a, T: Into<Cow<'a, str>>, S: Into<Cow<'a, str>>>(
target: Option<T>,
path: Option<S>,
) -> TmuxCommand<'a> {
Self::set_ext(target, DEFAULT_SHELL, path)
}
#[cfg(all(feature = "tmux_1_0", not(feature = "tmux_1_9")))]
fn default_path<'a, T: Into<Cow<'a, str>>, S: Into<Cow<'a, str>>>(
target: Option<T>,
path: Option<S>,
) -> TmuxCommand<'a> {
Self::set_ext(target, DEFAULT_PATH, path)
}
#[cfg(all(feature = "tmux_1_0", not(feature = "tmux_2_1")))]
fn default_terminal<'a, T: Into<Cow<'a, str>>, S: Into<Cow<'a, str>>>(
target: Option<T>,
terminal: Option<S>,
) -> TmuxCommand<'a> {
Self::set_ext(target, DEFAULT_TERMINAL, terminal)
}
#[cfg(feature = "tmux_2_9")]
fn default_size<'a, T: Into<Cow<'a, str>>>(
target: Option<T>,
size: Option<(usize, usize)>,
) -> TmuxCommand<'a> {
Self::set_ext(
target,
DEFAULT_SIZE,
size.map(|s| format!("{}x{}", s.0, s.1)),
)
}
#[cfg(feature = "tmux_1_5")]
fn destroy_unattached<'a, T: Into<Cow<'a, str>>>(
target: Option<T>,
destroy_unattached: Option<DestroyUnattached>,
) -> TmuxCommand<'a> {
Self::set_ext(
target,
DESTROY_UNATTACHED,
destroy_unattached.map(|s| s.to_string()),
)
}
#[cfg(feature = "tmux_1_4")]
fn detach_on_destroy<'a, T: Into<Cow<'a, str>>>(
target: Option<T>,
detach_on_destroy: Option<DetachOnDestroy>,
) -> TmuxCommand<'a> {
Self::set_ext(
target,
DETACH_ON_DESTROY,
detach_on_destroy.map(|s| s.to_string()),
)
}
#[cfg(feature = "tmux_1_2")]
fn display_panes_active_colour<'a, T: Into<Cow<'a, str>>, S: Into<Cow<'a, str>>>(
target: Option<T>,
colour: Option<S>,
) -> TmuxCommand<'a> {
Self::set_ext(target, DISPLAY_PANES_ACTIVE_COLOUR, colour)
}
#[cfg(feature = "tmux_1_0")]
fn display_panes_colour<'a, T: Into<Cow<'a, str>>, S: Into<Cow<'a, str>>>(
target: Option<T>,
colour: Option<S>,
) -> TmuxCommand<'a> {
Self::set_ext(target, DISPLAY_PANES_COLOUR, colour)
}
#[cfg(feature = "tmux_1_0")]
fn display_panes_time<'a, T: Into<Cow<'a, str>>>(
target: Option<T>,
time: Option<usize>,
) -> TmuxCommand<'a> {
Self::set_ext(target, DISPLAY_PANES_TIME, time.map(|s| s.to_string()))
}
#[cfg(feature = "tmux_1_0")]
fn display_time<'a, T: Into<Cow<'a, str>>>(
target: Option<T>,
time: Option<usize>,
) -> TmuxCommand<'a> {
Self::set_ext(target, DISPLAY_TIME, time.map(|s| s.to_string()))
}
#[cfg(feature = "tmux_1_0")]
fn history_limit<'a, T: Into<Cow<'a, str>>>(
target: Option<T>,
lines: Option<usize>,
) -> TmuxCommand<'a> {
Self::set_ext(target, HISTORY_LIMIT, lines.map(|s| s.to_string()))
}
#[cfg(feature = "tmux_2_2")]
fn key_table<'a, T: Into<Cow<'a, str>>, S: Into<Cow<'a, str>>>(
target: Option<T>,
key_table: Option<S>,
) -> TmuxCommand<'a> {
Self::set_ext(target, KEY_TABLE, key_table)
}
#[cfg(feature = "tmux_1_0")]
fn lock_after_time<'a, T: Into<Cow<'a, str>>>(
target: Option<T>,
number: Option<usize>,
) -> TmuxCommand<'a> {
Self::set_ext(target, LOCK_AFTER_TIME, number.map(|s| s.to_string()))
}
#[cfg(feature = "tmux_1_0")]
fn lock_command<'a, T: Into<Cow<'a, str>>, S: Into<Cow<'a, str>>>(
target: Option<T>,
shell_command: Option<S>,
) -> TmuxCommand<'a> {
Self::set_ext(target, LOCK_COMMAND, shell_command)
}
#[cfg(all(feature = "tmux_1_1", not(feature = "tmux_2_1")))]
fn lock_server<'a, T: Into<Cow<'a, str>>>(
target: Option<T>,
switch: Option<Switch>,
) -> TmuxCommand<'a> {
Self::set_ext(target, LOCK_SERVER, switch.map(|s| s.to_string()))
}
#[cfg(all(feature = "tmux_1_0", not(feature = "tmux_1_9")))]
fn message_attr<'a, T: Into<Cow<'a, str>>, S: Into<Cow<'a, str>>>(
target: Option<T>,
attributes: Option<S>,
) -> TmuxCommand<'a> {
Self::set_ext(target, MESSAGE_ATTR, attributes)
}
#[cfg(all(feature = "tmux_1_0", not(feature = "tmux_1_9")))]
fn message_bg<'a, T: Into<Cow<'a, str>>, S: Into<Cow<'a, str>>>(
target: Option<T>,
colour: Option<S>,
) -> TmuxCommand<'a> {
Self::set_ext(target, MESSAGE_BG, colour)
}
#[cfg(all(feature = "tmux_1_6", not(feature = "tmux_1_9")))]
fn message_command_attr<'a, T: Into<Cow<'a, str>>, S: Into<Cow<'a, str>>>(
target: Option<T>,
attributes: Option<S>,
) -> TmuxCommand<'a> {
Self::set_ext(target, MESSAGE_COMMAND_ATTR, attributes)
}
#[cfg(all(feature = "tmux_1_6", not(feature = "tmux_1_9")))]
fn message_command_bg<'a, T: Into<Cow<'a, str>>, S: Into<Cow<'a, str>>>(
target: Option<T>,
colour: Option<S>,
) -> TmuxCommand<'a> {
Self::set_ext(target, MESSAGE_COMMAND_BG, colour)
}
#[cfg(all(feature = "tmux_1_6", not(feature = "tmux_1_9")))]
fn message_command_fg<'a, T: Into<Cow<'a, str>>, S: Into<Cow<'a, str>>>(
target: Option<T>,
colour: Option<S>,
) -> TmuxCommand<'a> {
Self::set_ext(target, MESSAGE_COMMAND_FG, colour)
}
#[cfg(all(feature = "tmux_1_0", not(feature = "tmux_1_9")))]
fn message_fg<'a, T: Into<Cow<'a, str>>, S: Into<Cow<'a, str>>>(
target: Option<T>,
colour: Option<S>,
) -> TmuxCommand<'a> {
Self::set_ext(target, MESSAGE_FG, colour)
}
#[cfg(feature = "tmux_1_9")]
fn message_command_style<'a, T: Into<Cow<'a, str>>, S: Into<Cow<'a, str>>>(
target: Option<T>,
style: Option<S>,
) -> TmuxCommand<'a> {
Self::set_ext(target, MESSAGE_COMMAND_STYLE, style)
}
#[cfg(feature = "tmux_3_4")]
fn message_line<'a, T: Into<Cow<'a, str>>>(
target: Option<T>,
message_line: Option<MessageLine>,
) -> TmuxCommand<'a> {
Self::set_ext(target, MESSAGE_LINE, message_line.map(|s| s.to_string()))
}
#[cfg(all(feature = "tmux_1_2", not(feature = "tmux_2_0")))]
fn message_limit<'a, T: Into<Cow<'a, str>>>(
target: Option<T>,
number: Option<usize>,
) -> TmuxCommand<'a> {
Self::set_ext(target, MESSAGE_LIMIT, number.map(|s| s.to_string()))
}
#[cfg(feature = "tmux_1_9")]
fn message_style<'a, T: Into<Cow<'a, str>>, S: Into<Cow<'a, str>>>(
target: Option<T>,
style: Option<S>,
) -> TmuxCommand<'a> {
Self::set_ext(target, MESSAGE_STYLE, style)
}
#[cfg(all(feature = "tmux_1_5", not(feature = "tmux_2_1")))]
fn mouse_resize_pane<'a, T: Into<Cow<'a, str>>>(
target: Option<T>,
switch: Option<Switch>,
) -> TmuxCommand<'a> {
Self::set_ext(target, MOUSE_RESIZE_PANE, switch.map(|s| s.to_string()))
}
#[cfg(all(feature = "tmux_1_5", not(feature = "tmux_2_1")))]
fn mouse_select_pane<'a, T: Into<Cow<'a, str>>>(
target: Option<T>,
switch: Option<Switch>,
) -> TmuxCommand<'a> {
Self::set_ext(target, MOUSE_SELECT_PANE, switch.map(|s| s.to_string()))
}
#[cfg(all(feature = "tmux_1_5", not(feature = "tmux_2_1")))]
fn mouse_select_window<'a, T: Into<Cow<'a, str>>>(
target: Option<T>,
switch: Option<Switch>,
) -> TmuxCommand<'a> {
Self::set_ext(target, MOUSE_SELECT_WINDOW, switch.map(|s| s.to_string()))
}
#[cfg(feature = "tmux_2_1")]
fn mouse<'a, T: Into<Cow<'a, str>>>(
target: Option<T>,
switch: Option<Switch>,
) -> TmuxCommand<'a> {
Self::set_ext(target, MOUSE, switch.map(|s| s.to_string()))
}
#[cfg(all(feature = "tmux_1_5", not(feature = "tmux_2_2")))]
fn mouse_utf8<'a, T: Into<Cow<'a, str>>>(
target: Option<T>,
switch: Option<Switch>,
) -> TmuxCommand<'a> {
Self::set_ext(target, MOUSE_UTF8, switch.map(|s| s.to_string()))
}
#[cfg(all(feature = "tmux_1_2", not(feature = "tmux_1_9")))]
fn pane_active_border_bg<'a, T: Into<Cow<'a, str>>, S: Into<Cow<'a, str>>>(
target: Option<T>,
colour: Option<S>,
) -> TmuxCommand<'a> {
Self::set_ext(target, PANE_ACTIVE_BORDER_BG, colour)
}
#[cfg(all(feature = "tmux_1_2", not(feature = "tmux_1_9")))]
fn pane_active_border_fg<'a, T: Into<Cow<'a, str>>, S: Into<Cow<'a, str>>>(
target: Option<T>,
colour: Option<S>,
) -> TmuxCommand<'a> {
Self::set_ext(target, PANE_ACTIVE_BORDER_FG, colour)
}
#[cfg(all(feature = "tmux_1_2", not(feature = "tmux_1_9")))]
fn pane_border_bg<'a, T: Into<Cow<'a, str>>, S: Into<Cow<'a, str>>>(
target: Option<T>,
colour: Option<S>,
) -> TmuxCommand<'a> {
Self::set_ext(target, PANE_BORDER_BG, colour)
}
#[cfg(all(feature = "tmux_1_2", not(feature = "tmux_1_9")))]
fn pane_border_fg<'a, T: Into<Cow<'a, str>>, S: Into<Cow<'a, str>>>(
target: Option<T>,
colour: Option<S>,
) -> TmuxCommand<'a> {
Self::set_ext(target, PANE_BORDER_FG, colour)
}
#[cfg(all(feature = "tmux_1_9", not(feature = "tmux_2_0")))]
fn pane_active_border_style<'a, T: Into<Cow<'a, str>>, S: Into<Cow<'a, str>>>(
target: Option<T>,
style: Option<S>,
) -> TmuxCommand<'a> {
Self::set_ext(target, PANE_ACTIVE_BORDER_STYLE, style)
}
#[cfg(all(feature = "tmux_1_9", not(feature = "tmux_2_0")))]
fn pane_border_style<'a, T: Into<Cow<'a, str>>, S: Into<Cow<'a, str>>>(
target: Option<T>,
style: Option<S>,
) -> TmuxCommand<'a> {
Self::set_ext(target, PANE_BORDER_STYLE, style)
}
#[cfg(feature = "tmux_1_0")]
fn prefix<'a, T: Into<Cow<'a, str>>, S: Into<Cow<'a, str>>>(
target: Option<T>,
key: Option<S>,
) -> TmuxCommand<'a> {
Self::set_ext(target, PREFIX, key)
}
#[cfg(feature = "tmux_1_6")]
fn prefix2<'a, T: Into<Cow<'a, str>>, S: Into<Cow<'a, str>>>(
target: Option<T>,
key: Option<S>,
) -> TmuxCommand<'a> {
Self::set_ext(target, PREFIX2, key)
}
#[cfg(feature = "tmux_1_7")]
fn renumber_windows<'a, T: Into<Cow<'a, str>>>(
target: Option<T>,
switch: Option<Switch>,
) -> TmuxCommand<'a> {
Self::set_ext(target, RENUMBER_WINDOWS, switch.map(|s| s.to_string()))
}
#[cfg(feature = "tmux_1_0")]
fn repeat_time<'a, T: Into<Cow<'a, str>>>(
target: Option<T>,
time: Option<usize>,
) -> TmuxCommand<'a> {
Self::set_ext(target, REPEAT_TIME, time.map(|s| s.to_string()))
}
#[cfg(all(feature = "tmux_1_0", not(feature = "tmux_2_4")))]
fn set_remain_on_exit<'a, T: Into<Cow<'a, str>>>(
target: Option<T>,
switch: Option<Switch>,
) -> TmuxCommand<'a> {
Self::set_ext(target, SET_REMAIN_ON_EXIT, switch.map(|s| s.to_string()))
}
#[cfg(feature = "tmux_1_0")]
fn set_titles<'a, T: Into<Cow<'a, str>>>(
target: Option<T>,
switch: Option<Switch>,
) -> TmuxCommand<'a> {
Self::set_ext(target, SET_TITLES, switch.map(|s| s.to_string()))
}
#[cfg(feature = "tmux_1_0")]
fn set_titles_string<'a, T: Into<Cow<'a, str>>, S: Into<Cow<'a, str>>>(
target: Option<T>,
string: Option<S>,
) -> TmuxCommand<'a> {
Self::set_ext(target, SET_TITLES_STRING, string)
}
#[cfg(feature = "tmux_2_6")]
fn silence_action<'a, T: Into<Cow<'a, str>>>(
target: Option<T>,
action: Option<Action>,
) -> TmuxCommand<'a> {
Self::set_ext(target, SILENCE_ACTION, action.map(|s| s.to_string()))
}
#[cfg(feature = "tmux_1_0")]
fn status<'a, T: Into<Cow<'a, str>>>(
target: Option<T>,
status: Option<Status>,
) -> TmuxCommand<'a> {
Self::set_ext(target, STATUS, status.map(|s| s.to_string()))
}
#[cfg(all(feature = "tmux_1_0", not(feature = "tmux_1_9")))]
fn status_attr<'a, T: Into<Cow<'a, str>>, S: Into<Cow<'a, str>>>(
target: Option<T>,
attributes: Option<S>,
) -> TmuxCommand<'a> {
Self::set_ext(target, STATUS_ATTR, attributes)
}
#[cfg(all(feature = "tmux_1_0", not(feature = "tmux_1_9")))]
fn status_bg<'a, T: Into<Cow<'a, str>>, S: Into<Cow<'a, str>>>(
target: Option<T>,
colour: Option<S>,
) -> TmuxCommand<'a> {
Self::set_ext(target, STATUS_BG, colour)
}
#[cfg(all(feature = "tmux_1_0", not(feature = "tmux_1_9")))]
fn status_fg<'a, T: Into<Cow<'a, str>>, S: Into<Cow<'a, str>>>(
target: Option<T>,
colour: Option<S>,
) -> TmuxCommand<'a> {
Self::set_ext(target, STATUS_FG, colour)
}
#[cfg(feature = "tmux_2_9")]
fn status_format<'a, T, I, S>(target: Option<T>, format: Option<I>) -> TmuxCommands<'a>
where
T: Into<Cow<'a, str>> + Clone,
I: IntoIterator<Item = S>,
S: Into<Cow<'a, str>>,
{
Self::set_array_ext(target, STATUS_FORMAT, format)
}
#[cfg(feature = "tmux_1_0")]
fn status_interval<'a, T: Into<Cow<'a, str>>>(
target: Option<T>,
interval: Option<usize>,
) -> TmuxCommand<'a> {
Self::set_ext(target, STATUS_INTERVAL, interval.map(|s| s.to_string()))
}
#[cfg(feature = "tmux_1_0")]
fn status_justify<'a, T: Into<Cow<'a, str>>>(
target: Option<T>,
status_justify: Option<StatusJustify>,
) -> TmuxCommand<'a> {
Self::set_ext(
target,
STATUS_JUSTIFY,
status_justify.map(|s| s.to_string()),
)
}
#[cfg(feature = "tmux_1_0")]
fn status_keys<'a, T: Into<Cow<'a, str>>>(
target: Option<T>,
status_keys: Option<StatusKeys>,
) -> TmuxCommand<'a> {
Self::set_ext(target, STATUS_KEYS, status_keys.map(|s| s.to_string()))
}
#[cfg(feature = "tmux_1_0")]
fn status_left<'a, T: Into<Cow<'a, str>>, S: Into<Cow<'a, str>>>(
target: Option<T>,
string: Option<S>,
) -> TmuxCommand<'a> {
Self::set_ext(target, STATUS_LEFT, string)
}
#[cfg(all(feature = "tmux_1_0", not(feature = "tmux_1_9")))]
fn status_left_attr<'a, T: Into<Cow<'a, str>>, S: Into<Cow<'a, str>>>(
target: Option<T>,
attributes: Option<S>,
) -> TmuxCommand<'a> {
Self::set_ext(target, STATUS_LEFT_ATTR, attributes)
}
#[cfg(all(feature = "tmux_1_0", not(feature = "tmux_1_9")))]
fn status_left_bg<'a, T: Into<Cow<'a, str>>, S: Into<Cow<'a, str>>>(
target: Option<T>,
colour: Option<S>,
) -> TmuxCommand<'a> {
Self::set_ext(target, STATUS_LEFT_BG, colour)
}
#[cfg(all(feature = "tmux_1_0", not(feature = "tmux_1_9")))]
fn status_left_fg<'a, T: Into<Cow<'a, str>>, S: Into<Cow<'a, str>>>(
target: Option<T>,
colour: Option<S>,
) -> TmuxCommand<'a> {
Self::set_ext(target, STATUS_LEFT_FG, colour)
}
#[cfg(feature = "tmux_1_0")]
fn status_left_length<'a, T: Into<Cow<'a, str>>>(
target: Option<T>,
length: Option<usize>,
) -> TmuxCommand<'a> {
Self::set_ext(target, STATUS_LEFT_LENGTH, length.map(|s| s.to_string()))
}
#[cfg(feature = "tmux_1_9")]
fn status_left_style<'a, T: Into<Cow<'a, str>>, S: Into<Cow<'a, str>>>(
target: Option<T>,
style: Option<S>,
) -> TmuxCommand<'a> {
Self::set_ext(target, STATUS_LEFT_STYLE, style)
}
#[cfg(feature = "tmux_1_7")]
fn status_position<'a, T: Into<Cow<'a, str>>>(
target: Option<T>,
status_position: Option<StatusPosition>,
) -> TmuxCommand<'a> {
Self::set_ext(
target,
STATUS_POSITION,
status_position.map(|s| s.to_string()),
)
}
#[cfg(feature = "tmux_1_0")]
fn status_right<'a, T: Into<Cow<'a, str>>, S: Into<Cow<'a, str>>>(
target: Option<T>,
string: Option<S>,
) -> TmuxCommand<'a> {
Self::set_ext(target, STATUS_RIGHT, string)
}
#[cfg(all(feature = "tmux_1_0", not(feature = "tmux_1_9")))]
fn status_right_attr<'a, T: Into<Cow<'a, str>>, S: Into<Cow<'a, str>>>(
target: Option<T>,
attributes: Option<S>,
) -> TmuxCommand<'a> {
Self::set_ext(target, STATUS_RIGHT_ATTR, attributes)
}
#[cfg(all(feature = "tmux_1_0", not(feature = "tmux_1_9")))]
fn status_right_bg<'a, T: Into<Cow<'a, str>>, S: Into<Cow<'a, str>>>(
target: Option<T>,
colour: Option<S>,
) -> TmuxCommand<'a> {
Self::set_ext(target, STATUS_RIGHT_BG, colour)
}
#[cfg(all(feature = "tmux_1_0", not(feature = "tmux_1_9")))]
fn status_right_fg<'a, T: Into<Cow<'a, str>>, S: Into<Cow<'a, str>>>(
target: Option<T>,
colour: Option<S>,
) -> TmuxCommand<'a> {
Self::set_ext(target, STATUS_RIGHT_FG, colour)
}
#[cfg(feature = "tmux_1_0")]
fn status_right_length<'a, T: Into<Cow<'a, str>>>(
target: Option<T>,
length: Option<usize>,
) -> TmuxCommand<'a> {
Self::set_ext(target, STATUS_RIGHT_LENGTH, length.map(|s| s.to_string()))
}
#[cfg(feature = "tmux_1_9")]
fn status_right_style<'a, T: Into<Cow<'a, str>>, S: Into<Cow<'a, str>>>(
target: Option<T>,
style: Option<S>,
) -> TmuxCommand<'a> {
Self::set_ext(target, STATUS_RIGHT_STYLE, style)
}
#[cfg(feature = "tmux_1_9")]
fn status_style<'a, T: Into<Cow<'a, str>>, S: Into<Cow<'a, str>>>(
target: Option<T>,
style: Option<S>,
) -> TmuxCommand<'a> {
Self::set_ext(target, STATUS_STYLE, style)
}
#[cfg(all(feature = "tmux_1_0", not(feature = "tmux_2_2")))]
fn status_utf8<'a, T: Into<Cow<'a, str>>>(
target: Option<T>,
switch: Option<Switch>,
) -> TmuxCommand<'a> {
Self::set_ext(target, STATUS_UTF8, switch.map(|s| s.to_string()))
}
#[cfg(all(feature = "tmux_1_0", not(feature = "tmux_2_0")))]
fn terminal_overrides<'a, T: Into<Cow<'a, str>>, S: Into<Cow<'a, str>>>(
target: Option<T>,
string: Option<S>,
) -> TmuxCommand<'a> {
Self::set_ext(target, TERMINAL_OVERRIDES, string)
}
#[cfg(feature = "tmux_1_0")]
fn update_environment<'a, T, I, S>(target: Option<T>, variable: Option<I>) -> TmuxCommands<'a>
where
T: Into<Cow<'a, str>> + Clone,
I: IntoIterator<Item = S>,
S: Into<Cow<'a, str>>,
{
Self::set_array_ext(target, UPDATE_ENVIRONMENT, variable)
}
#[cfg(all(feature = "tmux_2_6", not(feature = "tmux_3_0")))]
fn user_keys<'a, T, I, S>(target: Option<T>, key: Option<I>) -> TmuxCommands<'a>
where
T: Into<Cow<'a, str>> + Clone,
I: IntoIterator<Item = S>,
S: Into<Cow<'a, str>>,
{
Self::set_array_ext(target, USER_KEYS, key)
}
#[cfg(feature = "tmux_1_0")]
fn visual_activity<'a, T: Into<Cow<'a, str>>>(
target: Option<T>,
activity: Option<Activity>,
) -> TmuxCommand<'a> {
Self::set_ext(target, VISUAL_ACTIVITY, activity.map(|s| s.to_string()))
}
#[cfg(feature = "tmux_1_0")]
fn visual_bell<'a, T: Into<Cow<'a, str>>>(
target: Option<T>,
activity: Option<Activity>,
) -> TmuxCommand<'a> {
Self::set_ext(target, VISUAL_BELL, activity.map(|s| s.to_string()))
}
#[cfg(all(feature = "tmux_1_0", not(feature = "tmux_2_0")))]
fn visual_content<'a, T: Into<Cow<'a, str>>>(
target: Option<T>,
switch: Option<Switch>,
) -> TmuxCommand<'a> {
Self::set_ext(target, VISUAL_CONTENT, switch.map(|s| s.to_string()))
}
#[cfg(feature = "tmux_1_4")]
fn visual_silence<'a, T: Into<Cow<'a, str>>>(
target: Option<T>,
activity: Option<Activity>,
) -> TmuxCommand<'a> {
Self::set_ext(target, VISUAL_SILENCE, activity.map(|s| s.to_string()))
}
#[cfg(feature = "tmux_1_6")]
fn word_separators<'a, T: Into<Cow<'a, str>>, S: Into<Cow<'a, str>>>(
target: Option<T>,
string: Option<S>,
) -> TmuxCommand<'a> {
Self::set_ext(target, WORD_SEPARATORS, string)
}
}