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

commands/thread: Add option --strip_ansi to pipeto #1619

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

Conversation

guludo
Copy link
Contributor

@guludo guludo commented May 9, 2023

If someone has a mailcap entry that colors the mail content, it is possible that she would want to get the content without the CSI escapes when piping it an external command.

Ideally, there should be a way to have the content untouched by the mailcap filter so we could use it when it makes sense. However, let's use ansi.remove_csi() for the time being.

If someone has a mailcap entry that colors the mail content, it is
possible that she would want to get the content without the CSI escapes
when piping it an external command.

Ideally, there should be a way to have the content untouched by the
mailcap filter so we could use it when it makes sense. However, let's
use ansi.remove_csi() for the time being.
@pazz
Copy link
Owner

pazz commented May 26, 2023

Shouldn't this default to true? when would you ever want these escape codes when piping stuff into other tools?

@guludo
Copy link
Contributor Author

guludo commented May 29, 2023

Shouldn't this default to true?

I agree that would be a better default. I just wanted to make sure I didn't break other people's workflow.

when would you ever want these escape codes when piping stuff into other tools?

I guess one use case is when using another program to view the email. One could, for example, pipe it to less -R.

Anyways, let me know if you prefer true to be the default, then I'll send a new version here.

@pazz
Copy link
Owner

pazz commented Jul 26, 2023

Can you explain the use case for this? I mean, I have never seen these sequences in actual message contents and only ever added them for displaying stuff on the terminal.

@guludo
Copy link
Contributor Author

guludo commented Jul 26, 2023

For me, the use case was to apply a patch directly from the mail client.

@pazz
Copy link
Owner

pazz commented Jul 26, 2023 via email

@guludo
Copy link
Contributor Author

guludo commented Jul 26, 2023

But do the patch files you receive really have any ansi characters in them?

No, they do not. The issue is that I have a mailcap entry that colorizes the patch. When I use pipe_to, the content with the added escapes is what is piped.

@pazz
Copy link
Owner

pazz commented Jul 26, 2023 via email

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.

2 participants