From 15f82858b70e7b0c93cf7b11e2ffd65ae210ed79 Mon Sep 17 00:00:00 2001 From: Jon Parise Date: Mon, 6 Jan 2025 14:00:38 -0500 Subject: [PATCH 1/2] termio: don't leak VTE_VERSION into child processes This variable is used by gnome-terminal and other VTE-based terminals. We don't want our child processes to think we're running under VTE. --- src/termio/Exec.zig | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/termio/Exec.zig b/src/termio/Exec.zig index 423ebfa28..ec5d3ffc0 100644 --- a/src/termio/Exec.zig +++ b/src/termio/Exec.zig @@ -857,6 +857,8 @@ const Subprocess = struct { } // Don't leak these environment variables to child processes. + env.remove("VTE_VERSION"); + if (comptime build_config.app_runtime == .gtk) { env.remove("GDK_DEBUG"); env.remove("GDK_DISABLE"); From 29dd5ae605617a470b9ee95d7b939cd335401013 Mon Sep 17 00:00:00 2001 From: Jon Parise Date: Mon, 6 Jan 2025 19:11:54 -0500 Subject: [PATCH 2/2] termio: explain why we're removing VTE_VERSION --- src/termio/Exec.zig | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/termio/Exec.zig b/src/termio/Exec.zig index ec5d3ffc0..1a3b8cad0 100644 --- a/src/termio/Exec.zig +++ b/src/termio/Exec.zig @@ -856,9 +856,11 @@ const Subprocess = struct { env.remove("GHOSTTY_MAC_APP"); } - // Don't leak these environment variables to child processes. + // VTE_VERSION is set by gnome-terminal and other VTE-based terminals. + // We don't want our child processes to think we're running under VTE. env.remove("VTE_VERSION"); + // Don't leak these GTK environment variables to child processes. if (comptime build_config.app_runtime == .gtk) { env.remove("GDK_DEBUG"); env.remove("GDK_DISABLE");