aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKirill Chibisov <contact@kchibisov.com>2024-10-03 01:10:42 +0300
committerGitHub <noreply@github.com>2024-10-03 01:10:42 +0300
commit6067787763e663bd308e5b724a5efafc2c54a3d1 (patch)
treecf8ef3ad2a1b0a7244a08da61c2c3cfe32ee0768
parent58383f4e46e22c90e7ed85db535d9640b464176b (diff)
downloadalacritty-6067787763e663bd308e5b724a5efafc2c54a3d1.tar.gz
alacritty-6067787763e663bd308e5b724a5efafc2c54a3d1.zip
Remove startup notify variables only for shell
This will prevent issues when `setup_env` from `alacritty_terminal` will remove potentially useful variables for users of the library. Fixes #8202.
-rw-r--r--CHANGELOG.md1
-rw-r--r--alacritty_terminal/src/tty/mod.rs4
-rw-r--r--alacritty_terminal/src/tty/unix.rs4
3 files changed, 5 insertions, 4 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md
index dc858911..659a098e 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -44,6 +44,7 @@ Notable changes to the `alacritty_terminal` crate are documented in its
- Cursor color requests with default cursor colors
- Fullwidth semantic escape characters
- Windows app icon now displays properly in old alt+tab on Windows
+- Alacritty not being properly activated with startup notify
## 0.13.2
diff --git a/alacritty_terminal/src/tty/mod.rs b/alacritty_terminal/src/tty/mod.rs
index 2bcc5da9..eed2a76d 100644
--- a/alacritty_terminal/src/tty/mod.rs
+++ b/alacritty_terminal/src/tty/mod.rs
@@ -98,10 +98,6 @@ pub fn setup_env() {
// Advertise 24-bit color support.
env::set_var("COLORTERM", "truecolor");
-
- // Prevent child processes from inheriting startup notification env.
- env::remove_var("DESKTOP_STARTUP_ID");
- env::remove_var("XDG_ACTIVATION_TOKEN");
}
/// Check if a terminfo entry exists on the system.
diff --git a/alacritty_terminal/src/tty/unix.rs b/alacritty_terminal/src/tty/unix.rs
index 8084a753..6565f20b 100644
--- a/alacritty_terminal/src/tty/unix.rs
+++ b/alacritty_terminal/src/tty/unix.rs
@@ -227,6 +227,10 @@ pub fn from_fd(config: &Options, window_id: u64, master: OwnedFd, slave: OwnedFd
builder.env(key, value);
}
+ // Prevent child processes from inheriting linux-specific startup notification env.
+ builder.env_remove("XDG_ACTIVATION_TOKEN");
+ builder.env_remove("DESKTOP_STARTUP_ID");
+
unsafe {
builder.pre_exec(move || {
// Create a new process group.