tmux_interface/options/server/builder/
set_server_option_tr.rs

1use crate::options::*;
2use crate::{SetOptionTr, SetUserOption, TmuxCommand, TmuxCommands};
3use std::borrow::Cow;
4
5pub trait SetServerOptionTr: SetOptionTr + SetUserOption {
6    /// ### Manual
7    ///
8    /// tmux ^3.1:
9    /// ```text
10    /// backspace key
11    /// ```
12    #[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    /// ### Manual
18    ///
19    /// tmux ^1.5:
20    /// ```text
21    /// buffer-limit number
22    /// ```
23    #[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    /// ### Manual
29    ///
30    /// tmux ^2.4:
31    /// ```text
32    /// command-alias[] name=value
33    /// ```
34    #[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    /// ### Manual
44    ///
45    /// tmux ^2.4:
46    /// ```text
47    /// command-alias[] name=value
48    /// ```
49    #[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    /// ### Manual
58    ///
59    /// tmux ^2.1:
60    /// ```text
61    /// copy-command shell-command
62    /// ```
63    #[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    /// ### Manual
69    ///
70    /// tmux ^3.2:
71    /// ```text
72    /// default-terminal terminal
73    /// ```
74    #[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    /// ### Manual
80    ///
81    /// tmux ^1.2:
82    /// ```text
83    /// escape-time time
84    /// ```
85    #[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    /// ### Manual
91    ///
92    /// tmux ^3.2:
93    /// ```text
94    /// editor shell-command
95    /// ```
96    #[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    /// ### Manual
102    ///
103    /// tmux ^2.7:
104    /// ```text
105    /// exit-empty [on | off]
106    /// ```
107    #[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    /// ### Manual
113    ///
114    /// tmux ^1.4:
115    /// ```text
116    /// exit-unattached [on | off]
117    /// ```
118    #[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    /// ### Manual
124    ///
125    /// tmux ^3.2:
126    /// ```text
127    /// extended-keys [on | off]
128    /// ```
129    #[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    /// ### Manual
135    ///
136    /// tmux ^1.9:
137    /// ```text
138    /// focus-events [on | off]
139    /// ```
140    #[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    /// ### Manual
146    ///
147    /// tmux ^2.1:
148    /// ```text
149    /// history-file path
150    /// ```
151    #[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    /// ### Manual
157    ///
158    /// tmux ^2.0:
159    /// ```text
160    /// message-limit number
161    /// ```
162    #[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    /// ### Manual
168    ///
169    /// tmux ^3.3:
170    /// ```text
171    /// prompt-history-limit number
172    /// ```
173    #[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    /// ### Manual
182    ///
183    /// tmux ^1.5:
184    /// ```text
185    /// set-clipboard [on | external | off]
186    /// ```
187    #[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    /// ### Manual
193    ///
194    /// tmux ^3.2:
195    /// ```text
196    /// terminal-features[] string
197    /// ```
198    #[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    /// ### Manual
208    ///
209    /// tmux ^2.0:
210    /// ```text
211    /// terminal-overrides[] string
212    /// ```
213    #[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    /// ### Manual
223    ///
224    /// tmux ^3.0:
225    /// ```text
226    /// user-keys[] key
227    /// ```
228    #[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    /// ### Manual
238    ///
239    /// tmux ^1.2 v2.0:
240    /// ```text
241    /// quiet [on | off]
242    /// ```
243    #[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    /// ### Manual
249    ///
250    /// tmux ^1.3 v1.4:
251    /// ```text
252    /// detach-on-destroy [on | off]
253    /// ```
254    #[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}