pazz / alot

Terminal-based Mail User Agent
GNU General Public License v3.0
696 stars 164 forks source link

mailcap handler for plain/text requiring a tty crashes alot 0.9.1 #1544

Open roosemberth opened 3 years ago

roosemberth commented 3 years ago

Describe the bug I cannot open any thread from the search view. When I try opening a thread, the thread view is displayed and so are the message headings (incl. title, date and tags), but not any of the message bodies; at this time the interface is completely frozen and I'm forced to C-c the application.

Software Versions

To Reproduce Steps to reproduce the behaviour:

  1. open search buffer
  2. open any thread
  3. thread view freezes without showing any message contents.

No error log whatsoever.

After bisecting alot, the problem was introduced by commit b1c93c4d0c1eeacd64a195f16861bcb73910e739. But I am unable to fix the problem myself.

pazz commented 3 years ago

Looking at the bisected commit, I suspect that you have set up a text/plain mime entry that is used without your knowing. Do you see the message summaries?

Check your ~/.mailcap and /etc/mailcap for text/plain entries. If they exist then msg bodies will be piped through these tools and if they don't produce output you get "empty" messages.

roosemberth commented 3 years ago

Hi o/

Thanks for your message. That's correct; indeed I have text/*; xdg-open "%s" in ~/.mailcap, which itself resolves to nvim. I suppose that nvim tries to take over the terminal and this fails crashing alot in the process.

I have added an entry for text/plain (as provided in the reference commit message) and this solves my issue. However, I feel like a message like "opened with %s" should be displayed. In any case, an incorrect mailcap configuration should not freeze the interface.

roosemberth commented 3 years ago

Also, I just noticed that the order between text/*, text/html and text/plain is important. I would expect the most adequate filter to be matched; but perhaphs that's a different issue.:wq

pazz commented 3 years ago

You mean the order in which these are listed in the mailcap? Yes, I think that is relevant but standard behaviour for anything that uses mailcaps: the first match wins.