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

Only print trailing newline when output is terminal #45

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

spenserblack
Copy link

@spenserblack spenserblack commented Jul 10, 2024

This makes it so the output does not have a trailing newline when the
user is piping to another command.

This has the potentially unwanted side effect of removing the newline when
the user is redirecting to a file (xcolor >> colors.txt). Feel free to close
the PR if this is not the desired behavior.

Instead of automatically detecting this, it could also be a CLI flag. Or it could be both, with the options --newline auto|always|never.

Resolves #44

This makes it so the output does *not* have a trailing newline when the
user is piping to another command.
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

Successfully merging this pull request may close these issues.

Remove trailing newline when STDOUT is piped
1 participant