fix(linux): fix EnvironmentVariableNotFound error
This commit is contained in:
@@ -23,6 +23,8 @@ pub fn getShell(allocator: std.mem.Allocator) ![]u8 {
|
||||
}
|
||||
|
||||
pub fn getTerminalName(allocator: std.mem.Allocator) ![]u8 {
|
||||
const term_progrm = try std.process.getEnvVarOwned(allocator, "TERM_PROGRAM");
|
||||
const term_progrm = std.process.getEnvVarOwned(allocator, "TERM_PROGRAM") catch |err| if (err == error.EnvironmentVariableNotFound) {
|
||||
return allocator.dupe(u8, "Unknown");
|
||||
} else return err;
|
||||
return term_progrm;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user