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
use serde::{Deserialize, Serialize};
use std::path::PathBuf;
use crate::PaneTarget;
/// Request payload for `set-buffer`.
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
pub struct SetBufferRequest {
/// The optional buffer name. When `None`, an unnamed buffer is created.
pub name: Option<String>,
/// The buffer content.
pub content: Vec<u8>,
/// Whether new content should append to an existing buffer.
#[serde(default)]
pub append: bool,
/// Optional new name for a rename-only mutation.
#[serde(default)]
pub new_name: Option<String>,
/// Whether the buffer should also be copied to the client clipboard.
#[serde(default)]
pub set_clipboard: bool,
}
/// Request payload for `show-buffer`.
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
pub struct ShowBufferRequest {
/// The optional buffer name. When `None`, the stack-head buffer is shown.
pub name: Option<String>,
}
/// Request payload for `paste-buffer`.
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
pub struct PasteBufferRequest {
/// The optional buffer name. When `None`, the stack-head buffer is pasted.
pub name: Option<String>,
/// The target pane to write the buffer content to.
pub target: PaneTarget,
/// Whether to delete the buffer after pasting.
pub delete_after: bool,
/// Optional replacement separator for embedded newlines.
#[serde(default)]
pub separator: Option<String>,
/// Whether newline separators should use `\\n` instead of `\\r`.
#[serde(default)]
pub linefeed: bool,
/// Whether raw bytes should be written without vis-style escaping.
#[serde(default)]
pub raw: bool,
/// Whether bracketed paste wrappers should be emitted when enabled on the pane.
#[serde(default)]
pub bracketed: bool,
}
/// Request payload for `list-buffers`.
#[derive(Debug, Clone, Default, PartialEq, Eq, Serialize, Deserialize)]
pub struct ListBuffersRequest {
/// Optional format template.
#[serde(default)]
pub format: Option<String>,
/// Optional filter expression.
#[serde(default)]
pub filter: Option<String>,
/// Optional sort order string.
#[serde(default)]
pub sort_order: Option<String>,
/// Whether to reverse the rendered order.
#[serde(default)]
pub reversed: bool,
}
/// Request payload for `delete-buffer`.
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
pub struct DeleteBufferRequest {
/// The optional buffer name. When `None`, the stack-head buffer is deleted.
pub name: Option<String>,
}
/// Request payload for `load-buffer`.
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
pub struct LoadBufferRequest {
/// The caller-supplied path to read.
pub path: String,
/// The caller working directory used to resolve relative paths.
pub cwd: Option<PathBuf>,
/// The optional buffer name. When `None`, an unnamed buffer is created.
pub name: Option<String>,
/// Whether the loaded content should also be copied to the client clipboard.
#[serde(default)]
pub set_clipboard: bool,
}
/// Request payload for `save-buffer`.
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
pub struct SaveBufferRequest {
/// The caller-supplied path to write.
pub path: String,
/// The caller working directory used to resolve relative paths.
pub cwd: Option<PathBuf>,
/// The optional buffer name. When `None`, the stack-head buffer is saved.
pub name: Option<String>,
/// Whether output should append to the file instead of replacing it.
#[serde(default)]
pub append: bool,
}
/// Request payload for `capture-pane`.
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
pub struct CapturePaneRequest {
/// The pane whose retained transcript should be captured.
pub target: PaneTarget,
/// The optional inclusive start line.
pub start: Option<i64>,
/// The optional inclusive end line.
pub end: Option<i64>,
/// Whether to print captured bytes to stdout instead of writing a buffer.
pub print: bool,
/// The optional destination buffer name for non-printing captures.
pub buffer_name: Option<String>,
/// Whether the saved alternate-screen copy should be captured.
#[serde(default)]
pub alternate: bool,
/// Whether ANSI SGR and hyperlink sequences should be preserved.
#[serde(default)]
pub escape_ansi: bool,
/// Whether control sequences should be octal-escaped.
#[serde(default)]
pub escape_sequences: bool,
/// Whether wrapped rows should be joined without intervening newlines.
#[serde(default)]
pub join_wrapped: bool,
/// Whether the copy-mode screen should be captured when present.
#[serde(default)]
pub use_mode_screen: bool,
/// Whether trailing spaces should be preserved.
#[serde(default)]
pub preserve_trailing_spaces: bool,
/// Whether trailing spaces should not be trimmed.
#[serde(default)]
pub do_not_trim_spaces: bool,
/// Whether pending parser bytes should be captured instead of the screen grid.
#[serde(default)]
pub pending_input: bool,
/// Whether missing alternate-screen content should be silenced.
#[serde(default)]
pub quiet: bool,
/// Whether `-S -` was used.
#[serde(default)]
pub start_is_absolute: bool,
/// Whether `-E -` was used.
#[serde(default)]
pub end_is_absolute: bool,
}
/// Request payload for `clear-history`.
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
pub struct ClearHistoryRequest {
/// The target pane whose history should be cleared.
pub target: PaneTarget,
/// Whether OSC 8 hyperlink storage should also be reset.
#[serde(default)]
pub reset_hyperlinks: bool,
}