From 5e05460816bbcea61a111bfa57be9907116e8ffc Mon Sep 17 00:00:00 2001 From: Ogulcan Celik Date: Tue, 7 Apr 2026 02:48:13 +0300 Subject: docs: clarify herdr pane split and wait output usage --- src/api/mod.rs | 13 +++++++++++-- src/api/schema.rs | 1 + 2 files changed, 12 insertions(+), 2 deletions(-) (limited to 'src/api') 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(¶ms.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)] -- cgit v1.2.3