aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorKirill Chibisov <contact@kchibisov.com>2023-08-07 05:23:17 +0400
committerGitHub <noreply@github.com>2023-08-07 05:23:17 +0400
commit8cf8505956aaab7565902c900b514a018a579d35 (patch)
tree0223571cc31eee24486cf205588164dc775331e8 /src
parent94e74f3a64f42d5dad4e3d42dbe8c23291038214 (diff)
downloadr-alacritty-vte-8cf8505956aaab7565902c900b514a018a579d35.tar.gz
r-alacritty-vte-8cf8505956aaab7565902c900b514a018a579d35.tar.bz2
r-alacritty-vte-8cf8505956aaab7565902c900b514a018a579d35.zip
Add support for OSC 22
Diffstat (limited to 'src')
-rw-r--r--src/ansi.rs13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/ansi.rs b/src/ansi.rs
index 1385802..cd9499d 100644
--- a/src/ansi.rs
+++ b/src/ansi.rs
@@ -25,6 +25,7 @@ use core::ops::Mul;
#[cfg(not(feature = "no_std"))]
use std::time::Instant;
+use cursor_icon::CursorIcon;
use log::{debug, trace};
#[cfg(feature = "serde")]
use serde::{Deserialize, Serialize};
@@ -668,6 +669,9 @@ pub trait Handler {
/// Set hyperlink.
fn set_hyperlink(&mut self, _: Option<Hyperlink>) {}
+
+ /// Set mouse cursor icon.
+ fn set_mouse_cursor_icon(&mut self, _: CursorIcon) {}
}
/// Terminal cursor configuration.
@@ -1267,6 +1271,15 @@ where
unhandled(params);
},
+ // Set mouse cursor shape.
+ b"22" if params.len() == 2 => {
+ let shape = String::from_utf8_lossy(params[1]);
+ match CursorIcon::from_str(&shape) {
+ Ok(cursor_icon) => self.handler.set_mouse_cursor_icon(cursor_icon),
+ Err(_) => debug!("[osc 22] unrecognized cursor icon shape: {shape:?}"),
+ }
+ },
+
// Set cursor style.
b"50" => {
if params.len() >= 2