Skip to content
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 run commands that require access to TTY #194

Open
casey opened this issue Oct 9, 2021 · 1 comment
Open

Add ability to run commands that require access to TTY #194

casey opened this issue Oct 9, 2021 · 1 comment

Comments

@casey
Copy link
Collaborator

casey commented Oct 9, 2021

I tried to do:

run!(%"systemctl edit foo");

Which didn't work, because systemctl edit foo requires a TTY, because cradle always uses command.stdin(Stdio::piped()), the process doesn't inherit the TTY on standard input.

There should probably be some way to tell cradle that commands should inherit standard input.

@casey
Copy link
Collaborator Author

casey commented Oct 12, 2021

@soenkehahn This seems like something we should support, but I wanted to check with before I started implementing it.

I was thinking about how to test this, and the obvious thing to do is pipe data into a binary that uses cradle to read standard input and print it to standard output. (I don't think there's a way to test this from within a unit test.) I was thinking of doing this with a test helper subcommand, since that binary already exists:

"cat using cradle" => {
  run!("cat");
}

I could also do it with a separate binary, maybe called cradle_cat. Which do you think is better?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant