1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
use crate::{SetClipboard, Switch};

// total num: 16
/// `backspace
#[cfg(feature = "tmux_3_1")]
pub const BACKSPACE: &str = "backspace";
/// `buffer-limit`
#[cfg(feature = "tmux_1_5")]
pub const BUFFER_LIMIT: &str = "buffer-limit";
/// `command-alias`
#[cfg(feature = "tmux_2_4")]
pub const COMMAND_ALIAS: &str = "command-alias";
/// `default-terminal`
#[cfg(feature = "tmux_2_1")]
pub const DEFAULT_TERMINAL: &str = "default-terminal";
/// `copy-command`
#[cfg(feature = "tmux_3_2")]
pub const COPY_COMMAND: &str = "copy-command";
/// `escape-time`
#[cfg(feature = "tmux_1_2")]
pub const ESCAPE_TIME: &str = "escape-time";
/// `editor`
#[cfg(feature = "tmux_3_2")]
pub const EDITOR: &str = "editor";
/// `exit-empty`
#[cfg(feature = "tmux_2_7")]
pub const EXIT_EMPTY: &str = "exit-empty";
/// `exit-unattached`
#[cfg(feature = "tmux_1_4")]
pub const EXIT_UNATTACHED: &str = "exit-unattached";
/// `extended-keys`
#[cfg(feature = "tmux_3_2")]
pub const EXTENDED_KEYS: &str = "extended-keys";
/// `focus-events`
#[cfg(feature = "tmux_1_9")]
pub const FOCUS_EVENTS: &str = "focus-events";
/// `history-file`
#[cfg(feature = "tmux_2_1")]
pub const HISTORY_FILE: &str = "history-file";
/// `message-limit`
#[cfg(feature = "tmux_2_0")]
pub const MESSAGE_LIMIT: &str = "message-limit";
/// `prompt-history-limit`
#[cfg(feature = "tmux_3_3")]
pub const PROMPT_HISTORY_LIMIT: &str = "prompt-history-limit";
/// `set-clipboard`
#[cfg(feature = "tmux_1_5")]
pub const SET_CLIPBOARD: &str = "set-clipboard";
/// `terminal-features`
#[cfg(feature = "tmux_3_2")]
pub const TERMINAL_FEATURES: &str = "terminal-features";
/// `terminal-overrides`
#[cfg(feature = "tmux_2_0")]
pub const TERMINAL_OVERRIDES: &str = "terminal-overrides";
/// `user-keys`
#[cfg(feature = "tmux_3_0")]
pub const USER_KEYS: &str = "user-keys";
/// `quiet`
#[cfg(all(feature = "tmux_1_2", not(feature = "tmux_2_0")))]
pub const QUIET: &str = "quiet";
/// `detach-on-destroy [on | off]
#[cfg(all(feature = "tmux_1_3", not(feature = "tmux_1_4")))]
pub const DETACH_ON_DESTROY: &str = "detach-on-destroy";

pub const USER_OPTION_MARKER: &str = "@";
pub const SEPARATOR: &str = " ";

// XXX: Option<T> or T for defaults?

/// tmux ^3.1:
/// ```text
/// backspace C-?
/// ```
// FIXME
// octal `\177` = `127` = delete?
#[cfg(feature = "tmux_3_1")]
pub const BACKSPACE_DEFAULT: &str = "C-?";

/// tmux ^1.5:
/// ```text
/// buffer-limit 50
/// ```
#[cfg(feature = "tmux_1_5")]
pub const BUFFER_LIMIT_DEFAULT: usize = 50;

/// tmux ^2.4 v2.6:
/// ```text
/// command-alias[0] split-pane=split-window
/// command-alias[1] splitp=split-window
/// command-alias[2] "server-info=show-messages -JT"
/// command-alias[3] "info=show-messages -JT"
/// ```
///
/// tmux ^2.6:
/// ```text
/// command-alias[0] split-pane=split-window
/// command-alias[1] splitp=split-window
/// command-alias[2] "server-info=show-messages -JT"
/// command-alias[3] "info=show-messages -JT"
/// command-alias[4] "choose-window=choose-tree -w"
/// command-alias[5] "choose-session=choose-tree -s"
/// ```
#[cfg(all(feature = "tmux_2_4", not(feature = "tmux_2_6")))]
pub const COMMAND_ALIAS_DEFAULT: [&str; 4] = [
    "split-pane=split-window",
    "splitp=split-window",
    "\"server-info=show-messages -JT\"",
    "\"info=show-messages -JT\"",
];
#[cfg(feature = "tmux_2_6")]
pub const COMMAND_ALIAS_DEFAULT: [&str; 6] = [
    "split-pane=split-window",
    "splitp=split-window",
    "\"server-info=show-messages -JT\"",
    "\"info=show-messages -JT\"",
    "\"choose-window=choose-tree -w\"",
    "\"choose-session=choose-tree -s\"",
];

/// tmux ^3.2:
/// ```text
/// copy-command
/// ```
#[cfg(feature = "tmux_3_2")]
pub const COPY_COMMAND_DEFAULT: &str = "";

// tmux.h
/// tmux ^2.1:
/// ```text
/// default-terminal screen
/// ```
#[cfg(feature = "tmux_2_1")]
pub const DEFAULT_TERMINAL_DEFAULT: &str = "screen";

/// tmux ^1.2:
/// ```text
/// escape-time 500
/// ```
#[cfg(feature = "tmux_1_2")]
pub const ESCAPE_TIME_DEFAULT: usize = 500;

// compat.h
/// tmux ^3.2:
/// ```text
/// editor /usr/bin/vi
/// ```
#[cfg(feature = "tmux_3_2")]
pub const EDITOR_DEFAULT: &str = "/usr/bin/vi";

/// tmux ^2.7:
/// ```text
/// exit-empty on
/// ```
#[cfg(feature = "tmux_2_7")]
pub const EXIT_EMPTY_DEFAULT: Switch = Switch::On;

/// tmux ^1.4:
/// ```text
/// exit-unattached off
/// ```
#[cfg(feature = "tmux_1_4")]
pub const EXIT_UNATTACHED_DEFAULT: Switch = Switch::Off;

/// tmux ^3.2:
/// ```text
/// extended-keys off
/// ```
#[cfg(feature = "tmux_3_2")]
pub const EXTENDED_KEYS_DEFAULT: Switch = Switch::Off;

/// tmux ^1.9:
/// ```text
/// focus-events off
/// ```
#[cfg(feature = "tmux_1_9")]
pub const FOCUS_EVENTS_DEFAULT: Switch = Switch::Off;

/// tmux ^2.1:
/// `""`
/// ```text
/// history-file ""
/// ```
#[cfg(feature = "tmux_2_1")]
pub const HISTORY_FILE_DEFAULT: &str = "";

/// tmux ^3.2:
/// ```text
/// message-limit 1000
/// ```
///
/// tmux ^2.0 v3.2:
/// ```text
/// message-limit 100
/// ```
#[cfg(all(feature = "tmux_2_0", not(feature = "tmux_3_2")))]
pub const MESSAGE_LIMIT_DEFAULT: usize = 100;
#[cfg(feature = "tmux_3_2")]
pub const MESSAGE_LIMIT_DEFAULT: usize = 1000;

/// tmux ^3.3:
/// ```text
/// prompt-history-limit 100
/// ```
#[cfg(feature = "tmux_3_3")]
pub const PROMPT_HISTORY_LIMIT_DEFAULT: usize = 100;

/// tmux ^2.6:
/// ```text
/// set-clipboard external
/// ```
///
/// tmux ^2.1 v2.6:
/// ```text
/// set-clipboard on
/// ```
#[cfg(all(feature = "tmux_1_5", not(feature = "tmux_2_6")))]
pub const SET_CLIPBOARD_DEFAULT: SetClipboard = SetClipboard::On;
#[cfg(feature = "tmux_2_6")]
pub const SET_CLIPBOARD_DEFAULT: SetClipboard = SetClipboard::External;

/// tmux ^3.2:
/// ```text
/// terminal-features[0] "xterm*:clipboard:ccolour:cstyle:focus:title"
/// terminal-features[1] "screen*:title"
/// ```
#[cfg(feature = "tmux_3_2")]
pub const TERMINAL_FEATURES_DEFAULT: [&str; 2] = [
    "xterm*:clipboard:ccolour:cstyle:focus:title",
    "screen*:title",
];

/// tmux ^3.2:
/// ```text
/// terminal-overrides[0] ""
/// ```
///
/// tmux ^2.0 v3.2:
/// ```text
/// terminal-overrides[0] "xterm*:XT:Ms=\\E]52;%p1%s;%p2%s\\007:Cs=\\E]12;%p1%s\\007:Cr=\\E]112\\007:Ss=\\E[%p1%d q:Se=\\E[2 q"
/// terminal-overrides[1] screen*:XT
/// ```
#[cfg(all(feature = "tmux_2_0", not(feature = "tmux_3_2")))]
pub const TERMINAL_OVERRIDES_DEFAULT: [&str; 2] = [
    "xterm*:XT:Ms=\\E]52;%p1%s;%p2%s\\007:Cs=\\E]12;%p1%s\\007:Cr=\\E]112\\007:Ss=\\E[%p1%d q:Se=\\E[2 q",
    "screen*:XT"
];
#[cfg(feature = "tmux_3_2")]
pub const TERMINAL_OVERRIDES_DEFAULT: [&str; 1] = [""];

/// tmux ^3.0:
/// ```text
/// user-keys[] ""
/// ```
// `""`
#[cfg(feature = "tmux_3_0")]
pub const USER_KEYS_DEFAULT: [&str; 1] = [""];

/// tmux ^1.2 v2.0:
/// ```text
/// quiet off
/// ```
#[cfg(all(feature = "tmux_1_2", not(feature = "tmux_2_0")))]
pub const QUIET_DEFAULT: Switch = Switch::Off;

/// tmux ^1.3 v1.4:
/// ```text
/// detach-on-destroy on
/// ```
#[cfg(all(feature = "tmux_1_3", not(feature = "tmux_1_4")))]
pub const DETACH_ON_DESTROY_DEFAULT: Switch = Switch::On;