aboutsummaryrefslogtreecommitdiff
path: root/src/ghostty/mod.rs
diff options
context:
space:
mode:
authorCan Celik <ogulcancelik@gmail.com>2026-08-19 04:43:28 +0300
committerGitHub <noreply@github.com>2026-08-19 04:43:28 +0300
commita5c69beabfc82d9c3f9563eb821139b2e0f3e14f (patch)
tree9b7049e4629913dcab40d985df399acee262b67b /src/ghostty/mod.rs
parent3667151744e379ac5c8f76d57203b675de8a6ebc (diff)
fix(perf): eliminate redundant terminal wake work (#2962)
* fix(perf): eliminate redundant terminal wake work * fix(perf): harden release benchmark gate * test(perf): strengthen performance guardrails
Diffstat (limited to 'src/ghostty/mod.rs')
-rw-r--r--src/ghostty/mod.rs15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/ghostty/mod.rs b/src/ghostty/mod.rs
index cea7c283..c044d3b0 100644
--- a/src/ghostty/mod.rs
+++ b/src/ghostty/mod.rs
@@ -1034,6 +1034,10 @@ impl Terminal {
self.get_bool(ffi::GhosttyTerminalData_GHOSTTY_TERMINAL_DATA_MOUSE_TRACKING)
}
+ pub fn modify_other_keys_enabled(&self) -> Result<bool, Error> {
+ self.get_bool(ffi::GhosttyTerminalData_GHOSTTY_TERMINAL_DATA_MODIFY_OTHER_KEYS)
+ }
+
pub fn active_screen(&self) -> Result<ActiveScreen, Error> {
let mut out = ffi::GhosttyTerminalScreen_GHOSTTY_TERMINAL_SCREEN_PRIMARY;
unsafe {
@@ -3636,6 +3640,17 @@ mod tests {
}
#[test]
+ fn modify_other_keys_query_tracks_mode_two() {
+ let mut terminal = Terminal::new(80, 24, 0).unwrap();
+
+ assert!(!terminal.modify_other_keys_enabled().unwrap());
+ terminal.write(b"\x1b[>4;2m");
+ assert!(terminal.modify_other_keys_enabled().unwrap());
+ terminal.write(b"\x1b[>4;0m");
+ assert!(!terminal.modify_other_keys_enabled().unwrap());
+ }
+
+ #[test]
fn terminal_read_text_viewport_unwraps_soft_wrapped_selection() {
let mut terminal = Terminal::new(5, 3, 0).unwrap();
terminal.write("1ABCD2EFGH3IJKL".as_bytes());