You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is your feature request related to a problem? Please describe.
Processes that write to stdout/stderr can change the output displayed in a terminal with different control sequences.
For instance running swift test in a terminal will output a lot of intermediary lines that are removed progressively. What would be the best way to achieve something similar? Does this library provide the required input to do post-processing to get the desired output ?
guidance on how to post process the buffer sequences to get the desired data from the existing library, ideally including for when merging stdout and stderr streams.
new APIs, like consolidatedOutput / consolidatedError that do the adequate transformation.
I'm not sure which one is the most appropriate.
Describe alternatives you've considered
I tried looking for \r and ANSI control sequence in the string chunks received from stdout/stderr, but I could not find the necessary input to reproduce the behavior I'm looking for.
Additional context
Happy to answer any questions
The text was updated successfully, but these errors were encountered:
Hi @gsabran! The .string output type, along with AsyncBufferSequence which allows you to stream output live, are designed to capture all output content. By design, they don't process the output in any way like a terminal might because in many cases, you would want the original unmodified output.
If you don't really care about the actual output content nor want to collect it as a whole, instead of streaming output, you could try to use the .fileDescriptor output type to allow the child process to directly write to your standard output. Something like
This setup allows the swift test's output to be directly printed out from your standard output, allowing the terminal to perform output transformations, which should work with carriage returns.
Is your feature request related to a problem? Please describe.
Processes that write to stdout/stderr can change the output displayed in a terminal with different control sequences.
For instance running
swift test
in a terminal will output a lot of intermediary lines that are removed progressively. What would be the best way to achieve something similar? Does this library provide the required input to do post-processing to get the desired output ?Consider
content
is something likebut in my terminal I eventually only see
Describe the solution you'd like
Either:
consolidatedOutput
/consolidatedError
that do the adequate transformation.I'm not sure which one is the most appropriate.
Describe alternatives you've considered
I tried looking for
\r
and ANSI control sequence in the string chunks received from stdout/stderr, but I could not find the necessary input to reproduce the behavior I'm looking for.Additional context
Happy to answer any questions
The text was updated successfully, but these errors were encountered: