summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormahkoh <mahkoh@users.noreply.github.com>2022-02-16 22:15:50 +0100
committerGitHub <noreply@github.com>2022-02-16 21:15:50 +0000
commitaaab88c5c5c94e11ffa3704407a3547cfabe4567 (patch)
tree81063b5244985c6ddcbcf7fae873af01e886727f
parenta64553bbaf9e058f02d278dfa7104ea96fc58dd8 (diff)
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.
-rw-r--r--CHANGELOG.md1
-rw-r--r--alacritty/src/ipc.rs2
2 files changed, 2 insertions, 1 deletions
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<PathBuf>) -> IoResult<UnixStream> {
#[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.