Closed tfausak closed 4 years ago
I think this happened because I switched from spawn
to exec
. The former doesn't buffer STDIO at all whereas the latter buffers STDOUT and STDERR.
I switched to exec
for the shell argument parsing, but it turns out you can get that with spawn
using { shell: true }
.
This surprised me! The process has a maximum output size. It defaults to 1 MB. If that much output is generated, the process crashes. https://nodejs.org/api/child_process.html#child_process_child_process_exec_command_options_callback
You can reliably crash GHCi by putting something like this in your
.ghci
:This problem is surprisingly easy to run into when you have lots of modules. The default GHCi prompt is huge, and I often get lots of warnings for missing import lists.
One way to lessen the impact here would be to increase the max buffer size. I'm not sure what I would increase it to, and that's really only passing the buck. (Note that outputting less probably wouldn't help. This is Node's buffer, not VSCode's.)
I only ever want to stream output, so I should figure out how to set up the process to do that.