Skip to content
This repository has been archived by the owner on Dec 7, 2019. It is now read-only.

Why you decided to use script and get all output through file? #16

Open
dimorinny opened this issue Apr 24, 2018 · 1 comment
Open

Why you decided to use script and get all output through file? #16

dimorinny opened this issue Apr 24, 2018 · 1 comment

Comments

@dimorinny
Copy link

dimorinny commented Apr 24, 2018

I would like to ask this question because we found strange things with this part of commander.

script have a different behaviour depends on version. For example, script from unix-utils 2.27.1 saves placeholder about started time like this:

Script started on Tue 24 Apr 2018 04:22:21 AM MSK

even we have --quiet flag.

Also, we had a flaky experience with composer, that uses this implementation of commander and getting output from the command using tail.

We fixed this using common approach for running subprocesses.

But now it has a little bit different interface, then current implementation. For example, Notification class looks like this for supporting real-time output parsing (instead of tail):

sealed class Notification {
    object Start : Notification()
    data class Exit(val output: String) : Notification()
    data class Output(val line: String) : Notification()
}

Would you like to have this changes in commander or it is important to have current behaviour or you don't want to merge breaking changes?

@artem-zinnatullin
Copy link
Contributor

Main reason to use script was the problem with output buffering.

For example when adb or emulator print really short output that doesn't overflow buffer we couldn't read it.

Few weeks I've been trying to solve this problem one way or another using Java piping api, but script -F was the only approach that worked in all test cases on all OSes.

I'm open to see how you solved it if you can submit a PR that would be great!

Commander is pre-v1, so we can introduce breaking changes, or we can also release a v1.

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

No branches or pull requests

2 participants