Dune systematically buffers the output of commands so that their output is not mixed up during parallel builds. However, this is not ideal for interactive commands that require direct access to the terminal.
Currently, the only workaround is to run dune with -j 1 --no-buffer which is not ideal since it completely disables parallelism and also require a specific dune invocation.
Another idea would be to let actions declare that they want direct access to the terminal.
Proposal
Add a new action (using_terminal ...) to introduce an action that requires the terminal. For instance:
(rule
(alias runtest)
(action (using_terminal (run ./prog.exe))))
Only one such action can run at a time, and while such an action is running messages emitted by dune would be put in a queue and rendered once the action has finished.
Dune systematically buffers the output of commands so that their output is not mixed up during parallel builds. However, this is not ideal for interactive commands that require direct access to the terminal.
Currently, the only workaround is to run dune with
-j 1 --no-bufferwhich is not ideal since it completely disables parallelism and also require a specific dune invocation.Another idea would be to let actions declare that they want direct access to the terminal.
Proposal
Add a new action
(using_terminal ...)to introduce an action that requires the terminal. For instance:Only one such action can run at a time, and while such an action is running messages emitted by dune would be put in a queue and rendered once the action has finished.