alot icon indicating copy to clipboard operation
alot copied to clipboard

commands/thread: Add option --strip_ansi to pipeto

Open guludo opened this issue 2 years ago • 7 comments

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.

guludo avatar May 09 '23 17:05 guludo

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

pazz avatar May 26 '23 08:05 pazz

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.

guludo avatar May 29 '23 14:05 guludo

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.

pazz avatar Jul 26 '23 12:07 pazz

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

guludo avatar Jul 26 '23 13:07 guludo

But do the patch files you receive really have any ansi characters in them? That's what's confusing me here..

Quoting Gustavo José de Sousa (2023-07-26 14:38:50)

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

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you commented.Message ID: <pazz/alot/pull/1619/ @.**>

pazz avatar Jul 26 '23 15:07 pazz

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.

guludo avatar Jul 26 '23 17:07 guludo

Thanks for clarifying. I think there is something wrong with the pipeto command then: I believe it should only send the content of the mime part, not what has been piped through the mailcap entry. Will have to look into this at some point. Cheers!

Quoting Gustavo José de Sousa (2023-07-26 18:40:12)

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.

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you commented.Message ID: <pazz/alot/pull/1619/ @.**>

pazz avatar Jul 26 '23 19:07 pazz