Skip to content

Commit

Permalink
fix nerves.system.shell for mac os
Browse files Browse the repository at this point in the history
  • Loading branch information
mobileoverlord committed Feb 3, 2018
1 parent bab36ef commit d3b8148
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
* Fix artifact archiver to use `Artifact.download_name/1` instead of
`Artifact.name/1`. Fixes issues with the Docker provider and
`mix nerves.artifact`
* Fix issue with `nerves.system.shell` not rendering properly

## Nerves v0.9.3

Expand Down
10 changes: 9 additions & 1 deletion lib/mix/nerves/shell.ex
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,16 @@ defmodule Mix.Nerves.Shell do
stdin_port = Port.open({:spawn, "tty_sl -c -e"}, [:binary, :eof, :stream, :in])

# We run the command through the script command to emulate a pty
cmd =
"script -q /dev/null " <>
case Nerves.Env.host_os() do
"linux" ->
"-c \"#{command}\""
_ -> "#{command}"
end

cmd_port =
Port.open({:spawn, "script -q /dev/null -c \"#{command}\" "}, [
Port.open({:spawn, cmd}, [
:binary,
:eof,
:stream,
Expand Down

0 comments on commit d3b8148

Please sign in to comment.