tmux_interface/options/server/builder/
set_server_options_tr.rs

1use crate::{SetClipboard, SetServerOptionTr, Switch, TmuxCommand, TmuxCommands};
2
3use std::borrow::Cow;
4
5pub trait SetServerOptionsTr<'a> {
6    type Setter: SetServerOptionTr;
7
8    fn new() -> Self;
9
10    fn push(&mut self, option: TmuxCommand<'a>);
11
12    fn push_cmds(&mut self, options: TmuxCommands<'a>);
13
14    /// ### Manual
15    ///
16    /// tmux ^3.1:
17    /// ```text
18    /// backspace key
19    /// ```
20    #[cfg(feature = "tmux_3_1")]
21    fn backspace<S: Into<Cow<'a, str>>>(mut self, backspace: Option<S>) -> Self
22    where
23        Self: Sized,
24    {
25        self.push(Self::Setter::backspace(backspace));
26        self
27    }
28
29    /// ### Manual
30    ///
31    /// tmux ^1.5:
32    /// ```text
33    /// buffer-limit number
34    /// ```
35    #[cfg(feature = "tmux_1_5")]
36    fn buffer_limit(mut self, buffer_limit: Option<usize>) -> Self
37    where
38        Self: Sized,
39    {
40        self.push(Self::Setter::buffer_limit(buffer_limit));
41        self
42    }
43
44    /// ### Manual
45    ///
46    /// tmux ^2.4:
47    /// ```text
48    /// command-alias[] name=value
49    /// ```
50    #[cfg(feature = "tmux_2_4")]
51    fn command_alias<S>(mut self, command_alias: Option<Vec<S>>) -> Self
52    where
53        Self: Sized,
54        S: Into<Cow<'a, str>>,
55    {
56        self.push_cmds(Self::Setter::command_alias(command_alias));
57        self
58    }
59
60    /// ### Manual
61    ///
62    /// tmux ^3.2:
63    /// ```text
64    /// copy-command shell-command
65    /// ```
66    #[cfg(feature = "tmux_3_2")]
67    fn copy_command<S: Into<Cow<'a, str>>>(mut self, copy_command: Option<S>) -> Self
68    where
69        Self: Sized,
70    {
71        self.push(Self::Setter::copy_command(copy_command));
72        self
73    }
74
75    /// ### Manual
76    ///
77    /// tmux ^2.1:
78    /// ```text
79    /// default-terminal terminal
80    /// ```
81    #[cfg(feature = "tmux_2_1")]
82    fn default_terminal<S: Into<Cow<'a, str>>>(mut self, default_terminal: Option<S>) -> Self
83    where
84        Self: Sized,
85    {
86        self.push(Self::Setter::default_terminal(default_terminal));
87        self
88    }
89
90    /// ### Manual
91    ///
92    /// tmux ^1.2:
93    /// ```text
94    /// escape-time time
95    /// ```
96    #[cfg(feature = "tmux_1_2")]
97    fn escape_time(mut self, escape_time: Option<usize>) -> Self
98    where
99        Self: Sized,
100    {
101        self.push(Self::Setter::escape_time(escape_time));
102        self
103    }
104
105    /// ### Manual
106    ///
107    /// tmux ^3.2:
108    /// ```text
109    /// editor shell-command
110    /// ```
111    #[cfg(feature = "tmux_3_2")]
112    fn editor<S: Into<Cow<'a, str>>>(mut self, editor: Option<S>) -> Self
113    where
114        Self: Sized,
115    {
116        self.push(Self::Setter::editor(editor));
117        self
118    }
119
120    /// ### Manual
121    ///
122    /// tmux ^2.7:
123    /// ```text
124    /// exit-empty [on | off]
125    /// ```
126    #[cfg(feature = "tmux_2_7")]
127    fn exit_empty(mut self, exit_empty: Option<Switch>) -> Self
128    where
129        Self: Sized,
130    {
131        self.push(Self::Setter::exit_empty(exit_empty));
132        self
133    }
134
135    /// ### Manual
136    ///
137    /// tmux ^1.4:
138    /// ```text
139    /// exit-unattached [on | off]
140    /// ```
141    #[cfg(feature = "tmux_1_4")]
142    fn exit_unattached(mut self, exit_unattached: Option<Switch>) -> Self
143    where
144        Self: Sized,
145    {
146        self.push(Self::Setter::exit_unattached(exit_unattached));
147        self
148    }
149
150    /// ### Manual
151    ///
152    /// ```text
153    /// extended-keys [on | off]
154    /// ```
155    #[cfg(feature = "tmux_3_2")]
156    fn extended_keys(mut self, extended_keys: Option<Switch>) -> Self
157    where
158        Self: Sized,
159    {
160        self.push(Self::Setter::extended_keys(extended_keys));
161        self
162    }
163
164    /// ### Manual
165    ///
166    /// tmux ^1.9:
167    /// ```text
168    /// focus-events [on | off]
169    /// ```
170    #[cfg(feature = "tmux_1_9")]
171    fn focus_events(mut self, focus_events: Option<Switch>) -> Self
172    where
173        Self: Sized,
174    {
175        self.push(Self::Setter::focus_events(focus_events));
176        self
177    }
178
179    /// ### Manual
180    ///
181    /// tmux ^2.1:
182    /// ```text
183    /// history-file path
184    /// ```
185    #[cfg(feature = "tmux_2_1")]
186    fn history_file<S: Into<Cow<'a, str>>>(mut self, history_file: Option<S>) -> Self
187    where
188        Self: Sized,
189    {
190        self.push(Self::Setter::history_file(history_file));
191        self
192    }
193
194    /// ### Manual
195    ///
196    /// tmux ^2.0:
197    /// ```text
198    /// message-limit number
199    /// ```
200    #[cfg(feature = "tmux_2_0")]
201    fn message_limit(mut self, message_limit: Option<usize>) -> Self
202    where
203        Self: Sized,
204    {
205        self.push(Self::Setter::message_limit(message_limit));
206        self
207    }
208
209    /// ### Manual
210    ///
211    /// tmux ^3.3:
212    /// ```text
213    /// prompt-history-limit number
214    /// ```
215    #[cfg(feature = "tmux_3_3")]
216    fn prompt_history_limit(mut self, prompt_history_limit: Option<usize>) -> Self
217    where
218        Self: Sized,
219    {
220        self.push(Self::Setter::prompt_history_limit(prompt_history_limit));
221        self
222    }
223
224    /// ### Manual
225    ///
226    /// tmux ^1.5:
227    /// ```text
228    /// set-clipboard [on | external | off]
229    /// ```
230    #[cfg(feature = "tmux_1_5")]
231    fn set_clipboard(mut self, set_clipboard: Option<SetClipboard>) -> Self
232    where
233        Self: Sized,
234    {
235        self.push(Self::Setter::set_clipboard(set_clipboard));
236        self
237    }
238
239    /// ### Manual
240    ///
241    /// tmux ^3.2:
242    /// ```text
243    /// terminal-features[] string
244    /// ```
245    #[cfg(feature = "tmux_3_2")]
246    fn terminal_features<S, I>(mut self, terminal_features: Option<I>) -> Self
247    where
248        I: IntoIterator<Item = S>,
249        S: Into<Cow<'a, str>>,
250        Self: Sized,
251    {
252        self.push_cmds(Self::Setter::terminal_features(terminal_features));
253        self
254    }
255
256    /// ### Manual
257    ///
258    /// tmux ^2.0:
259    /// ```text
260    /// terminal-overrides[] string
261    /// ```
262    #[cfg(feature = "tmux_2_0")]
263    fn terminal_overrides<S>(mut self, terminal_overrides: Option<Vec<S>>) -> Self
264    where
265        Self: Sized,
266        S: Into<Cow<'a, str>>,
267    {
268        self.push_cmds(Self::Setter::terminal_overrides(terminal_overrides));
269        self
270    }
271
272    /// ### Manual
273    ///
274    /// tmux ^3.0:
275    /// ```text
276    /// user-keys[] key
277    /// ```
278    #[cfg(feature = "tmux_3_0")]
279    fn user_keys<S>(mut self, user_keys: Option<Vec<S>>) -> Self
280    where
281        S: Into<Cow<'a, str>>,
282        Self: Sized,
283    {
284        self.push_cmds(Self::Setter::user_keys(user_keys));
285        self
286    }
287
288    /// ### Manual
289    ///
290    /// tmux ^1.2 v2.0:
291    /// ```text
292    /// quiet [on | off]
293    /// ```
294    #[cfg(all(feature = "tmux_1_2", not(feature = "tmux_2_0")))]
295    fn quiet(mut self, quiet: Option<Switch>) -> Self
296    where
297        Self: Sized,
298    {
299        self.push(Self::Setter::quiet(quiet));
300        self
301    }
302
303    /// ### Manual
304    ///
305    /// tmux ^1.3 v1.4:
306    /// ```text
307    /// detach-on-destroy [on | off]
308    /// ```
309    #[cfg(all(feature = "tmux_1_3", not(feature = "tmux_1_4")))]
310    fn detach_on_destroy(mut self, detach_on_destroy: Option<Switch>) -> Self
311    where
312        Self: Sized,
313    {
314        self.push(Self::Setter::detach_on_destroy(detach_on_destroy));
315        self
316    }
317
318    fn build(self) -> TmuxCommands<'a>;
319}