mirror of
https://github.com/livebook-dev/livebook.git
synced 2024-12-28 18:50:48 +08:00
Direct non-captured output to the terminal (#273)
This commit is contained in:
parent
61a841a6d2
commit
38db12fbcc
3 changed files with 11 additions and 4 deletions
|
@ -55,7 +55,10 @@ defmodule Livebook.Runtime.ElixirStandalone do
|
|||
defp start_elixir_node(elixir_path, node_name, eval, argv) do
|
||||
# Here we create a port to start the system process in a non-blocking way.
|
||||
Port.open({:spawn_executable, elixir_path}, [
|
||||
:binary,
|
||||
# We don't communicate with the system process via stdio,
|
||||
# contrarily, we want any non-captured output to go directly
|
||||
# to the terminal
|
||||
:nouse_stdio,
|
||||
:hide,
|
||||
args: elixir_flags(node_name) ++ ["--eval", eval, "--" | Enum.map(argv, &to_string/1)]
|
||||
])
|
||||
|
|
|
@ -90,8 +90,10 @@ defmodule Livebook.Runtime.MixStandalone do
|
|||
defp start_elixir_mix_node(elixir_path, node_name, eval, argv, project_path) do
|
||||
# Here we create a port to start the system process in a non-blocking way.
|
||||
Port.open({:spawn_executable, elixir_path}, [
|
||||
:binary,
|
||||
:stderr_to_stdout,
|
||||
# We don't communicate with the system process via stdio,
|
||||
# contrarily, we want any non-captured output to go directly
|
||||
# to the terminal
|
||||
:nouse_stdio,
|
||||
:hide,
|
||||
cd: project_path,
|
||||
args:
|
||||
|
|
|
@ -39,7 +39,9 @@ defmodule Livebook.Runtime.StandaloneInit do
|
|||
# Minimize schedulers busy wait threshold,
|
||||
# so that they go to sleep immediately after evaluation.
|
||||
# Enable ANSI escape codes as we handle them with HTML.
|
||||
"+sbwt none +sbwtdcpu none +sbwtdio none -elixir ansi_enabled true",
|
||||
# Disable stdin, so that the system process never tries to read
|
||||
# any input from the terminal.
|
||||
"+sbwt none +sbwtdcpu none +sbwtdio none -elixir ansi_enabled true -noinput",
|
||||
# Make the node hidden, so it doesn't automatically join the cluster
|
||||
"--hidden",
|
||||
# Use the cookie in Livebook
|
||||
|
|
Loading…
Reference in a new issue