Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/lsp/Main.re
Original file line number Diff line number Diff line change
Expand Up @@ -301,6 +301,7 @@ let showHelp = () => {
};

let main = () => {
Sys.set_signal(Sys.sigpipe, Sys.Signal_ignore);
switch (parseArgs(Sys.argv->Belt.List.fromArray)) {
| (opts, _) when opts->hasOpts(["-h", "--help"]) => showHelp();
| (opts, []) =>
Expand Down
2 changes: 1 addition & 1 deletion util/Commands.re
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ let execFull = (~input=?, ~pwd=?, ~env=Unix.environment(), cmd) => {
| None => ()
| Some(text) => output_string(cmd_in, text)
};
close_out(cmd_in);
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

close_out would trigger a Sys_error("Broken pipe") exception now that we ignore the SIGPIPE signal. Instead of catching and handling it, we simply use close_out_noerr which ignores all errors

close_out_noerr(cmd_in);

let cmd_out_descr = Unix.descr_of_in_channel(cmd_out);
let cmd_err_descr = Unix.descr_of_in_channel(cmd_err);
Expand Down