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

Preserve output formatting with spin --show-output #305

Closed
h0adp0re opened this issue Mar 13, 2023 · 2 comments · Fixed by #850
Closed

Preserve output formatting with spin --show-output #305

h0adp0re opened this issue Mar 13, 2023 · 2 comments · Fixed by #850
Labels
bug Something isn't working cmd/spin

Comments

@h0adp0re
Copy link

Is your feature request related to a problem? Please describe.
It looks like gum spin --show-output strips stdout of all escape codes.

Describe the solution you'd like
It'd be great if output would be 1:1 as if run without gum spin; colors, newlines, the works.

@caarlos0 caarlos0 added bug Something isn't working cmd/spin labels Nov 18, 2024
@caarlos0
Copy link
Member

hey!

that's likely the program being run detecting stdout is not a terminal and then not printing any colors

most CLIs have an option to force colors, such as --color=always on ls, or setting env vars like CLICOLOR_FORCE=1.

we could maybe run the program on tty, though, @aymanbagabas what do you think?

@aymanbagabas
Copy link
Member

We certainly could conditionally run the program on TTY when Stdout is a terminal. Since we only display the output/error after Gum exits, we can just output the recorded output/error from the TTY to os.Stdout/Stderr. In this case though, we probably will need two TTYs for Stdout and Stderr.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working cmd/spin
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants