aboutsummaryrefslogtreecommitdiff
path: root/src/api
diff options
context:
space:
mode:
authorOgulcan Celik <ogulcancelik@gmail.com>2026-04-07 02:48:13 +0300
committerOgulcan Celik <ogulcancelik@gmail.com>2026-04-07 02:48:13 +0300
commit5e05460816bbcea61a111bfa57be9907116e8ffc (patch)
tree86309a79cd7f49b82e0129de131c6723365a14a1 /src/api
parent06f01df93d895298508173cd59a8cf8eb2dd5bdc (diff)
docs: clarify herdr pane split and wait output usage
Diffstat (limited to 'src/api')
-rw-r--r--src/api/mod.rs13
-rw-r--r--src/api/schema.rs1
2 files changed, 12 insertions, 2 deletions
diff --git a/src/api/mod.rs b/src/api/mod.rs
index 1a713323..27317403 100644
--- a/src/api/mod.rs
+++ b/src/api/mod.rs
@@ -248,6 +248,15 @@ fn handle_request(request: Request, api_tx: &ApiRequestSender) -> String {
}
}
+fn output_match_read_source(
+ source: &crate::api::schema::ReadSource,
+) -> crate::api::schema::ReadSource {
+ match source {
+ crate::api::schema::ReadSource::Recent => crate::api::schema::ReadSource::RecentUnwrapped,
+ other => other.clone(),
+ }
+}
+
fn wait_for_output(
request_id: String,
params: crate::api::schema::PaneWaitForOutputParams,
@@ -279,7 +288,7 @@ fn wait_for_output(
id: format!("{request_id}:read"),
method: Method::PaneRead(crate::api::schema::PaneReadParams {
pane_id: params.pane_id.clone(),
- source: params.source.clone(),
+ source: output_match_read_source(&params.source),
lines: params.lines,
strip_ansi: params.strip_ansi,
}),
@@ -587,7 +596,7 @@ impl ActiveOutputMatchedSubscription {
let read = pane_read(
format!("{}:read", self.request_prefix),
&self.pane_id,
- self.source.clone(),
+ output_match_read_source(&self.source),
self.lines,
self.strip_ansi,
api_tx,
diff --git a/src/api/schema.rs b/src/api/schema.rs
index 5a27b01b..e266f0ff 100644
--- a/src/api/schema.rs
+++ b/src/api/schema.rs
@@ -197,6 +197,7 @@ pub struct PaneReleaseAgentParams {
pub enum ReadSource {
Visible,
Recent,
+ RecentUnwrapped,
}
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]