tmux_interface/options/server/builder/
set_server_option_tr.rs1use crate::options::*;
2use crate::{SetOptionTr, SetUserOption, TmuxCommand, TmuxCommands};
3use std::borrow::Cow;
4
5pub trait SetServerOptionTr: SetOptionTr + SetUserOption {
6 #[cfg(feature = "tmux_3_1")]
13 fn backspace<'a, S: Into<Cow<'a, str>>>(backspace: Option<S>) -> TmuxCommand<'a> {
14 Self::set(BACKSPACE, backspace)
15 }
16
17 #[cfg(feature = "tmux_1_5")]
24 fn buffer_limit<'a>(buffer_limit: Option<usize>) -> TmuxCommand<'a> {
25 Self::set(BUFFER_LIMIT, buffer_limit.map(|s| s.to_string()))
26 }
27
28 #[cfg(feature = "tmux_2_4")]
35 fn command_alias<'a, I, S>(command_alias: Option<I>) -> TmuxCommands<'a>
36 where
37 I: IntoIterator<Item = S>,
38 S: Into<Cow<'a, str>>,
39 {
40 Self::set_array(COMMAND_ALIAS, command_alias)
41 }
42
43 #[cfg(feature = "tmux_2_4")]
50 fn command_alias_ext<'a, S: Into<Cow<'a, str>>>(
51 i: usize,
52 command_alias: Option<S>,
53 ) -> TmuxCommand<'a> {
54 Self::set(format!("{}[{}]", COMMAND_ALIAS, i), command_alias)
55 }
56
57 #[cfg(feature = "tmux_3_2")]
64 fn copy_command<'a, S: Into<Cow<'a, str>>>(copy_command: Option<S>) -> TmuxCommand<'a> {
65 Self::set(COPY_COMMAND, copy_command)
66 }
67
68 #[cfg(feature = "tmux_2_1")]
75 fn default_terminal<'a, S: Into<Cow<'a, str>>>(default_terminal: Option<S>) -> TmuxCommand<'a> {
76 Self::set(DEFAULT_TERMINAL, default_terminal)
77 }
78
79 #[cfg(feature = "tmux_1_2")]
86 fn escape_time<'a>(escape_time: Option<usize>) -> TmuxCommand<'a> {
87 Self::set(ESCAPE_TIME, escape_time.map(|s| s.to_string()))
88 }
89
90 #[cfg(feature = "tmux_3_2")]
97 fn editor<'a, S: Into<Cow<'a, str>>>(editor: Option<S>) -> TmuxCommand<'a> {
98 Self::set(EDITOR, editor)
99 }
100
101 #[cfg(feature = "tmux_2_7")]
108 fn exit_empty<'a>(exit_empty: Option<Switch>) -> TmuxCommand<'a> {
109 Self::set(EXIT_EMPTY, exit_empty.map(|s| s.to_string()))
110 }
111
112 #[cfg(feature = "tmux_1_4")]
119 fn exit_unattached<'a>(exit_unattached: Option<Switch>) -> TmuxCommand<'a> {
120 Self::set(EXIT_UNATTACHED, exit_unattached.map(|s| s.to_string()))
121 }
122
123 #[cfg(feature = "tmux_3_2")]
130 fn extended_keys<'a>(extended_keys: Option<Switch>) -> TmuxCommand<'a> {
131 Self::set(EXTENDED_KEYS, extended_keys.map(|s| s.to_string()))
132 }
133
134 #[cfg(feature = "tmux_1_9")]
141 fn focus_events<'a>(focus_events: Option<Switch>) -> TmuxCommand<'a> {
142 Self::set(FOCUS_EVENTS, focus_events.map(|s| s.to_string()))
143 }
144
145 #[cfg(feature = "tmux_2_1")]
152 fn history_file<'a, S: Into<Cow<'a, str>>>(history_file: Option<S>) -> TmuxCommand<'a> {
153 Self::set(HISTORY_FILE, history_file)
154 }
155
156 #[cfg(feature = "tmux_2_0")]
163 fn message_limit<'a>(message_limit: Option<usize>) -> TmuxCommand<'a> {
164 Self::set(MESSAGE_LIMIT, message_limit.map(|s| s.to_string()))
165 }
166
167 #[cfg(feature = "tmux_3_3")]
174 fn prompt_history_limit<'a>(prompt_history_limit: Option<usize>) -> TmuxCommand<'a> {
175 Self::set(
176 PROMPT_HISTORY_LIMIT,
177 prompt_history_limit.map(|s| s.to_string()),
178 )
179 }
180
181 #[cfg(feature = "tmux_1_5")]
188 fn set_clipboard<'a>(set_clipboard: Option<SetClipboard>) -> TmuxCommand<'a> {
189 Self::set(SET_CLIPBOARD, set_clipboard.map(|s| s.to_string()))
190 }
191
192 #[cfg(feature = "tmux_3_2")]
199 fn terminal_features<'a, I, S>(terminal_features: Option<I>) -> TmuxCommands<'a>
200 where
201 I: IntoIterator<Item = S>,
202 S: Into<Cow<'a, str>>,
203 {
204 Self::set_array(TERMINAL_FEATURES, terminal_features)
205 }
206
207 #[cfg(feature = "tmux_2_0")]
214 fn terminal_overrides<'a, I, S>(terminal_overrides: Option<I>) -> TmuxCommands<'a>
215 where
216 I: IntoIterator<Item = S>,
217 S: Into<Cow<'a, str>>,
218 {
219 Self::set_array(TERMINAL_OVERRIDES, terminal_overrides)
220 }
221
222 #[cfg(feature = "tmux_3_0")]
229 fn user_keys<'a, I, S>(user_keys: Option<I>) -> TmuxCommands<'a>
230 where
231 I: IntoIterator<Item = S>,
232 S: Into<Cow<'a, str>>,
233 {
234 Self::set_array(USER_KEYS, user_keys)
235 }
236
237 #[cfg(all(feature = "tmux_1_2", not(feature = "tmux_2_0")))]
244 fn quiet<'a>(quiet: Option<Switch>) -> TmuxCommand<'a> {
245 Self::set(QUIET, quiet.map(|s| s.to_string()))
246 }
247
248 #[cfg(all(feature = "tmux_1_3", not(feature = "tmux_1_4")))]
255 fn detach_on_destroy<'a>(detach_on_destroy: Option<Switch>) -> TmuxCommand<'a> {
256 Self::set(DETACH_ON_DESTROY, detach_on_destroy.map(|s| s.to_string()))
257 }
258}