From aaab88c5c5c94e11ffa3704407a3547cfabe4567 Mon Sep 17 00:00:00 2001 From: mahkoh Date: Wed, 16 Feb 2022 22:15:50 +0100 Subject: [PATCH] Account for absolute WAYLAND_DISPLAY paths If WAYLAND_DISPLAY contains a '/', we have to replace with with another character before using WAYLAND_DISPLAY as a path component. --- CHANGELOG.md | 1 + alacritty/src/ipc.rs | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 60bb7301..f1a1bd27 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -32,6 +32,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). - Buili-in font arcs alignment - Repeated permission prompts on M1 macs - Colors being slightly off when using `colors.transparent_background_colors` +- Creating the IPC socket failing if WAYLAND_DISPLAY contains an absolute path ## 0.10.0 diff --git a/alacritty/src/ipc.rs b/alacritty/src/ipc.rs index a71b5139..d4c807ba 100644 --- a/alacritty/src/ipc.rs +++ b/alacritty/src/ipc.rs @@ -152,7 +152,7 @@ fn find_socket(socket_path: Option) -> IoResult { #[cfg(not(target_os = "macos"))] fn socket_prefix() -> String { let display = env::var("WAYLAND_DISPLAY").or_else(|_| env::var("DISPLAY")).unwrap_or_default(); - format!("Alacritty-{}", display) + format!("Alacritty-{}", display.replace('/', "-")) } /// File prefix matching all available sockets.