mirror of
https://github.com/ghostty-org/ghostty.git
synced 2025-10-16 23:06:20 +00:00
gtk(x11): set WINDOWID
env var for subprocesses
`WINDOWID` is the conventional environment variable for scripts that want to know the X11 window ID of the terminal, so that it may call tools like `xprop` or `xdotool`. We already know the window ID for window protocol handling, so we might as well throw this in for convenience.
This commit is contained in:

committed by
Mitchell Hashimoto

parent
f8b547f92e
commit
56ea6c406c
@@ -519,9 +519,17 @@ pub fn init(
|
||||
// This separate block ({}) is important because our errdefers must
|
||||
// be scoped here to be valid.
|
||||
{
|
||||
var env_ = rt_surface.defaultTermioEnv() catch |err| env: {
|
||||
// If an error occurs, we don't want to block surface startup.
|
||||
log.warn("error getting env map for surface err={}", .{err});
|
||||
break :env null;
|
||||
};
|
||||
errdefer if (env_) |*env| env.deinit();
|
||||
|
||||
// Initialize our IO backend
|
||||
var io_exec = try termio.Exec.init(alloc, .{
|
||||
.command = command,
|
||||
.env = env_,
|
||||
.shell_integration = config.@"shell-integration",
|
||||
.shell_integration_features = config.@"shell-integration-features",
|
||||
.working_directory = config.@"working-directory",
|
||||
|
Reference in New Issue
Block a user