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

Check if process is piped and exclude decoration of output. #37

Open
talis-fb opened this issue Mar 2, 2024 · 0 comments
Open

Check if process is piped and exclude decoration of output. #37

talis-fb opened this issue Mar 2, 2024 · 0 comments
Labels
enhancement New feature or request good first issue Good for newcomers 🐇 Small
Milestone

Comments

@talis-fb
Copy link
Owner

talis-fb commented Mar 2, 2024

When user execute TReq in a not TTY enviroment. Redirecting or piping output, like this...

treq url.com > file.txt # redirecting to
treq url.com | grep search-term

The TReq should check this and make the output the basic request output.

This check can be made by this function in Crossterm: https://docs.rs/crossterm/latest/crossterm/tty/trait.IsTty.html

Additional Considerations:

Use the same command options of using --body flag. Make the check of tty in beginning. If it's true, set like user pass the command with this flag. It is the same behavior.

It's also important does not ignore another flags like --header. So, this verification should be the last priority possible in all validation.

@talis-fb talis-fb added enhancement New feature or request good first issue Good for newcomers 🐇 Small labels Mar 2, 2024
@talis-fb talis-fb added this to the v1.3.0 milestone Mar 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers 🐇 Small
Projects
Status: 📋 Backlog
Development

No branches or pull requests

1 participant