-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add ability to spawn a tty using a system command #8
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is so cool!
@@ -114,11 +114,28 @@ defmodule ExTTY do | |||
{Elixir.IEx, :start, opts} | |||
end | |||
|
|||
defp shell_spawner(%{type: :muontrap, shell_opts: opts}) do |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
defp shell_spawner(%{type: :muontrap, shell_opts: opts}) do | |
defp shell_spawner(%{type: :system, shell_opts: opts}) do |
MuonTrap is an implementation detail. What if we generalize this to System?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How about letting the user pass a :custom
shell spawner that calls an arbitrary function?
I'd be for adding an example to the docs if that's direction that you go since I wouldn't have expected calling System.cmd
to work well with this. I'm thrilled that it does, though.
args = Keyword.fetch!(opts, :args) | ||
gl = Process.group_leader() | ||
|
||
spawn(fn -> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
spawn(fn -> | |
spawn_link(fn -> |
Allows you too do something like: