apprt: require envmap for exec-based termio

Supercedes #5726
This commit is contained in:
Mitchell Hashimoto
2025-02-13 12:24:34 -08:00
parent c481bdf704
commit 1fea8028a3
5 changed files with 11 additions and 12 deletions

View File

@@ -519,17 +519,18 @@ 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: {
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;
break :env internal_os.getEnvMap(alloc) catch
std.process.EnvMap.init(alloc);
};
errdefer if (env_) |*env| env.deinit();
errdefer env.deinit();
// Initialize our IO backend
var io_exec = try termio.Exec.init(alloc, .{
.command = command,
.env = env_,
.env = env,
.shell_integration = config.@"shell-integration",
.shell_integration_features = config.@"shell-integration-features",
.working_directory = config.@"working-directory",