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

Stdout and stderr from sbt commands is gone forever #11

Open
BritishPearl opened this issue Jan 6, 2020 · 5 comments
Open

Stdout and stderr from sbt commands is gone forever #11

BritishPearl opened this issue Jan 6, 2020 · 5 comments

Comments

@BritishPearl
Copy link

The underlying sbt server is launched with stdin/out/err all pointing to /dev/null:

    Command::new("sbt")
        .stdin(Stdio::null())
        .stdout(Stdio::null())
        .stderr(Stdio::null())
        .spawn()

and thus the output from commands like sbt test or sbt it is unavailable, only the logs ([info] etc.). Is there any way to circumvent this limitation?

@cb372
Copy link
Owner

cb372 commented Jan 16, 2020

Thanks for the report. How about adding command-line options to write stdout and stderr to files?

e.g. sbt-client -stdout out.txt -stderr err.txt test

The only problem is that these options would be ignored if the sbt server is already running, which is potentially confusing behaviour.

@cb372
Copy link
Owner

cb372 commented Jan 16, 2020

See also #1 and #7, which are variants of the same problem: any options we take on the command line will only take effect if sbt-client starts an sbt server because it's not already running. Unless we can somehow detect if an sbt server is running, but with different arguments? In that case we could kill the server and start a new one.

@dwijnand
Copy link

You might want to hold off introducing new UX here, given sbt/sbt#5319 is coming (at some point, hopefully), which would mostly subsume this client (AFAICT).

@BritishPearl
Copy link
Author

@cb372 yes, -stdout/-stdin options would be nice... or even just -inherit-stdout/-inherit-stdin that would make sbt-client use Stdio::inherit instead of Stdio::null :)

@BritishPearl
Copy link
Author

If it comes to server already running... yeah, possibly a check of the arguments of the existing server instance + an option like -restart-if-different-options

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

3 participants