diff --git a/src/Fuzzer.zig b/src/Fuzzer.zig index 043f29a..22c8bd2 100644 --- a/src/Fuzzer.zig +++ b/src/Fuzzer.zig @@ -71,11 +71,20 @@ pub fn create( }}); errdefer allocator.free(princiapl_file_uri); - var zls_process = std.ChildProcess.init(&.{ config.zls_path, "--enable-debug-log" }, allocator); + var env_map = if (std.process.getEnvMap(allocator)) |env_map| blk: { + var map: std.process.EnvMap = env_map; + errdefer map.deinit(); + try map.put("", "NO_COLOR"); + break :blk map; + } else |_| null; + defer if (env_map) |*map| map.deinit(); + var zls_process = std.ChildProcess.init(&.{ config.zls_path, "--enable-debug-log" }, allocator); + zls_process.env_map = if (env_map) |*map| map else null; zls_process.stdin_behavior = .Pipe; zls_process.stderr_behavior = .Pipe; zls_process.stdout_behavior = .Pipe; + try zls_process.spawn(); errdefer _ = zls_process.kill() catch @panic("failed to kill zls process");