diff options
| author | Andy <bigspeedfpv@gmail.com> | 2025-10-04 14:43:53 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-10-04 18:43:53 +0000 |
| commit | fa36b3abb165d26595bb8b9c74042dd74ed0f235 (patch) | |
| tree | 9f32ebc9b51ea8ac23483a5c919d0e444e4e58c5 | |
| parent | a2334ff494a26a38f66685d0f950a9b589ac84a9 (diff) | |
| download | r-alacritty-fa36b3abb165d26595bb8b9c74042dd74ed0f235.tar.gz r-alacritty-fa36b3abb165d26595bb8b9c74042dd74ed0f235.tar.bz2 r-alacritty-fa36b3abb165d26595bb8b9c74042dd74ed0f235.zip | |
Disable NSAutoFillHeuristicController on macOS
| -rw-r--r-- | CHANGELOG.md | 4 | ||||
| -rw-r--r-- | alacritty/Cargo.toml | 1 | ||||
| -rw-r--r-- | alacritty/src/macos/mod.rs | 14 | ||||
| -rw-r--r-- | alacritty/src/main.rs | 3 |
4 files changed, 22 insertions, 0 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md index 22ad4618..6f407bef 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -14,6 +14,10 @@ Notable changes to the `alacritty_terminal` crate are documented in its - Don't highlight hints on hover when the mouse cursor is hidden +### Fixed + +- Slowdowns over time on macOS 26 + ## 0.16.0 ### Packaging diff --git a/alacritty/Cargo.toml b/alacritty/Cargo.toml index 80611940..f7f9b10d 100644 --- a/alacritty/Cargo.toml +++ b/alacritty/Cargo.toml @@ -61,6 +61,7 @@ objc2-foundation = { version = "0.3.1", default-features = false, features = [ "std", "NSString", "NSLocale", + "NSUserDefaults", ] } objc2-app-kit = { version = "0.3.1", default-features = false, features = [ "std", diff --git a/alacritty/src/macos/mod.rs b/alacritty/src/macos/mod.rs index 1d630730..90d0fb96 100644 --- a/alacritty/src/macos/mod.rs +++ b/alacritty/src/macos/mod.rs @@ -1,2 +1,16 @@ +use objc2::runtime::AnyObject; +use objc2_foundation::{NSDictionary, NSString, NSUserDefaults, ns_string}; + pub mod locale; pub mod proc; + +pub fn disable_autofill() { + unsafe { + NSUserDefaults::standardUserDefaults().registerDefaults( + &NSDictionary::<NSString, AnyObject>::from_slices( + &[ns_string!("NSAutoFillHeuristicControllerEnabled")], + &[ns_string!("NO")], + ), + ); + } +} diff --git a/alacritty/src/main.rs b/alacritty/src/main.rs index eff1a0a2..54de44bc 100644 --- a/alacritty/src/main.rs +++ b/alacritty/src/main.rs @@ -180,6 +180,9 @@ fn alacritty(mut options: Options) -> Result<(), Box<dyn Error>> { #[cfg(target_os = "macos")] locale::set_locale_environment(); + #[cfg(target_os = "macos")] + macos::disable_autofill(); + // Create the IPC socket listener. #[cfg(unix)] let socket_path = if config.ipc_socket() { |