fix: read alternate-screen agent history

This commit is contained in:
Ogulcan Celik
2026-07-31 16:22:04 +03:00
parent 7db744ab47
commit bc1c052d15
20 changed files with 1167 additions and 14 deletions
+7
View File
@@ -66,6 +66,13 @@ pub enum ReadSource {
Detection,
}
#[derive(Debug, Clone, Copy, PartialEq, Eq, Default)]
pub(crate) enum ReadIntent {
#[default]
Interactive,
Passive,
}
#[derive(
Debug, Clone, Copy, PartialEq, Eq, Serialize, Deserialize, schemars::JsonSchema, Default,
)]
+3
View File
@@ -258,6 +258,9 @@ pub struct PaneReadParams {
pub format: ReadFormat,
#[serde(default = "super::default_true")]
pub strip_ansi: bool,
#[serde(skip)]
#[schemars(skip)]
pub(crate) intent: super::common::ReadIntent,
}
#[derive(Debug, Clone, Copy, PartialEq, Eq, Serialize, Deserialize, schemars::JsonSchema)]
+3
View File
@@ -412,10 +412,13 @@ fn pane_read_defaults_to_text_format() {
"#;
let request: Request = serde_json::from_str(json).unwrap();
let serialized = serde_json::to_value(&request).unwrap();
assert!(serialized["params"].get("intent").is_none());
let Method::PaneRead(params) = request.method else {
panic!("wrong method parsed");
};
assert_eq!(params.format, ReadFormat::Text);
assert_eq!(params.intent, ReadIntent::Interactive);
}
#[test]
+1
View File
@@ -557,6 +557,7 @@ fn pane_read(
lines,
format: crate::api::schema::ReadFormat::Text,
strip_ansi,
intent: crate::api::schema::ReadIntent::Passive,
}),
},
api_tx,
+1
View File
@@ -64,6 +64,7 @@ pub(super) fn wait_for_output(
lines: params.lines,
format: crate::api::schema::ReadFormat::Text,
strip_ansi: params.strip_ansi,
intent: crate::api::schema::ReadIntent::Passive,
}),
};
let response =