aboutsummaryrefslogtreecommitdiff
path: root/src/pane/osc.rs
diff options
context:
space:
mode:
authorOgulcan Celik <ogulcancelik@gmail.com>2026-06-25 22:08:11 +0300
committerOgulcan Celik <ogulcancelik@gmail.com>2026-06-25 22:08:11 +0300
commit292a98a91e35662fd65993956278787ee0ca9840 (patch)
treeab14f0f075a5c92dab32373678a4e213c95bb2b0 /src/pane/osc.rs
parentdb1ef28d64279b290b882eea9a7a655dd78d08c9 (diff)
fix: answer osc 12 cursor color queries
refs #806
Diffstat (limited to 'src/pane/osc.rs')
-rw-r--r--src/pane/osc.rs6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/pane/osc.rs b/src/pane/osc.rs
index 83cb47ae..2fef72a2 100644
--- a/src/pane/osc.rs
+++ b/src/pane/osc.rs
@@ -11,6 +11,7 @@ use super::terminal::GhosttyPaneCore;
pub(super) enum DefaultColorQuery {
Foreground,
Background,
+ Cursor,
}
impl DefaultColorQuery {
@@ -18,6 +19,7 @@ impl DefaultColorQuery {
match self {
Self::Foreground => 10,
Self::Background => 11,
+ Self::Cursor => 12,
}
}
}
@@ -247,6 +249,7 @@ fn parse_default_color_event(body: &[u8]) -> Option<DefaultColorEvent> {
match body {
b"10;?" => Some(DefaultColorEvent::Query(DefaultColorQuery::Foreground)),
b"11;?" => Some(DefaultColorEvent::Query(DefaultColorQuery::Background)),
+ b"12;?" => Some(DefaultColorEvent::Query(DefaultColorQuery::Cursor)),
b"110" | b"110;" => Some(DefaultColorEvent::Reset(DefaultColorQuery::Foreground)),
b"111" | b"111;" => Some(DefaultColorEvent::Reset(DefaultColorQuery::Background)),
_ => parse_palette_color_query(body).or_else(|| parse_default_color_set_event(body)),
@@ -1288,7 +1291,7 @@ mod tests {
let mut tracker = DefaultColorEventTracker::default();
tracker.observe(
- b"\x1b]10;?\x07\x1b]11;?\x1b\\\x1b]4;0;?\x07\x1b]10;rgb:11/22/33\x07\x1b]111\x07",
+ b"\x1b]10;?\x07\x1b]11;?\x1b\\\x1b]12;?\x07\x1b]4;0;?\x07\x1b]10;rgb:11/22/33\x07\x1b]111\x07",
);
assert_eq!(
@@ -1296,6 +1299,7 @@ mod tests {
vec![
DefaultColorEvent::Query(DefaultColorQuery::Foreground),
DefaultColorEvent::Query(DefaultColorQuery::Background),
+ DefaultColorEvent::Query(DefaultColorQuery::Cursor),
DefaultColorEvent::PaletteQuery(0),
DefaultColorEvent::Set(DefaultColorQuery::Foreground),
DefaultColorEvent::Reset(DefaultColorQuery::Background),