wangp / bower

A curses terminal client for the Notmuch email system
Other
119 stars 11 forks source link

hack: replace tabs with spaces in Subject header #49

Closed dtzWill closed 4 years ago

dtzWill commented 5 years ago

Questionable, perhaps.

Some mailiers seem to incorrectly wrap subject messages (I think that's what I chased this down to?) which results in unsightly hard tabs in subject messages.

This patch adds a visual-only workaround that simply replaces these tabs with a single space which is significantly less jarring.

The issue may be present elsewhere in my stack, thoughts/feedback welcome. Until the underlying issue is resolved (which it may not ever be, if in widely used mailing software) this produces a nicer experience, with "cost" of no longer properly showing actual hard tabs in subjects -- which personally is quite alright :).

wangp commented 5 years ago

Wrapping long header values with tabs is acceptable behaviour. The question is whether notmuch is responsible for cleaning up those values in its output; notmuch says it's up to front-ends to do so. So replacing tabs with spaces is the correct thing to do, but we must also delete CR, NL and probably all control characters, and perhaps all unprintable characters.

wangp commented 4 years ago

Sorry for the delay. I've finally pushed a change I had lying around.