diff options
| author | Ayose <ayosec@gmail.com> | 2024-10-24 00:00:00 +0000 |
|---|---|---|
| committer | Ayose <ayosec@gmail.com> | 2024-10-24 00:00:00 +0000 |
| commit | 8ec6c966658c140fb6fc2b3c4b32a099edf34a39 (patch) | |
| tree | e164f7f0bb3eb7931d5cd9e2fec847e706c70312 | |
| parent | c7213774e81dd6012035c5312374db8480ccabc2 (diff) | |
| parent | 22a447573bbd67c0a5d3946d58d6d61bac3b4ad2 (diff) | |
| download | r-alacritty-8ec6c966658c140fb6fc2b3c4b32a099edf34a39.tar.gz r-alacritty-8ec6c966658c140fb6fc2b3c4b32a099edf34a39.tar.bz2 r-alacritty-8ec6c966658c140fb6fc2b3c4b32a099edf34a39.zip | |
Merge remote-tracking branch 'vendor/v0.14' into graphics
| -rw-r--r-- | CHANGELOG.md | 7 | ||||
| -rw-r--r-- | Cargo.lock | 22 | ||||
| -rw-r--r-- | alacritty/Cargo.toml | 10 | ||||
| -rw-r--r-- | alacritty/src/cli.rs | 6 | ||||
| -rw-r--r-- | alacritty/src/display/content.rs | 27 | ||||
| -rw-r--r-- | alacritty/src/display/cursor.rs | 4 | ||||
| -rw-r--r-- | alacritty/src/display/mod.rs | 51 | ||||
| -rw-r--r-- | alacritty/src/event.rs | 76 | ||||
| -rw-r--r-- | alacritty/src/input/keyboard.rs | 15 | ||||
| -rw-r--r-- | alacritty/src/input/mod.rs | 1 | ||||
| -rw-r--r-- | alacritty/src/ipc.rs | 9 | ||||
| -rw-r--r-- | alacritty/src/migrate/mod.rs | 1 | ||||
| -rw-r--r-- | alacritty/src/window_context.rs | 17 | ||||
| -rw-r--r-- | alacritty/windows/wix/alacritty.wxs | 2 | ||||
| -rw-r--r-- | alacritty_config/Cargo.toml | 4 | ||||
| -rw-r--r-- | alacritty_config_derive/Cargo.toml | 4 | ||||
| -rw-r--r-- | alacritty_terminal/CHANGELOG.md | 14 | ||||
| -rw-r--r-- | alacritty_terminal/Cargo.toml | 4 | ||||
| -rw-r--r-- | extra/completions/_alacritty | 3 | ||||
| -rw-r--r-- | extra/completions/alacritty.bash | 2 | ||||
| -rw-r--r-- | extra/completions/alacritty.fish | 3 | ||||
| -rw-r--r-- | extra/man/alacritty.1.scd | 4 | ||||
| -rw-r--r-- | extra/osx/Alacritty.app/Contents/Info.plist | 2 |
23 files changed, 176 insertions, 112 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md index ca900247..2b3d2b46 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,7 +8,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). Notable changes to the `alacritty_terminal` crate are documented in its [CHANGELOG](./alacritty_terminal/CHANGELOG.md). -## 0.14.0-dev +## 0.14.0 ### Packaging @@ -18,7 +18,7 @@ Notable changes to the `alacritty_terminal` crate are documented in its - Support relative path imports from config files - `alacritty migrate` support for TOML configuration changes -- Support for Unicode 16 characters +- Headless mode using `alacritty --daemon` ### Changed @@ -29,6 +29,7 @@ Notable changes to the `alacritty_terminal` crate are documented in its to the new `general` section - Moved config option `shell` to `terminal.shell` - `ctrl+shift+u` binding to open links to `ctrl+shift+o` to avoid collisions with IMEs +- Use `Beam` cursor for single char cursor inside the IME preview ### Fixed @@ -48,6 +49,8 @@ Notable changes to the `alacritty_terminal` crate are documented in its - Windows app icon now displays properly in old alt+tab on Windows - Alacritty not being properly activated with startup notify - Invalid URL highlights after terminal scrolling +- Hollow block cursor not spanning multiple chars being edited inside the IME preview +- Vi inline search only working for direct key input without modifiers ## 0.13.2 @@ -32,7 +32,7 @@ dependencies = [ [[package]] name = "alacritty" -version = "0.14.0-dev" +version = "0.14.0" dependencies = [ "ahash", "alacritty_config", @@ -63,7 +63,7 @@ dependencies = [ "tempfile", "toml", "toml_edit 0.22.21", - "unicode-width-16", + "unicode-width", "windows-sys 0.52.0", "winit", "xdg", @@ -71,7 +71,7 @@ dependencies = [ [[package]] name = "alacritty_config" -version = "0.2.1-dev" +version = "0.2.2" dependencies = [ "alacritty_config_derive", "log", @@ -81,7 +81,7 @@ dependencies = [ [[package]] name = "alacritty_config_derive" -version = "0.2.3-dev" +version = "0.2.4" dependencies = [ "alacritty_config", "log", @@ -94,7 +94,7 @@ dependencies = [ [[package]] name = "alacritty_terminal" -version = "0.24.1-dev" +version = "0.24.1" dependencies = [ "base64", "bitflags 2.6.0", @@ -111,7 +111,7 @@ dependencies = [ "serde_json", "signal-hook", "smallvec", - "unicode-width-16", + "unicode-width", "vte-graphics", "windows-sys 0.52.0", ] @@ -2026,10 +2026,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d4c87d22b6e3f4a18d4d40ef354e97c90fcb14dd91d7dc0aa9d8a1172ebf7202" [[package]] -name = "unicode-width-16" -version = "0.1.0" +name = "unicode-width" +version = "0.1.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9eba15036aa0f5bf8ed6cd12a624ddb61fd50b0779b1c05d89b663bcaed7b5c2" +checksum = "0336d538f7abc86d282a4189614dfaa90810dfc2c6f6427eaf88e16311dd225d" [[package]] name = "unsafe-libyaml" @@ -2641,9 +2641,9 @@ dependencies = [ [[package]] name = "x11-clipboard" -version = "0.9.2" +version = "0.9.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b98785a09322d7446e28a13203d2cae1059a0dd3dfb32cb06d0a225f023d8286" +checksum = "662d74b3d77e396b8e5beb00b9cad6a9eccf40b2ef68cc858784b14c41d535a3" dependencies = [ "libc", "x11rb", diff --git a/alacritty/Cargo.toml b/alacritty/Cargo.toml index f43fdab0..453ac70c 100644 --- a/alacritty/Cargo.toml +++ b/alacritty/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "alacritty" -version = "0.14.0-dev" +version = "0.14.0" authors = ["Christian Duerr <contact@christianduerr.com>", "Joe Wilm <joe@jwilm.com>"] license = "Apache-2.0" description = "A fast, cross-platform, OpenGL terminal emulator" @@ -12,15 +12,15 @@ rust-version = "1.74.0" [dependencies.alacritty_terminal] path = "../alacritty_terminal" -version = "0.24.1-dev" +version = "0.24.1" [dependencies.alacritty_config_derive] path = "../alacritty_config_derive" -version = "0.2.3-dev" +version = "0.2.4" [dependencies.alacritty_config] path = "../alacritty_config" -version = "0.2.1-dev" +version = "0.2.2" [dependencies] ahash = { version = "0.8.6", features = ["no-rng"] } @@ -42,7 +42,7 @@ smallvec = { version = "1.13.1", features = ["serde"] } tempfile = "3.12.0" toml = "0.8.2" toml_edit = "0.22.21" -unicode-width = { package = "unicode-width-16", version = "0.1.0" } +unicode-width = "0.1" winit = { version = "0.30.4", default-features = false, features = ["rwh_06", "serde"] } [build-dependencies] diff --git a/alacritty/src/cli.rs b/alacritty/src/cli.rs index 2b4afa02..bb0a24f4 100644 --- a/alacritty/src/cli.rs +++ b/alacritty/src/cli.rs @@ -26,7 +26,7 @@ pub struct Options { pub print_events: bool, /// Generates ref test. - #[clap(long)] + #[clap(long, conflicts_with("daemon"))] pub ref_test: bool, /// X11 window ID to embed Alacritty within (decimal or hexadecimal with "0x" prefix). @@ -62,6 +62,10 @@ pub struct Options { #[clap(short, conflicts_with("quiet"), action = ArgAction::Count)] verbose: u8, + /// Do not spawn an initial window. + #[clap(long)] + pub daemon: bool, + /// CLI options for config overrides. #[clap(skip)] pub config_options: ParsedOptions, diff --git a/alacritty/src/display/content.rs b/alacritty/src/display/content.rs index aad25b10..02ac50e3 100644 --- a/alacritty/src/display/content.rs +++ b/alacritty/src/display/content.rs @@ -1,4 +1,5 @@ use std::borrow::Cow; +use std::num::NonZeroU32; use std::ops::Deref; use std::{cmp, mem}; @@ -137,8 +138,13 @@ impl<'a> RenderableContent<'a> { text_color = self.config.colors.primary.background; } + let width = if cell.flags.contains(Flags::WIDE_CHAR) { + NonZeroU32::new(2).unwrap() + } else { + NonZeroU32::new(1).unwrap() + }; RenderableCursor { - is_wide: cell.flags.contains(Flags::WIDE_CHAR), + width, shape: self.cursor_shape, point: self.cursor_point, cursor_color, @@ -425,7 +431,7 @@ pub struct RenderableCursor { shape: CursorShape, cursor_color: Rgb, text_color: Rgb, - is_wide: bool, + width: NonZeroU32, point: Point<usize>, } @@ -434,15 +440,20 @@ impl RenderableCursor { let shape = CursorShape::Hidden; let cursor_color = Rgb::default(); let text_color = Rgb::default(); - let is_wide = false; + let width = NonZeroU32::new(1).unwrap(); let point = Point::default(); - Self { shape, cursor_color, text_color, is_wide, point } + Self { shape, cursor_color, text_color, width, point } } } impl RenderableCursor { - pub fn new(point: Point<usize>, shape: CursorShape, cursor_color: Rgb, is_wide: bool) -> Self { - Self { shape, cursor_color, text_color: cursor_color, is_wide, point } + pub fn new( + point: Point<usize>, + shape: CursorShape, + cursor_color: Rgb, + width: NonZeroU32, + ) -> Self { + Self { shape, cursor_color, text_color: cursor_color, width, point } } pub fn color(&self) -> Rgb { @@ -453,8 +464,8 @@ impl RenderableCursor { self.shape } - pub fn is_wide(&self) -> bool { - self.is_wide + pub fn width(&self) -> NonZeroU32 { + self.width } pub fn point(&self) -> Point<usize> { diff --git a/alacritty/src/display/cursor.rs b/alacritty/src/display/cursor.rs index 65933ccc..b0e2d6c3 100644 --- a/alacritty/src/display/cursor.rs +++ b/alacritty/src/display/cursor.rs @@ -24,9 +24,7 @@ impl IntoRects for RenderableCursor { let thickness = (thickness * width).round().max(1.); - if self.is_wide() { - width *= 2.; - } + width *= self.width().get() as f32; match self.shape() { CursorShape::Beam => beam(x, y, height, thickness, self.color()), diff --git a/alacritty/src/display/mod.rs b/alacritty/src/display/mod.rs index 76f0eba2..17ab461c 100644 --- a/alacritty/src/display/mod.rs +++ b/alacritty/src/display/mod.rs @@ -899,7 +899,9 @@ impl Display { if self.ime.preedit().is_none() { let fg = config.colors.footer_bar_foreground(); let shape = CursorShape::Underline; - let cursor = RenderableCursor::new(Point::new(line, column), shape, fg, false); + let cursor_width = NonZeroU32::new(1).unwrap(); + let cursor = + RenderableCursor::new(Point::new(line, column), shape, fg, cursor_width); rects.extend(cursor.rects(&size_info, config.cursor.thickness())); } @@ -907,8 +909,11 @@ impl Display { }, None => { let num_lines = self.size_info.screen_lines(); - term::point_to_viewport(display_offset, cursor_point) - .filter(|point| point.line < num_lines) + match vi_cursor_viewport_point { + None => term::point_to_viewport(display_offset, cursor_point) + .filter(|point| point.line < num_lines), + point => point, + } }, }; @@ -1106,8 +1111,8 @@ impl Display { // Get the visible preedit. let visible_text: String = match (preedit.cursor_byte_offset, preedit.cursor_end_offset) { - (Some(byte_offset), Some(end_offset)) if end_offset > num_cols => StrShortener::new( - &preedit.text[byte_offset..], + (Some(byte_offset), Some(end_offset)) if end_offset.0 > num_cols => StrShortener::new( + &preedit.text[byte_offset.0..], num_cols, ShortenDirection::Right, Some(SHORTENER), @@ -1150,19 +1155,21 @@ impl Display { rects.extend(underline.rects(Flags::UNDERLINE, &metrics, &self.size_info)); let ime_popup_point = match preedit.cursor_end_offset { - Some(cursor_end_offset) if cursor_end_offset != 0 => { - let is_wide = preedit.text[preedit.cursor_byte_offset.unwrap_or_default()..] - .chars() - .next() - .map(|ch| ch.width() == Some(2)) - .unwrap_or_default(); + Some(cursor_end_offset) => { + // Use hollow block when multiple characters are changed at once. + let (shape, width) = if let Some(width) = + NonZeroU32::new((cursor_end_offset.0 - cursor_end_offset.1) as u32) + { + (CursorShape::HollowBlock, width) + } else { + (CursorShape::Beam, NonZeroU32::new(1).unwrap()) + }; let cursor_column = Column( - (end.column.0 as isize - cursor_end_offset as isize + 1).max(0) as usize, + (end.column.0 as isize - cursor_end_offset.0 as isize + 1).max(0) as usize, ); let cursor_point = Point::new(point.line, cursor_column); - let cursor = - RenderableCursor::new(cursor_point, CursorShape::HollowBlock, fg, is_wide); + let cursor = RenderableCursor::new(cursor_point, shape, fg, width); rects.extend(cursor.rects(&self.size_info, config.cursor.thickness())); cursor_point }, @@ -1461,20 +1468,22 @@ pub struct Preedit { /// Byte offset for cursor start into the preedit text. /// /// `None` means that the cursor is invisible. - cursor_byte_offset: Option<usize>, + cursor_byte_offset: Option<(usize, usize)>, - /// The cursor offset from the end of the preedit in char width. - cursor_end_offset: Option<usize>, + /// The cursor offset from the end of the start of the preedit in char width. + cursor_end_offset: Option<(usize, usize)>, } impl Preedit { - pub fn new(text: String, cursor_byte_offset: Option<usize>) -> Self { + pub fn new(text: String, cursor_byte_offset: Option<(usize, usize)>) -> Self { let cursor_end_offset = if let Some(byte_offset) = cursor_byte_offset { // Convert byte offset into char offset. - let cursor_end_offset = - text[byte_offset..].chars().fold(0, |acc, ch| acc + ch.width().unwrap_or(1)); + let start_to_end_offset = + text[byte_offset.0..].chars().fold(0, |acc, ch| acc + ch.width().unwrap_or(1)); + let end_to_end_offset = + text[byte_offset.1..].chars().fold(0, |acc, ch| acc + ch.width().unwrap_or(1)); - Some(cursor_end_offset) + Some((start_to_end_offset, end_to_end_offset)) } else { None }; diff --git a/alacritty/src/event.rs b/alacritty/src/event.rs index b4600ae3..f0159060 100644 --- a/alacritty/src/event.rs +++ b/alacritty/src/event.rs @@ -1,6 +1,7 @@ //! Process window events. use crate::ConfigMonitor; +use glutin::config::GetGlConfig; use std::borrow::Cow; use std::cmp::min; use std::collections::{HashMap, HashSet, VecDeque}; @@ -16,7 +17,8 @@ use std::{env, f32, mem}; use ahash::RandomState; use crossfont::Size as FontSize; -use glutin::display::{Display as GlutinDisplay, GetGlDisplay}; +use glutin::config::Config as GlutinConfig; +use glutin::display::GetGlDisplay; use log::{debug, error, info, warn}; use winit::application::ApplicationHandler; use winit::event::{ @@ -80,7 +82,7 @@ pub struct Processor { initial_window_error: Option<Box<dyn Error>>, windows: HashMap<WindowId, WindowContext, RandomState>, proxy: EventLoopProxy<Event>, - gl_display: Option<GlutinDisplay>, + gl_config: Option<GlutinConfig>, #[cfg(unix)] global_ipc_options: ParsedOptions, cli_options: CliOptions, @@ -121,7 +123,7 @@ impl Processor { cli_options, proxy, scheduler, - gl_display: None, + gl_config: None, config: Rc::new(config), clipboard, windows: Default::default(), @@ -138,12 +140,16 @@ impl Processor { pub fn create_initial_window( &mut self, event_loop: &ActiveEventLoop, - options: WindowOptions, ) -> Result<(), Box<dyn Error>> { + let options = match self.initial_window_options.take() { + Some(options) => options, + None => return Ok(()), + }; + let window_context = WindowContext::initial(event_loop, self.proxy.clone(), self.config.clone(), options)?; - self.gl_display = Some(window_context.display.gl_context().display()); + self.gl_config = Some(window_context.display.gl_context().config()); self.windows.insert(window_context.id(), window_context); Ok(()) @@ -155,7 +161,7 @@ impl Processor { event_loop: &ActiveEventLoop, options: WindowOptions, ) -> Result<(), Box<dyn Error>> { - let window = self.windows.iter().next().as_ref().unwrap().1; + let gl_config = self.gl_config.as_ref().unwrap(); // Override config with CLI/IPC options. let mut config_overrides = options.config_overrides(); @@ -164,9 +170,14 @@ impl Processor { let mut config = self.config.clone(); config = config_overrides.override_config_rc(config); - #[allow(unused_mut)] - let mut window_context = - window.additional(event_loop, self.proxy.clone(), config, options, config_overrides)?; + let window_context = WindowContext::additional( + gl_config, + event_loop, + self.proxy.clone(), + config, + options, + config_overrides, + )?; self.windows.insert(window_context.id(), window_context); Ok(()) @@ -210,16 +221,11 @@ impl ApplicationHandler<Event> for Processor { fn resumed(&mut self, _event_loop: &ActiveEventLoop) {} fn new_events(&mut self, event_loop: &ActiveEventLoop, cause: StartCause) { - if cause != StartCause::Init { + if cause != StartCause::Init || self.cli_options.daemon { return; } - let initial_window_options = match self.initial_window_options.take() { - Some(initial_window_options) => initial_window_options, - None => return, - }; - - if let Err(err) = self.create_initial_window(event_loop, initial_window_options) { + if let Err(err) = self.create_initial_window(event_loop) { self.initial_window_error = Some(err); event_loop.exit(); return; @@ -338,7 +344,13 @@ impl ApplicationHandler<Event> for Processor { window_context.display.make_not_current(); } - if let Err(err) = self.create_window(event_loop, options.clone()) { + if self.gl_config.is_none() { + // Handle initial window creation in daemon mode. + if let Err(err) = self.create_initial_window(event_loop) { + self.initial_window_error = Some(err); + event_loop.exit(); + } + } else if let Err(err) = self.create_window(event_loop, options.clone()) { error!("Could not open window: {:?}", err); } }, @@ -375,7 +387,7 @@ impl ApplicationHandler<Event> for Processor { self.scheduler.unschedule_window(window_context.id()); // Shutdown if no more terminals are open. - if self.windows.is_empty() { + if self.windows.is_empty() && !self.cli_options.daemon { // Write ref tests of last window to disk. if self.config.debug.ref_test { window_context.write_ref_test_results(); @@ -439,7 +451,7 @@ impl ApplicationHandler<Event> for Processor { info!("Exiting the event loop"); } - match self.gl_display.take() { + match self.gl_config.take().map(|config| config.display()) { #[cfg(not(target_os = "macos"))] Some(glutin::display::Display::Egl(display)) => { // Ensure that all the windows are dropped, so the destructors for @@ -1218,6 +1230,8 @@ impl<'a, N: Notify + 'a, T: EventListener> input::ActionContext<T> for ActionCon for c in text.chars() { self.search_input(c); } + } else if self.inline_search_state.char_pending { + self.inline_search_input(text); } else if bracketed && self.terminal().mode().contains(TermMode::BRACKETED_PASTE) { self.on_terminal_input_start(); @@ -1291,6 +1305,7 @@ impl<'a, N: Notify + 'a, T: EventListener> input::ActionContext<T> for ActionCon self.inline_search_state.stop_short = stop_short; self.inline_search_state.direction = direction; self.inline_search_state.char_pending = true; + self.inline_search_state.character = None; } /// Jump to the next matching character in the line. @@ -1305,6 +1320,22 @@ impl<'a, N: Notify + 'a, T: EventListener> input::ActionContext<T> for ActionCon self.inline_search(direction); } + /// Process input during inline search. + fn inline_search_input(&mut self, text: &str) { + // Ignore input with empty text, like modifier keys. + let c = match text.chars().next() { + Some(c) => c, + None => return, + }; + + self.inline_search_state.char_pending = false; + self.inline_search_state.character = Some(c); + self.window().set_ime_allowed(false); + + // Immediately move to the captured character. + self.inline_search_next(); + } + fn message(&self) -> Option<&Message> { self.message_buffer.message() } @@ -1843,11 +1874,8 @@ impl input::Processor<EventProxy, ActionContext<'_, Notifier, EventProxy>> { self.ctx.update_cursor_blinking(); }, Ime::Preedit(text, cursor_offset) => { - let preedit = if text.is_empty() { - None - } else { - Some(Preedit::new(text, cursor_offset.map(|offset| offset.0))) - }; + let preedit = + (!text.is_empty()).then(|| Preedit::new(text, cursor_offset)); if self.ctx.display.ime.preedit() != preedit.as_ref() { self.ctx.display.ime.set_preedit(preedit); diff --git a/alacritty/src/input/keyboard.rs b/alacritty/src/input/keyboard.rs index 4bc3ffee..14755594 100644 --- a/alacritty/src/input/keyboard.rs +++ b/alacritty/src/input/keyboard.rs @@ -1,5 +1,4 @@ use std::borrow::Cow; -use std::mem; use winit::event::{ElementState, KeyEvent}; #[cfg(target_os = "macos")] @@ -29,6 +28,9 @@ impl<T: EventListener, A: ActionContext<T>> Processor<T, A> { let mods = self.ctx.modifiers().state(); if key.state == ElementState::Released { + if self.ctx.inline_search_state().char_pending { + self.ctx.window().set_ime_allowed(true); + } self.key_release(key, mode, mods); return; } @@ -45,15 +47,8 @@ impl<T: EventListener, A: ActionContext<T>> Processor<T, A> { // First key after inline search is captured. let inline_state = self.ctx.inline_search_state(); - if mem::take(&mut inline_state.char_pending) { - if let Some(c) = text.chars().next() { - inline_state.character = Some(c); - - // Immediately move to the captured character. - self.ctx.inline_search_next(); - } - - // Ignore all other characters in `text`. + if inline_state.char_pending { + self.ctx.inline_search_input(text); return; } diff --git a/alacritty/src/input/mod.rs b/alacritty/src/input/mod.rs index c10777f2..bbd8673f 100644 --- a/alacritty/src/input/mod.rs +++ b/alacritty/src/input/mod.rs @@ -127,6 +127,7 @@ pub trait ActionContext<T: EventListener> { fn inline_search_state(&mut self) -> &mut InlineSearchState; fn start_inline_search(&mut self, _direction: Direction, _stop_short: bool) {} fn inline_search_next(&mut self) {} + fn inline_search_input(&mut self, _text: &str) {} fn inline_search_previous(&mut self) {} fn hint_input(&mut self, _character: char) {} fn trigger_hint(&mut self, _hint: &HintMatch) {} diff --git a/alacritty/src/ipc.rs b/alacritty/src/ipc.rs index d06d395e..3d14c4ce 100644 --- a/alacritty/src/ipc.rs +++ b/alacritty/src/ipc.rs @@ -20,13 +20,13 @@ const ALACRITTY_SOCKET_ENV: &str = "ALACRITTY_SOCKET"; /// Create an IPC socket. pub fn spawn_ipc_socket(options: &Options, event_proxy: EventLoopProxy<Event>) -> Option<PathBuf> { - // Create the IPC socket and export its path as env variable if necessary. + // Create the IPC socket and export its path as env. + let socket_path = options.socket.clone().unwrap_or_else(|| { let mut path = socket_dir(); path.push(format!("{}-{}.sock", socket_prefix(), process::id())); path }); - env::set_var(ALACRITTY_SOCKET_ENV, socket_path.as_os_str()); let listener = match UnixListener::bind(&socket_path) { Ok(listener) => listener, @@ -36,6 +36,11 @@ pub fn spawn_ipc_socket(options: &Options, event_proxy: EventLoopProxy<Event>) - }, }; + env::set_var(ALACRITTY_SOCKET_ENV, socket_path.as_os_str()); + if options.daemon { + println!("ALACRITTY_SOCKET={}; export ALACRITTY_SOCKET", socket_path.display()); + } + // Spawn a thread to listen on the IPC socket. thread::spawn_named("socket listener", move || { let mut data = String::new(); diff --git a/alacritty/src/migrate/mod.rs b/alacritty/src/migrate/mod.rs index 58f381de..2f806d36 100644 --- a/alacritty/src/migrate/mod.rs +++ b/alacritty/src/migrate/mod.rs @@ -175,7 +175,6 @@ fn move_value(document: &mut DocumentMut, origin: &[&str], target: &[&str]) -> R None => return Ok(()), }; - dbg!(&key); origin_key = Some(key); origin_item = item; diff --git a/alacritty/src/window_context.rs b/alacritty/src/window_context.rs index 062f9ef0..cfc3cd96 100644 --- a/alacritty/src/window_context.rs +++ b/alacritty/src/window_context.rs @@ -9,7 +9,7 @@ use std::os::unix::io::{AsRawFd, RawFd}; use std::rc::Rc; use std::sync::Arc; -use glutin::config::GetGlConfig; +use glutin::config::Config as GlutinConfig; use glutin::display::GetGlDisplay; #[cfg(all(feature = "x11", not(any(target_os = "macos", windows))))] use glutin::platform::x11::X11GlConfigExt; @@ -119,18 +119,14 @@ impl WindowContext { /// Create additional context with the graphics platform other windows are using. pub fn additional( - &self, + gl_config: &GlutinConfig, event_loop: &ActiveEventLoop, proxy: EventLoopProxy<Event>, config: Rc<UiConfig>, options: WindowOptions, config_overrides: ParsedOptions, ) -> Result<Self, Box<dyn Error>> { - // Get any window and take its GL config and display to build a new context. - let (gl_display, gl_config) = { - let gl_context = self.display.gl_context(); - (gl_context.display(), gl_context.config()) - }; + let gl_display = gl_config.display(); let mut identity = config.window.identity.clone(); options.window_identity.override_identity_config(&mut identity); @@ -147,11 +143,8 @@ impl WindowContext { // Create context. let raw_window_handle = window.raw_window_handle(); - let gl_context = renderer::platform::create_gl_context( - &gl_display, - &gl_config, - Some(raw_window_handle), - )?; + let gl_context = + renderer::platform::create_gl_context(&gl_display, gl_config, Some(raw_window_handle))?; // Check if new window will be opened as a tab. #[cfg(target_os = "macos")] diff --git a/alacritty/windows/wix/alacritty.wxs b/alacritty/windows/wix/alacritty.wxs index cd64ec7b..cd00bda0 100644 --- a/alacritty/windows/wix/alacritty.wxs +++ b/alacritty/windows/wix/alacritty.wxs @@ -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.14.0-dev" Manufacturer="Alacritty" InstallerVersion="200"> + <Package Name="Alacritty" UpgradeCode="87c21c74-dbd5-4584-89d5-46d9cd0c40a7" Language="1033" Codepage="1252" Version="0.14.0" 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 --git a/alacritty_config/Cargo.toml b/alacritty_config/Cargo.toml index 4ca631af..862c6eb8 100644 --- a/alacritty_config/Cargo.toml +++ b/alacritty_config/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "alacritty_config" -version = "0.2.1-dev" +version = "0.2.2" authors = ["Christian Duerr <contact@christianduerr.com>"] license = "MIT OR Apache-2.0" description = "Alacritty configuration abstractions" @@ -15,5 +15,5 @@ serde = "1.0.163" toml = "0.8.2" [dev-dependencies] -alacritty_config_derive = { version = "0.2.3-dev", path = "../alacritty_config_derive" } +alacritty_config_derive = { version = "0.2.4", path = "../alacritty_config_derive" } serde = { version = "1.0.163", features = ["derive"] } diff --git a/alacritty_config_derive/Cargo.toml b/alacritty_config_derive/Cargo.toml index f74a7cba..bf439ce7 100644 --- a/alacritty_config_derive/Cargo.toml +++ b/alacritty_config_derive/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "alacritty_config_derive" -version = "0.2.3-dev" +version = "0.2.4" authors = ["Christian Duerr <contact@christianduerr.com>"] license = "MIT OR Apache-2.0" description = "Failure resistant deserialization derive" @@ -19,7 +19,7 @@ syn = { version = "2.0.16", features = ["derive", "parsing", "proc-macro", "prin [dev-dependencies.alacritty_config] path = "../alacritty_config" -version = "0.2.1-dev" +version = "0.2.2" [dev-dependencies] log = "0.4.11" diff --git a/alacritty_terminal/CHANGELOG.md b/alacritty_terminal/CHANGELOG.md index 82636168..e612e749 100644 --- a/alacritty_terminal/CHANGELOG.md +++ b/alacritty_terminal/CHANGELOG.md @@ -8,7 +8,19 @@ sections should follow the order `Added`, `Changed`, `Deprecated`, `Fixed` and The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). -## 0.24.1-dev +## 0.24.1 + +### Changed + +- Shell RCs are no longer sourced on macOs + +### Fixed + +- Semantic search handling of fullwidth characters +- Inline search ignoring line wrapping flag +- Clearing of `XDG_ACTIVATION_TOKEN` and `DESKTOP_STARTUP_ID` in the main process +- FD leaks when closing PTYs on Unix +- Crash when ConPTY creation failed ## 0.24.0 diff --git a/alacritty_terminal/Cargo.toml b/alacritty_terminal/Cargo.toml index b0463f1b..b8c0db4c 100644 --- a/alacritty_terminal/Cargo.toml +++ b/alacritty_terminal/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "alacritty_terminal" -version = "0.24.1-dev" +version = "0.24.1" authors = ["Christian Duerr <contact@christianduerr.com>", "Joe Wilm <joe@jwilm.com>"] license = "Apache-2.0" description = "Library for writing terminal emulators" @@ -23,8 +23,8 @@ log = "0.4" parking_lot = "0.12.0" polling = "3.0.0" regex-automata = "0.4.3" +unicode-width = "0.1" vte = { version = "0.13.0", package = "vte-graphics", default-features = false, features = ["ansi", "serde"] } -unicode-width = { package = "unicode-width-16", version = "0.1.0" } serde = { version = "1", features = ["derive", "rc"], optional = true } smallvec = { version = "1.13.1", features = ["serde"] } diff --git a/extra/completions/_alacritty b/extra/completions/_alacritty index a9260d5c..0ccce66f 100644 --- a/extra/completions/_alacritty +++ b/extra/completions/_alacritty @@ -27,9 +27,10 @@ _alacritty() { '*-o+[Override configuration file options \[example\: '\''cursor.style="Beam"'\''\]]:OPTION: ' \ '*--option=[Override configuration file options \[example\: '\''cursor.style="Beam"'\''\]]:OPTION: ' \ '--print-events[Print all events to STDOUT]' \ -'--ref-test[Generates ref test]' \ +'(--daemon)--ref-test[Generates ref test]' \ '(-v)*-q[Reduces the level of verbosity (the min level is -qq)]' \ '(-q)*-v[Increases the level of verbosity (the max level is -vvv)]' \ +'--daemon[Do not spawn an initial window]' \ '--hold[Remain open after child process exit]' \ '-h[Print help]' \ '--help[Print help]' \ diff --git a/extra/completions/alacritty.bash b/extra/completions/alacritty.bash index 2c10d47c..e2213b75 100644 --- a/extra/completions/alacritty.bash +++ b/extra/completions/alacritty.bash @@ -61,7 +61,7 @@ _alacritty() { case "${cmd}" in alacritty) - opts="-q -v -e -T -o -h -V --print-events --ref-test --embed --config-file --socket --working-directory --hold --command --title --class --option --help --version msg migrate help" + opts="-q -v -e -T -o -h -V --print-events --ref-test --embed --config-file --socket --daemon --working-directory --hold --command --title --class --option --help --version msg migrate help" if [[ ${cur} == -* || ${COMP_CWORD} -eq 1 ]] ; then COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) return 0 diff --git a/extra/completions/alacritty.fish b/extra/completions/alacritty.fish index b7fa8ce6..7cfc3337 100644 --- a/extra/completions/alacritty.fish +++ b/extra/completions/alacritty.fish @@ -1,6 +1,6 @@ # Print an optspec for argparse to handle cmd's options that are independent of any subcommand. function __fish_alacritty_global_optspecs - string join \n print-events ref-test embed= config-file= socket= q v working-directory= hold e/command= T/title= class= o/option= h/help V/version + string join \n print-events ref-test embed= config-file= socket= q v daemon working-directory= hold e/command= T/title= class= o/option= h/help V/version end function __fish_alacritty_needs_command @@ -36,6 +36,7 @@ complete -c alacritty -n "__fish_alacritty_needs_command" -l print-events -d 'Pr complete -c alacritty -n "__fish_alacritty_needs_command" -l ref-test -d 'Generates ref test' complete -c alacritty -n "__fish_alacritty_needs_command" -s q -d 'Reduces the level of verbosity (the min level is -qq)' complete -c alacritty -n "__fish_alacritty_needs_command" -s v -d 'Increases the level of verbosity (the max level is -vvv)' +complete -c alacritty -n "__fish_alacritty_needs_command" -l daemon -d 'Do not spawn an initial window' complete -c alacritty -n "__fish_alacritty_needs_command" -l hold -d 'Remain open after child process exit' complete -c alacritty -n "__fish_alacritty_needs_command" -s h -l help -d 'Print help' complete -c alacritty -n "__fish_alacritty_needs_command" -s V -l version -d 'Print version' diff --git a/extra/man/alacritty.1.scd b/extra/man/alacritty.1.scd index c8a67bb8..86630a65 100644 --- a/extra/man/alacritty.1.scd +++ b/extra/man/alacritty.1.scd @@ -21,6 +21,10 @@ set of features with high performance. Remain open after child process exits. +*--daemon* + + Do not spawn an initial window. + *--print-events* Print all events to STDOUT. diff --git a/extra/osx/Alacritty.app/Contents/Info.plist b/extra/osx/Alacritty.app/Contents/Info.plist index e402e372..08bf4270 100644 --- a/extra/osx/Alacritty.app/Contents/Info.plist +++ b/extra/osx/Alacritty.app/Contents/Info.plist @@ -15,7 +15,7 @@ <key>CFBundlePackageType</key> <string>APPL</string> <key>CFBundleShortVersionString</key> - <string>0.14.0-dev</string> + <string>0.14.0</string> <key>CFBundleSupportedPlatforms</key> <array> <string>MacOSX</string> |