feat(terminal): export COLORTERM and COLORFGBG evn vars

This commit is contained in:
CJ van den Berg 2026-04-10 15:47:05 +02:00
parent cde7e4c6f5
commit a6b3da2d16
Signed by: neurocyte
GPG key ID: 8EB1E1BB660E3FB9

View file

@ -76,6 +76,12 @@ pub fn run_cmd(self: *Self, ctx: command.Context) !void {
errdefer env.deinit();
if (env.get("TERM") == null)
try env.put("TERM", "xterm-256color");
try env.put("COLORTERM", "truecolor");
// COLORFGBG tells apps whether the terminal background is dark or light
try env.put("COLORFGBG", switch (tui.active_color_scheme()) {
.dark => "15;0",
.light => "0;15",
});
var cmd_arg: []const u8 = "";
var on_exit: TerminalOnExit = tui.config().terminal_on_exit;