From 1df7dc5171abfe1eab3e95be964f61c5876198f1 Mon Sep 17 00:00:00 2001 From: Christian Duerr Date: Sat, 23 Oct 2021 07:16:47 +0000 Subject: Add multi-window support Previously Alacritty would always initialize only a single terminal emulator window feeding into the winit event loop, however some platforms like macOS expect all windows to be spawned by the same process and this "daemon-mode" can also come with the advantage of increased memory efficiency. The event loop has been restructured to handle all window-specific events only by the event processing context with the associated window id. This makes it possible to add new terminal windows at any time using the WindowContext::new function call. Some preliminary tests have shown that for empty terminals, this reduces the cost of additional terminal emulators from ~100M to ~6M. However at this point the robustness of the daemon against issues with individual terminals has not been refined, making the reliability of this system questionable. New windows can be created either by using the new `CreateNewWindow` action, or with the `alacritty msg create-window` subcommand. The subcommand sends a message to an IPC socket which Alacritty listens on, its location can be found in the `ALACRITTY_SOCKET` environment variable. Fixes #607. --- alacritty/src/config/ui_config.rs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'alacritty/src/config/ui_config.rs') diff --git a/alacritty/src/config/ui_config.rs b/alacritty/src/config/ui_config.rs index 3ce02161..3ba59ea8 100644 --- a/alacritty/src/config/ui_config.rs +++ b/alacritty/src/config/ui_config.rs @@ -62,6 +62,10 @@ pub struct UiConfig { /// Regex hints for interacting with terminal content. pub hints: Hints, + /// Offer IPC through a unix socket. + #[cfg(unix)] + pub ipc_socket: bool, + /// Keybindings. key_bindings: KeyBindings, @@ -76,8 +80,10 @@ pub struct UiConfig { impl Default for UiConfig { fn default() -> Self { Self { - alt_send_esc: true, live_config_reload: true, + alt_send_esc: true, + #[cfg(unix)] + ipc_socket: true, font: Default::default(), window: Default::default(), mouse: Default::default(), -- cgit