Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package alacritty for openSUSE:Factory checked in at 2024-01-14 19:03:18 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/alacritty (Old) and /work/SRC/openSUSE:Factory/.alacritty.new.21961 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "alacritty" Sun Jan 14 19:03:18 2024 rev:37 rq:1138478 version:0.13.1 Changes: -------- --- /work/SRC/openSUSE:Factory/alacritty/alacritty.changes 2024-01-03 12:27:29.404960723 +0100 +++ /work/SRC/openSUSE:Factory/.alacritty.new.21961/alacritty.changes 2024-01-14 19:03:51.488214756 +0100 @@ -1,0 +2,13 @@ +Thu Jan 11 10:40:34 UTC 2024 - dims...@opensuse.org + +- Update to version 0.13.1: + * Fix manpage string escapes + * Fix serde tests without default features + * Bump winit to 0.29.9 + * Ignore null values in `alacritty migrate` + * Add vi search paste bindings + * Fix replacing optional fields + * Fix number-based mouse bindings + * Bump winit to 0.29.8 + +------------------------------------------------------------------- Old: ---- alacritty-0.13.0.tar.xz New: ---- _servicedata alacritty-0.13.1.tar.xz alacritty.obsinfo ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ alacritty.spec ++++++ --- /var/tmp/diff_new_pack.ZDiGyM/_old 2024-01-14 19:03:52.416248563 +0100 +++ /var/tmp/diff_new_pack.ZDiGyM/_new 2024-01-14 19:03:52.420248708 +0100 @@ -1,7 +1,7 @@ # # spec file for package alacritty # -# Copyright (c) 2023 SUSE LLC +# Copyright (c) 2024 SUSE LLC # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -17,7 +17,7 @@ Name: alacritty -Version: 0.13.0 +Version: 0.13.1 Release: 0 Summary: A GPU-accelerated terminal emulator License: Apache-2.0 ++++++ _service ++++++ --- /var/tmp/diff_new_pack.ZDiGyM/_old 2024-01-14 19:03:52.460250165 +0100 +++ /var/tmp/diff_new_pack.ZDiGyM/_new 2024-01-14 19:03:52.464250311 +0100 @@ -4,7 +4,7 @@ <service name="obs_scm" mode="manual"> <param name="scm">git</param> <param name="url">https://github.com/alacritty/alacritty.git</param> - <param name="revision">refs/tags/v0.13.0</param> + <param name="revision">refs/tags/v0.13.1</param> <param name="match-tag">v*</param> <param name="versionformat">@PARENT_TAG@</param> <param name="versionrewrite-pattern">v(.*)</param> ++++++ _servicedata ++++++ <servicedata> <service name="tar_scm"> <param name="url">https://github.com/alacritty/alacritty.git</param> <param name="changesrevision">fe2a3c566759c9926150181006bd56cb2293ae10</param></service></servicedata> (No newline at EOF) ++++++ alacritty-0.13.0.tar.xz -> alacritty-0.13.1.tar.xz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/alacritty-0.13.0/.github/workflows/ci.yml new/alacritty-0.13.1/.github/workflows/ci.yml --- old/alacritty-0.13.0/.github/workflows/ci.yml 2023-12-27 22:13:35.000000000 +0100 +++ new/alacritty-0.13.1/.github/workflows/ci.yml 2024-01-08 16:47:29.000000000 +0100 @@ -17,6 +17,8 @@ - uses: actions/checkout@v3 - name: Stable run: cargo test + - name: Stable (no default features) + run: cargo test -p alacritty_terminal --no-default-features - name: Oldstable run: | rustup default 1.70.0 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/alacritty-0.13.0/CHANGELOG.md new/alacritty-0.13.1/CHANGELOG.md --- old/alacritty-0.13.0/CHANGELOG.md 2023-12-27 22:13:35.000000000 +0100 +++ new/alacritty-0.13.1/CHANGELOG.md 2024-01-08 16:47:29.000000000 +0100 @@ -5,6 +5,34 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). +## 0.13.1 + +### Added + +- Support for pasting in Vi + Search mode + +### Changed + +- `alacritty migrate` will ignore null values in yaml instead of erroring out + +### Fixed + +- `alacritty migrate` failing with nonexistent imports +- `Alt` bindings requiring composed key rather than pre-composed one on macOS +- `Alt + Control` bindings not working on Windows +- `chars = "\u000A"` action in bindings inserting `\n` +- Alternate keys not sent for `Shift + <number>` when using kitty protocol +- Alternative keys being swapped in kitty protocol implementation +- Powerline glyphs being cut for narrow fonts +- Xmodmap not working on X11 +- Occasional slow startup on some X11 window managers +- Blurry window when using `window.dimensions` on some Wayland compositors +- IME input lagging behind on X11 +- xdotool modifiers input not working correctly on X11 +- Parsing numbers fails for mouse bindings +- Some config options overriding each other in CLI/IPC +- Numpad `Left` used for numpad `Up` + ## 0.13.0 ### Packaging diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/alacritty-0.13.0/Cargo.lock new/alacritty-0.13.1/Cargo.lock --- old/alacritty-0.13.0/Cargo.lock 2023-12-27 22:13:35.000000000 +0100 +++ new/alacritty-0.13.1/Cargo.lock 2024-01-08 16:47:29.000000000 +0100 @@ -32,7 +32,7 @@ [[package]] name = "alacritty" -version = "0.13.0" +version = "0.13.1" dependencies = [ "ahash", "alacritty_config", @@ -53,7 +53,6 @@ "log", "notify", "objc", - "once_cell", "parking_lot", "png", "raw-window-handle", @@ -69,8 +68,9 @@ [[package]] name = "alacritty_config" -version = "0.1.2" +version = "0.2.0" dependencies = [ + "alacritty_config_derive", "log", "serde", "toml", @@ -91,7 +91,7 @@ [[package]] name = "alacritty_terminal" -version = "0.20.0" +version = "0.21.0" dependencies = [ "base64", "bitflags 2.4.1", @@ -2310,9 +2310,9 @@ [[package]] name = "winit" -version = "0.29.7" +version = "0.29.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7fd430cd4560ee9c48885a4ef473b609a56796e37b1e18222abee146143f7457" +checksum = "c2376dab13e09c01ad8b679f0dbc7038af4ec43d9a91344338e37bd686481550" dependencies = [ "ahash", "android-activity", diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/alacritty-0.13.0/README.md new/alacritty-0.13.1/README.md --- old/alacritty-0.13.0/README.md 2023-12-27 22:13:35.000000000 +0100 +++ new/alacritty-0.13.1/README.md 2024-01-08 16:47:29.000000000 +0100 @@ -55,10 +55,6 @@ ## Configuration -**Alacritty versions before 0.13.0 are using YAML configuration files -and all their settings were documented in the `alacritty.yml`. The example -`alacritty.yml` file for each release can be found on [GitHub releases page](https://github.com/alacritty/alacritty/releases).** - You can find the documentation for Alacritty's configuration in `man 5 alacritty`, or by looking at [the website] if you do not have the manpages installed. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/alacritty-0.13.0/alacritty/Cargo.toml new/alacritty-0.13.1/alacritty/Cargo.toml --- old/alacritty-0.13.0/alacritty/Cargo.toml 2023-12-27 22:13:35.000000000 +0100 +++ new/alacritty-0.13.1/alacritty/Cargo.toml 2024-01-08 16:47:29.000000000 +0100 @@ -1,6 +1,6 @@ [package] name = "alacritty" -version = "0.13.0" +version = "0.13.1" authors = ["Christian Duerr <cont...@christianduerr.com>", "Joe Wilm <j...@jwilm.com>"] license = "Apache-2.0" description = "A fast, cross-platform, OpenGL terminal emulator" @@ -11,7 +11,7 @@ [dependencies.alacritty_terminal] path = "../alacritty_terminal" -version = "0.20.0" +version = "0.21.0" [dependencies.alacritty_config_derive] path = "../alacritty_config_derive" @@ -19,7 +19,7 @@ [dependencies.alacritty_config] path = "../alacritty_config" -version = "0.1.2" +version = "0.2.0" [dependencies] ahash = { version = "0.8.6", features = ["no-rng"] } @@ -32,7 +32,6 @@ libc = "0.2" log = { version = "0.4", features = ["std", "serde"] } notify = "6.1.1" -once_cell = "1.12" parking_lot = "0.12.0" raw-window-handle = "0.5" serde = { version = "1", features = ["derive"] } @@ -40,7 +39,7 @@ serde_yaml = "0.9.25" toml = "0.8.2" unicode-width = "0.1" -winit = { version = "0.29.7", default-features = false, features = ["rwh_05", "serde"] } +winit = { version = "0.29.9", default-features = false, features = ["rwh_05", "serde"] } [build-dependencies] gl_generator = "0.14.0" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/alacritty-0.13.0/alacritty/src/config/bindings.rs new/alacritty-0.13.1/alacritty/src/config/bindings.rs --- old/alacritty-0.13.0/alacritty/src/config/bindings.rs 2023-12-27 22:13:35.000000000 +0100 +++ new/alacritty-0.13.1/alacritty/src/config/bindings.rs 2024-01-08 16:47:29.000000000 +0100 @@ -445,6 +445,7 @@ Copy; Action::Copy; Copy, +BindingMode::VI; Action::ClearSelection; Paste, ~BindingMode::VI; Action::Paste; + Paste, +BindingMode::VI, +BindingMode::SEARCH; Action::Paste; "l", ModifiersState::CONTROL; Action::ClearLogNotice; "l", ModifiersState::CONTROL; Action::ReceiveChar; Home, ModifiersState::SHIFT, ~BindingMode::ALT_SCREEN; Action::ScrollToTop; @@ -546,6 +547,7 @@ bindings!( KeyBinding; "v", ModifiersState::CONTROL | ModifiersState::SHIFT, ~BindingMode::VI; Action::Paste; + "v", ModifiersState::CONTROL | ModifiersState::SHIFT, +BindingMode::VI, +BindingMode::SEARCH; Action::Paste; "f", ModifiersState::CONTROL | ModifiersState::SHIFT, ~BindingMode::SEARCH; Action::SearchForward; "b", ModifiersState::CONTROL | ModifiersState::SHIFT, ~BindingMode::SEARCH; Action::SearchBackward; Insert, ModifiersState::SHIFT, ~BindingMode::VI; Action::PasteSelection; @@ -602,6 +604,7 @@ "k", ModifiersState::SUPER, ~BindingMode::VI, ~BindingMode::SEARCH; Action::Esc("\x0c".into()); "k", ModifiersState::SUPER, ~BindingMode::VI, ~BindingMode::SEARCH; Action::ClearHistory; "v", ModifiersState::SUPER, ~BindingMode::VI; Action::Paste; + "v", ModifiersState::SUPER, +BindingMode::VI, +BindingMode::SEARCH; Action::Paste; "n", ModifiersState::SUPER; Action::CreateNewWindow; "f", ModifiersState::CONTROL | ModifiersState::SUPER; Action::ToggleFullscreen; "c", ModifiersState::SUPER; Action::Copy; @@ -860,6 +863,16 @@ f.write_str("Left, Right, Middle, Back, Forward, or a number from 0 to 65536") } + fn visit_i64<E>(self, value: i64) -> Result<MouseButtonWrapper, E> + where + E: de::Error, + { + match value { + 0..=65536 => Ok(MouseButtonWrapper(MouseButton::Other(value as u16))), + _ => Err(E::invalid_value(Unexpected::Signed(value), &self)), + } + } + fn visit_u64<E>(self, value: u64) -> Result<MouseButtonWrapper, E> where E: de::Error, diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/alacritty-0.13.0/alacritty/src/config/debug.rs new/alacritty-0.13.1/alacritty/src/config/debug.rs --- old/alacritty-0.13.0/alacritty/src/config/debug.rs 2023-12-27 22:13:35.000000000 +0100 +++ new/alacritty-0.13.1/alacritty/src/config/debug.rs 2024-01-08 16:47:29.000000000 +0100 @@ -1,7 +1,5 @@ use log::LevelFilter; -use serde::Deserialize; - use alacritty_config_derive::ConfigDeserialize; /// Debugging options. @@ -47,17 +45,17 @@ } /// The renderer configuration options. -#[derive(Deserialize, Copy, Clone, Debug, PartialEq, Eq, PartialOrd, Ord)] +#[derive(ConfigDeserialize, Copy, Clone, Debug, PartialEq, Eq, PartialOrd, Ord)] pub enum RendererPreference { /// OpenGL 3.3 renderer. - #[serde(rename = "glsl3")] + #[config(rename = "glsl3")] Glsl3, /// GLES 2 renderer, with optional extensions like dual source blending. - #[serde(rename = "gles2")] + #[config(rename = "gles2")] Gles2, /// Pure GLES 2 renderer. - #[serde(rename = "gles2_pure")] + #[config(rename = "gles2_pure")] Gles2Pure, } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/alacritty-0.13.0/alacritty/src/config/mod.rs new/alacritty-0.13.1/alacritty/src/config/mod.rs --- old/alacritty-0.13.0/alacritty/src/config/mod.rs 2023-12-27 22:13:35.000000000 +0100 +++ new/alacritty-0.13.1/alacritty/src/config/mod.rs 2024-01-08 16:47:29.000000000 +0100 @@ -207,7 +207,7 @@ config_paths.push(path.to_owned()); // Deserialize the configuration file. - let config = deserialize_config(path)?; + let config = deserialize_config(path, false)?; // Merge config with imports. let imports = load_imports(&config, config_paths, recursion_limit); @@ -215,7 +215,7 @@ } /// Deserialize a configuration file. -pub fn deserialize_config(path: &Path) -> Result<Value> { +pub fn deserialize_config(path: &Path, warn_pruned: bool) -> Result<Value> { let mut contents = fs::read_to_string(path)?; // Remove UTF-8 BOM. @@ -230,7 +230,8 @@ "YAML config {path:?} is deprecated, please migrate to TOML using `alacritty migrate`" ); - let value: serde_yaml::Value = serde_yaml::from_str(&contents)?; + let mut value: serde_yaml::Value = serde_yaml::from_str(&contents)?; + prune_yaml_nulls(&mut value, warn_pruned); contents = toml::to_string(&value)?; } @@ -318,6 +319,35 @@ Ok(import_paths) } +/// Prune the nulls from the YAML to ensure TOML compatibility. +fn prune_yaml_nulls(value: &mut serde_yaml::Value, warn_pruned: bool) { + fn walk(value: &mut serde_yaml::Value, warn_pruned: bool) -> bool { + match value { + serde_yaml::Value::Sequence(sequence) => { + sequence.retain_mut(|value| !walk(value, warn_pruned)); + sequence.is_empty() + }, + serde_yaml::Value::Mapping(mapping) => { + mapping.retain(|key, value| { + let retain = !walk(value, warn_pruned); + if let Some(key_name) = key.as_str().filter(|_| !retain && warn_pruned) { + eprintln!("Removing null key \"{key_name}\" from the end config"); + } + retain + }); + mapping.is_empty() + }, + serde_yaml::Value::Null => true, + _ => false, + } + } + + if walk(value, warn_pruned) { + // When the value itself is null return the mapping. + *value = serde_yaml::Value::Mapping(Default::default()); + } +} + /// Get the location of the first found default config file paths /// according to the following order: /// @@ -370,4 +400,43 @@ fn empty_config() { toml::from_str::<UiConfig>("").unwrap(); } + + fn yaml_to_toml(contents: &str) -> String { + let mut value: serde_yaml::Value = serde_yaml::from_str(contents).unwrap(); + prune_yaml_nulls(&mut value, false); + toml::to_string(&value).unwrap() + } + + #[test] + fn yaml_with_nulls() { + let contents = r#" + window: + blinking: Always + cursor: + not_blinking: Always + some_array: + - { window: } + - { window: "Hello" } + + "#; + let toml = yaml_to_toml(contents); + assert_eq!( + toml.trim(), + r#"[window] +blinking = "Always" +not_blinking = "Always" + +[[window.some_array]] +window = "Hello""# + ); + } + + #[test] + fn empty_yaml_to_toml() { + let contents = r#" + + "#; + let toml = yaml_to_toml(contents); + assert!(toml.is_empty()); + } } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/alacritty-0.13.0/alacritty/src/config/ui_config.rs new/alacritty-0.13.1/alacritty/src/config/ui_config.rs --- old/alacritty-0.13.0/alacritty/src/config/ui_config.rs 2023-12-27 22:13:35.000000000 +0100 +++ new/alacritty-0.13.1/alacritty/src/config/ui_config.rs 2024-01-08 16:47:29.000000000 +0100 @@ -1,9 +1,11 @@ use std::cell::RefCell; use std::collections::HashMap; +use std::error::Error; use std::fmt::{self, Formatter}; use std::path::PathBuf; use std::rc::Rc; +use alacritty_config::SerdeReplace; use alacritty_terminal::term::Config as TermConfig; use alacritty_terminal::tty::{Options as PtyOptions, Shell}; use log::{error, warn}; @@ -656,6 +658,14 @@ } } +impl SerdeReplace for Program { + fn replace(&mut self, value: toml::Value) -> Result<(), Box<dyn Error>> { + *self = Self::deserialize(value)?; + + Ok(()) + } +} + pub(crate) struct StringVisitor; impl<'de> serde::de::Visitor<'de> for StringVisitor { type Value = String; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/alacritty-0.13.0/alacritty/src/config/window.rs new/alacritty-0.13.1/alacritty/src/config/window.rs --- old/alacritty-0.13.0/alacritty/src/config/window.rs 2023-12-27 22:13:35.000000000 +0100 +++ new/alacritty-0.13.1/alacritty/src/config/window.rs 2024-01-08 16:47:29.000000000 +0100 @@ -3,10 +3,10 @@ use log::{error, warn}; use serde::de::{self, MapAccess, Visitor}; use serde::{Deserialize, Deserializer, Serialize}; -use winit::window::{Fullscreen, Theme}; #[cfg(target_os = "macos")] use winit::platform::macos::OptionAsAlt as WinitOptionAsAlt; +use winit::window::{Fullscreen, Theme as WinitTheme}; use alacritty_config_derive::{ConfigDeserialize, SerdeReplace}; @@ -31,9 +31,6 @@ #[config(skip)] pub embed: Option<u32>, - /// System decorations theme variant. - pub decorations_theme_variant: Option<Theme>, - /// Spread out additional padding evenly. pub dynamic_padding: bool, @@ -62,6 +59,9 @@ /// Initial dimensions. dimensions: Dimensions, + + /// System decorations theme variant. + decorations_theme_variant: Option<Theme>, } impl Default for WindowConfig { @@ -149,6 +149,10 @@ OptionAsAlt::None => WinitOptionAsAlt::None, } } + + pub fn theme(&self) -> Option<WinitTheme> { + self.decorations_theme_variant.map(WinitTheme::from) + } } #[derive(ConfigDeserialize, Debug, Clone, PartialEq, Eq)] @@ -292,3 +296,19 @@ #[default] None, } + +/// System decorations theme variant. +#[derive(ConfigDeserialize, Debug, Clone, Copy, PartialEq, Eq)] +pub enum Theme { + Light, + Dark, +} + +impl From<Theme> for WinitTheme { + fn from(theme: Theme) -> Self { + match theme { + Theme::Light => WinitTheme::Light, + Theme::Dark => WinitTheme::Dark, + } + } +} diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/alacritty-0.13.0/alacritty/src/display/window.rs new/alacritty-0.13.1/alacritty/src/display/window.rs --- old/alacritty-0.13.0/alacritty/src/display/window.rs 2023-12-27 22:13:35.000000000 +0100 +++ new/alacritty-0.13.1/alacritty/src/display/window.rs 2024-01-08 16:47:29.000000000 +0100 @@ -165,7 +165,7 @@ let window = window_builder .with_title(&identity.title) - .with_theme(config.window.decorations_theme_variant) + .with_theme(config.window.theme()) .with_visible(false) .with_transparent(true) .with_blur(config.window.blur) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/alacritty-0.13.0/alacritty/src/event.rs new/alacritty-0.13.1/alacritty/src/event.rs --- old/alacritty-0.13.0/alacritty/src/event.rs 2023-12-27 22:13:35.000000000 +0100 +++ new/alacritty-0.13.1/alacritty/src/event.rs 2024-01-08 16:47:29.000000000 +0100 @@ -839,13 +839,23 @@ } else { self.on_terminal_input_start(); - // In non-bracketed (ie: normal) mode, terminal applications cannot distinguish - // pasted data from keystrokes. - // In theory, we should construct the keystrokes needed to produce the data we are - // pasting... since that's neither practical nor sensible (and probably an impossible - // task to solve in a general way), we'll just replace line breaks (windows and unix - // style) with a single carriage return (\r, which is what the Enter key produces). - self.write_to_pty(text.replace("\r\n", "\r").replace('\n', "\r").into_bytes()); + let payload = if bracketed { + // In non-bracketed (ie: normal) mode, terminal applications cannot distinguish + // pasted data from keystrokes. + // + // In theory, we should construct the keystrokes needed to produce the data we are + // pasting... since that's neither practical nor sensible (and probably an + // impossible task to solve in a general way), we'll just replace line breaks + // (windows and unix style) with a single carriage return (\r, which is what the + // Enter key produces). + text.replace("\r\n", "\r").replace('\n', "\r").into_bytes() + } else { + // When we explicitly disable bracketed paste don't manipulate with the input, + // so we pass user input as is. + text.to_owned().into_bytes() + }; + + self.write_to_pty(payload); } } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/alacritty-0.13.0/alacritty/src/input/keyboard.rs new/alacritty-0.13.1/alacritty/src/input/keyboard.rs --- old/alacritty-0.13.0/alacritty/src/input/keyboard.rs 2023-12-27 22:13:35.000000000 +0100 +++ new/alacritty-0.13.1/alacritty/src/input/keyboard.rs 2024-01-08 16:47:29.000000000 +0100 @@ -172,7 +172,20 @@ // the time. However what we want is to manually lowercase the character to account // for both small and capital letters on regular characters at the same time. let logical_key = if let Key::Character(ch) = key.logical_key.as_ref() { - Key::Character(ch.to_lowercase().into()) + // Match `Alt` bindings without `Alt` being applied, otherwise they use the + // composed chars, which are not intuitive to bind. + // + // On Windows, the `Ctrl + Alt` mangles `logical_key` to unidentified values, thus + // preventing them from being used in bindings + // + // For more see https://github.com/rust-windowing/winit/issues/2945. + if (cfg!(target_os = "macos") || (cfg!(windows) && mods.control_key())) + && mods.alt_key() + { + key.key_without_modifiers() + } else { + Key::Character(ch.to_lowercase().into()) + } } else { key.logical_key.clone() }; @@ -337,17 +350,25 @@ let character = character.chars().next().unwrap(); let base_character = character.to_lowercase().next().unwrap(); - let codepoint = u32::from(character); - let base_codepoint = u32::from(base_character); + let alternate_key_code = u32::from(character); + let mut unicode_key_code = u32::from(base_character); + + // Try to get the base for keys which change based on modifier, like `1` for `!`. + match key.key_without_modifiers().as_ref() { + Key::Character(unmodded) if alternate_key_code == unicode_key_code => { + unicode_key_code = u32::from(unmodded.chars().next().unwrap_or(base_character)); + }, + _ => (), + } // NOTE: Base layouts are ignored, since winit doesn't expose this information // yet. let payload = if self.mode.contains(TermMode::REPORT_ALTERNATE_KEYS) - && codepoint != base_codepoint + && alternate_key_code != unicode_key_code { - format!("{codepoint}:{base_codepoint}") + format!("{unicode_key_code}:{alternate_key_code}") } else { - codepoint.to_string() + alternate_key_code.to_string() }; Some(SequenceBase::new(payload.into(), SequenceTerminator::Kitty)) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/alacritty-0.13.0/alacritty/src/logging.rs new/alacritty-0.13.1/alacritty/src/logging.rs --- old/alacritty-0.13.0/alacritty/src/logging.rs 2023-12-27 22:13:35.000000000 +0100 +++ new/alacritty-0.13.1/alacritty/src/logging.rs 2024-01-08 16:47:29.000000000 +0100 @@ -8,12 +8,11 @@ use std::io::{self, LineWriter, Stdout, Write}; use std::path::PathBuf; use std::sync::atomic::{AtomicBool, Ordering}; -use std::sync::{Arc, Mutex}; +use std::sync::{Arc, Mutex, OnceLock}; use std::time::Instant; use std::{env, process}; use log::{self, Level, LevelFilter}; -use once_cell::sync::Lazy; use winit::event_loop::EventLoopProxy; use crate::cli::Options; @@ -35,10 +34,14 @@ const ALACRITTY_EXTRA_LOG_TARGETS_ENV: &str = "ALACRITTY_EXTRA_LOG_TARGETS"; /// User configurable extra log targets to include. -static EXTRA_LOG_TARGETS: Lazy<Vec<String>> = Lazy::new(|| { - env::var(ALACRITTY_EXTRA_LOG_TARGETS_ENV) - .map_or(Vec::new(), |targets| targets.split(';').map(ToString::to_string).collect()) -}); +fn extra_log_targets() -> &'static [String] { + static EXTRA_LOG_TARGETS: OnceLock<Vec<String>> = OnceLock::new(); + + EXTRA_LOG_TARGETS.get_or_init(|| { + env::var(ALACRITTY_EXTRA_LOG_TARGETS_ENV) + .map_or(Vec::new(), |targets| targets.split(';').map(ToString::to_string).collect()) + }) +} /// List of targets which will be logged by Alacritty. const ALLOWED_TARGETS: &[&str] = &[ @@ -181,7 +184,7 @@ fn is_allowed_target(level: Level, target: &str) -> bool { match (level, log::max_level()) { (Level::Error, LevelFilter::Trace) | (Level::Warn, LevelFilter::Trace) => true, - _ => ALLOWED_TARGETS.contains(&target) || EXTRA_LOG_TARGETS.iter().any(|t| t == target), + _ => ALLOWED_TARGETS.contains(&target) || extra_log_targets().iter().any(|t| t == target), } } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/alacritty-0.13.0/alacritty/src/migrate.rs new/alacritty-0.13.1/alacritty/src/migrate.rs --- old/alacritty-0.13.0/alacritty/src/migrate.rs 2023-12-27 22:13:35.000000000 +0100 +++ new/alacritty-0.13.1/alacritty/src/migrate.rs 2024-01-08 16:47:29.000000000 +0100 @@ -74,7 +74,7 @@ } // Try to parse the configuration file. - let mut config = match config::deserialize_config(path) { + let mut config = match config::deserialize_config(path, !options.dry_run) { Ok(config) => config, Err(err) => return Err(format!("parsing error: {err}")), }; @@ -96,7 +96,7 @@ if options.dry_run && !options.silent { // Output new content to STDOUT. println!( - "\nv-----Start TOML for {path:?}-----v\n\n{toml}\n^-----End TOML for {path:?}-----^" + "\nv-----Start TOML for {path:?}-----v\n\n{toml}\n^-----End TOML for {path:?}-----^\n" ); } else if !options.dry_run { // Write the new toml configuration. @@ -124,7 +124,23 @@ Ok(import) => import, Err(err) => return Err(format!("import error: {err}")), }; + + // Keep yaml import if path does not exist. + if !import.exists() { + if options.dry_run { + eprintln!("Keeping yaml config for nonexistent import: {import:?}"); + } + new_imports.push(Value::String(import.to_string_lossy().into())); + continue; + } + let new_path = migrate_config(options, &import, recursion_limit - 1)?; + + // Print new import path. + if options.dry_run { + println!("Successfully migrated import {import:?} to {new_path:?}"); + } + new_imports.push(Value::String(new_path)); } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/alacritty-0.13.0/alacritty/src/renderer/mod.rs new/alacritty-0.13.1/alacritty/src/renderer/mod.rs --- old/alacritty-0.13.0/alacritty/src/renderer/mod.rs 2023-12-27 22:13:35.000000000 +0100 +++ new/alacritty-0.13.1/alacritty/src/renderer/mod.rs 2024-01-08 16:47:29.000000000 +0100 @@ -2,6 +2,7 @@ use std::collections::HashSet; use std::ffi::{CStr, CString}; use std::sync::atomic::{AtomicBool, Ordering}; +use std::sync::OnceLock; use std::{fmt, ptr}; use ahash::RandomState; @@ -9,7 +10,6 @@ use glutin::context::{ContextApi, GlContext, PossiblyCurrentContext}; use glutin::display::{GetGlDisplay, GlDisplay}; use log::{debug, error, info, warn, LevelFilter}; -use once_cell::sync::OnceCell; use unicode_width::UnicodeWidthChar; use alacritty_terminal::index::Point; @@ -318,7 +318,7 @@ /// /// This function will lazily load OpenGL extensions. fn contains(extension: &str) -> bool { - static OPENGL_EXTENSIONS: OnceCell<HashSet<&'static str, RandomState>> = OnceCell::new(); + static OPENGL_EXTENSIONS: OnceLock<HashSet<&'static str, RandomState>> = OnceLock::new(); OPENGL_EXTENSIONS.get_or_init(Self::load_extensions).contains(extension) } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/alacritty-0.13.0/alacritty/src/renderer/text/builtin_font.rs new/alacritty-0.13.1/alacritty/src/renderer/text/builtin_font.rs --- old/alacritty-0.13.0/alacritty/src/renderer/text/builtin_font.rs 2023-12-27 22:13:35.000000000 +0100 +++ new/alacritty-0.13.1/alacritty/src/renderer/text/builtin_font.rs 2024-01-08 16:47:29.000000000 +0100 @@ -32,7 +32,7 @@ '\u{2500}'..='\u{259f}' => box_drawing(character, metrics, offset), // Powerline symbols: 'î°','î±','î²','î³' POWERLINE_TRIANGLE_LTR..=POWERLINE_ARROW_RTL => { - powerline_drawing(character, metrics, offset) + powerline_drawing(character, metrics, offset)? }, _ => return None, }; @@ -503,7 +503,11 @@ } } -fn powerline_drawing(character: char, metrics: &Metrics, offset: &Delta<i8>) -> RasterizedGlyph { +fn powerline_drawing( + character: char, + metrics: &Metrics, + offset: &Delta<i8>, +) -> Option<RasterizedGlyph> { let height = (metrics.line_height as i32 + offset.y as i32) as usize; let width = (metrics.average_advance as i32 + offset.x as i32) as usize; let extra_thickness = calculate_stroke_size(width) as i32 - 1; @@ -519,6 +523,12 @@ // x = (H - 2) / (2 * slope). let x_intersection = (height as i32 + 1) / 2 - 1; + // Don't use built-in font if we'd cut the tip too much, for example when the font is really + // narrow. + if x_intersection - width as i32 > 1 { + return None; + } + let top_line = (0..x_intersection).map(|x| line_equation(slope, x, top_y)); let bottom_line = (0..x_intersection).map(|x| line_equation(-slope, x, bottom_y)); @@ -555,7 +565,7 @@ let top = height as i32 + metrics.descent as i32; let buffer = BitmapBuffer::Rgb(canvas.into_raw()); - RasterizedGlyph { + Some(RasterizedGlyph { character, top, left: 0, @@ -563,7 +573,7 @@ width: width as i32, buffer, advance: (width as i32, height as i32), - } + }) } #[repr(packed)] diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/alacritty-0.13.0/alacritty/src/window_context.rs new/alacritty-0.13.1/alacritty/src/window_context.rs --- old/alacritty-0.13.0/alacritty/src/window_context.rs 2023-12-27 22:13:35.000000000 +0100 +++ new/alacritty-0.13.1/alacritty/src/window_context.rs 2024-01-08 16:47:29.000000000 +0100 @@ -289,7 +289,7 @@ } // Always reload the theme to account for auto-theme switching. - self.display.window.set_theme(self.config.window.decorations_theme_variant); + self.display.window.set_theme(self.config.window.theme()); // Update display if either padding options or resize increments were changed. let window_config = &old_config.window; @@ -560,6 +560,6 @@ impl Drop for WindowContext { fn drop(&mut self) { // Shutdown the terminal's PTY. - self.notifier.0.send(Msg::Shutdown); + let _ = self.notifier.0.send(Msg::Shutdown); } } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/alacritty-0.13.0/alacritty/windows/wix/alacritty.wxs new/alacritty-0.13.1/alacritty/windows/wix/alacritty.wxs --- old/alacritty-0.13.0/alacritty/windows/wix/alacritty.wxs 2023-12-27 22:13:35.000000000 +0100 +++ new/alacritty-0.13.1/alacritty/windows/wix/alacritty.wxs 2024-01-08 16:47:29.000000000 +0100 @@ -1,5 +1,5 @@ <Wix xmlns="http://wixtoolset.org/schemas/v4/wxs" xmlns:ui="http://wixtoolset.org/schemas/v4/wxs/ui"> - <Package Name="Alacritty" UpgradeCode="87c21c74-dbd5-4584-89d5-46d9cd0c40a7" Language="1033" Codepage="1252" Version="0.13.0" Manufacturer="Alacritty" InstallerVersion="200"> + <Package Name="Alacritty" UpgradeCode="87c21c74-dbd5-4584-89d5-46d9cd0c40a7" Language="1033" Codepage="1252" Version="0.13.1" Manufacturer="Alacritty" InstallerVersion="200"> <MajorUpgrade AllowSameVersionUpgrades="yes" DowngradeErrorMessage="A newer version of [ProductName] is already installed." /> <Icon Id="AlacrittyIco" SourceFile=".\alacritty\windows\alacritty.ico" /> <WixVariable Id="WixUILicenseRtf" Value=".\alacritty\windows\wix\license.rtf" /> diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/alacritty-0.13.0/alacritty_config/Cargo.toml new/alacritty-0.13.1/alacritty_config/Cargo.toml --- old/alacritty-0.13.0/alacritty_config/Cargo.toml 2023-12-27 22:13:35.000000000 +0100 +++ new/alacritty-0.13.1/alacritty_config/Cargo.toml 2024-01-08 16:47:29.000000000 +0100 @@ -1,6 +1,6 @@ [package] name = "alacritty_config" -version = "0.1.2" +version = "0.2.0" authors = ["Christian Duerr <cont...@christianduerr.com>"] license = "MIT OR Apache-2.0" description = "Alacritty configuration abstractions" @@ -12,3 +12,7 @@ log = { version = "0.4.17", features = ["serde"] } serde = "1.0.163" toml = "0.8.2" + +[dev-dependencies] +alacritty_config_derive = { path = "../alacritty_config_derive" } +serde = { version = "1.0.163", features = ["derive"] } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/alacritty-0.13.0/alacritty_config/src/lib.rs new/alacritty-0.13.1/alacritty_config/src/lib.rs --- old/alacritty-0.13.0/alacritty_config/src/lib.rs 2023-12-27 22:13:35.000000000 +0100 +++ new/alacritty-0.13.1/alacritty_config/src/lib.rs 2024-01-08 16:47:29.000000000 +0100 @@ -1,5 +1,6 @@ use std::collections::HashMap; use std::error::Error; +use std::path::PathBuf; use log::LevelFilter; use serde::Deserialize; @@ -9,6 +10,7 @@ fn replace(&mut self, value: Value) -> Result<(), Box<dyn Error>>; } +#[macro_export] macro_rules! impl_replace { ($($ty:ty),*$(,)*) => { $( @@ -29,6 +31,7 @@ bool, char, String, + PathBuf, LevelFilter, ); @@ -47,9 +50,12 @@ } } -impl<'de, T: Deserialize<'de>> SerdeReplace for Option<T> { +impl<'de, T: SerdeReplace + Deserialize<'de>> SerdeReplace for Option<T> { fn replace(&mut self, value: Value) -> Result<(), Box<dyn Error>> { - replace_simple(self, value) + match self { + Some(inner) => inner.replace(value), + None => replace_simple(self, value), + } } } @@ -58,3 +64,30 @@ replace_simple(self, value) } } + +#[cfg(test)] +mod tests { + use super::*; + + use crate as alacritty_config; + use alacritty_config_derive::ConfigDeserialize; + + #[test] + fn replace_option() { + #[derive(ConfigDeserialize, Default, PartialEq, Eq, Debug)] + struct ReplaceOption { + a: usize, + b: usize, + } + + let mut subject: Option<ReplaceOption> = None; + + let value: Value = toml::from_str("a=1").unwrap(); + SerdeReplace::replace(&mut subject, value).unwrap(); + + let value: Value = toml::from_str("b=2").unwrap(); + SerdeReplace::replace(&mut subject, value).unwrap(); + + assert_eq!(subject, Some(ReplaceOption { a: 1, b: 2 })); + } +} diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/alacritty-0.13.0/alacritty_config_derive/Cargo.toml new/alacritty-0.13.1/alacritty_config_derive/Cargo.toml --- old/alacritty-0.13.0/alacritty_config_derive/Cargo.toml 2023-12-27 22:13:35.000000000 +0100 +++ new/alacritty-0.13.1/alacritty_config_derive/Cargo.toml 2024-01-08 16:47:29.000000000 +0100 @@ -18,7 +18,7 @@ [dev-dependencies.alacritty_config] path = "../alacritty_config" -version = "0.1.2" +version = "0.2.0" [dev-dependencies] log = "0.4.11" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/alacritty-0.13.0/alacritty_terminal/Cargo.toml new/alacritty-0.13.1/alacritty_terminal/Cargo.toml --- old/alacritty-0.13.0/alacritty_terminal/Cargo.toml 2023-12-27 22:13:35.000000000 +0100 +++ new/alacritty-0.13.1/alacritty_terminal/Cargo.toml 2024-01-08 16:47:29.000000000 +0100 @@ -1,6 +1,6 @@ [package] name = "alacritty_terminal" -version = "0.20.0" +version = "0.21.0" authors = ["Christian Duerr <cont...@christianduerr.com>", "Joe Wilm <j...@jwilm.com>"] license = "Apache-2.0" description = "Library for writing terminal emulators" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/alacritty-0.13.0/alacritty_terminal/src/event_loop.rs new/alacritty-0.13.1/alacritty_terminal/src/event_loop.rs --- old/alacritty-0.13.0/alacritty_terminal/src/event_loop.rs 2023-12-27 22:13:35.000000000 +0100 +++ new/alacritty-0.13.1/alacritty_terminal/src/event_loop.rs 2024-01-08 16:47:29.000000000 +0100 @@ -2,6 +2,7 @@ use std::borrow::Cow; use std::collections::VecDeque; +use std::fmt::{self, Display, Formatter}; use std::fs::File; use std::io::{self, ErrorKind, Read, Write}; use std::marker::Send; @@ -339,25 +340,53 @@ return; } - self.0.send(Msg::Input(bytes)); + let _ = self.0.send(Msg::Input(bytes)); } } impl event::OnResize for Notifier { fn on_resize(&mut self, window_size: WindowSize) { - self.0.send(Msg::Resize(window_size)); + let _ = self.0.send(Msg::Resize(window_size)); } } +#[derive(Debug)] +pub enum EventLoopSendError { + /// Error polling the event loop. + Io(io::Error), + + /// Error sending a message to the event loop. + Send(mpsc::SendError<Msg>), +} + +impl Display for EventLoopSendError { + fn fmt(&self, f: &mut Formatter<'_>) -> fmt::Result { + match self { + EventLoopSendError::Io(err) => err.fmt(f), + EventLoopSendError::Send(err) => err.fmt(f), + } + } +} + +impl std::error::Error for EventLoopSendError { + fn source(&self) -> Option<&(dyn std::error::Error + 'static)> { + match self { + EventLoopSendError::Io(err) => err.source(), + EventLoopSendError::Send(err) => err.source(), + } + } +} + +#[derive(Clone)] pub struct EventLoopSender { sender: Sender<Msg>, poller: Arc<polling::Poller>, } impl EventLoopSender { - pub fn send(&self, msg: Msg) { - let _ = self.sender.send(msg); - let _ = self.poller.notify(); + pub fn send(&self, msg: Msg) -> Result<(), EventLoopSendError> { + self.sender.send(msg).map_err(EventLoopSendError::Send)?; + self.poller.notify().map_err(EventLoopSendError::Io) } } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/alacritty-0.13.0/alacritty_terminal/src/term/mod.rs new/alacritty-0.13.1/alacritty_terminal/src/term/mod.rs --- old/alacritty-0.13.0/alacritty_terminal/src/term/mod.rs 2023-12-27 22:13:35.000000000 +0100 +++ new/alacritty-0.13.1/alacritty_terminal/src/term/mod.rs 2024-01-08 16:47:29.000000000 +0100 @@ -2710,6 +2710,7 @@ /// This test is in the term module as opposed to the grid since we want to /// test this property with a T=Cell. #[test] + #[cfg(feature = "serde")] fn grid_serde() { let grid: Grid<Cell> = Grid::new(24, 80, 0); let serialized = serde_json::to_string(&grid).expect("ser"); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/alacritty-0.13.0/alacritty_terminal/tests/ref.rs new/alacritty-0.13.1/alacritty_terminal/tests/ref.rs --- old/alacritty-0.13.0/alacritty_terminal/tests/ref.rs 2023-12-27 22:13:35.000000000 +0100 +++ new/alacritty-0.13.1/alacritty_terminal/tests/ref.rs 2024-01-08 16:47:29.000000000 +0100 @@ -1,3 +1,4 @@ +#![cfg(feature = "serde")] use serde::Deserialize; use serde_json as json; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/alacritty-0.13.0/extra/man/alacritty-bindings.5.scd new/alacritty-0.13.1/extra/man/alacritty-bindings.5.scd --- old/alacritty-0.13.0/extra/man/alacritty-bindings.5.scd 2023-12-27 22:13:35.000000000 +0100 +++ new/alacritty-0.13.1/extra/man/alacritty-bindings.5.scd 2024-01-08 16:47:29.000000000 +0100 @@ -42,6 +42,10 @@ : _"Control"_ :[ : _"ClearLogNotice"_ +| _"Paste"_ +:[ +: _"Vi|Search"_ +: _"Paste"_ | _"L"_ : _"Control"_ : _"~Vi|~Search"_ @@ -344,6 +348,10 @@ : _"Control|Shift"_ : _"~Vi"_ : _"Paste"_ +| _"V"_ +: _"Control|Shift"_ +: _"Vi|Search"_ +: _"Paste"_ | _"C"_ : _"Control|Shift"_ :[ @@ -440,7 +448,11 @@ : _"DecreaseFontSize"_ | _"V"_ : _"Command"_ -:[ +: _"~Vi"_ +: _"Paste"_ +| _"V"_ +: _"Command"_ +: _"Vi|Search"_ : _"Paste"_ | _"C"_ : _"Command"_ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/alacritty-0.13.0/extra/man/alacritty.5.scd new/alacritty-0.13.1/extra/man/alacritty.5.scd --- old/alacritty-0.13.0/extra/man/alacritty.5.scd 2023-12-27 22:13:35.000000000 +0100 +++ new/alacritty-0.13.1/extra/man/alacritty.5.scd 2024-01-08 16:47:29.000000000 +0100 @@ -129,7 +129,7 @@ *opacity* = _<float>_ Background opacity as a floating point number from _0.0_ to _1.0_. The value - \_0.0_ is completely transparent and _1.0_ is opaque. + _0.0_ is completely transparent and _1.0_ is opaque. Default: _1.0_ @@ -143,6 +143,15 @@ Startup mode (changes require restart) + *Windowed* + Regular window. + *Maximized* + The window will be maximized on startup. + *Fullscreen* + The window will be fullscreened on startup. + *SimpleFullscreen* _(macOS only)_ + Same as _Fullscreen_, but you can stack windows on top. + Default: _"Windowed"_ *title* = _"<string>"_ @@ -510,7 +519,7 @@ This string contains all characters that are used as separators for "semantic words" in Alacritty. - Default: _",â`|:\"' ()[]{}<>\t"_ + Default: _",â`|:\\"' ()[]{}<>\\t"_ *save_to_clipboard* = _true_ | _false_ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/alacritty-0.13.0/extra/osx/Alacritty.app/Contents/Info.plist new/alacritty-0.13.1/extra/osx/Alacritty.app/Contents/Info.plist --- old/alacritty-0.13.0/extra/osx/Alacritty.app/Contents/Info.plist 2023-12-27 22:13:35.000000000 +0100 +++ new/alacritty-0.13.1/extra/osx/Alacritty.app/Contents/Info.plist 2024-01-08 16:47:29.000000000 +0100 @@ -15,7 +15,7 @@ <key>CFBundlePackageType</key> <string>APPL</string> <key>CFBundleShortVersionString</key> - <string>0.13.0</string> + <string>0.13.1</string> <key>CFBundleSupportedPlatforms</key> <array> <string>MacOSX</string> ++++++ alacritty.obsinfo ++++++ name: alacritty version: 0.13.1 mtime: 1704728849 commit: fe2a3c566759c9926150181006bd56cb2293ae10 ++++++ vendor.tar.xz ++++++ /work/SRC/openSUSE:Factory/alacritty/vendor.tar.xz /work/SRC/openSUSE:Factory/.alacritty.new.21961/vendor.tar.xz differ: char 15, line 1