fix(terminal): export TERM if not inherited

This commit is contained in:
CJ van den Berg 2026-04-07 22:02:13 +02:00
parent 32819ff952
commit a7df06da8b
Signed by: neurocyte
GPG key ID: 8EB1E1BB660E3FB9

View file

@ -1,6 +1,5 @@
const std = @import("std");
const builtin = @import("builtin");
const build_options = @import("build_options");
const Allocator = std.mem.Allocator;
const tp = @import("thespian");
@ -74,6 +73,8 @@ pub fn create(allocator: Allocator, parent: Plane, ctx: command.Context) !Widget
pub fn run_cmd(self: *Self, ctx: command.Context) !void {
var env = try std.process.getEnvMap(self.allocator);
errdefer env.deinit();
if (env.get("TERM") == null)
try env.put("TERM", "xterm-256color");
var cmd_arg: []const u8 = "";
var on_exit: TerminalOnExit = tui.config().terminal_on_exit;