Skip to content

Commit

Permalink
pass NO_COLOR to zls child process
Browse files Browse the repository at this point in the history
  • Loading branch information
Techatrix committed Jul 31, 2023
1 parent bd88011 commit c29bc67
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion src/Fuzzer.zig
Original file line number Diff line number Diff line change
Expand Up @@ -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");

Expand Down

0 comments on commit c29bc67

Please sign in to comment.