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

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

Open
roosemberth opened this issue Sep 25, 2020 · 4 comments
Open

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

roosemberth opened this issue Sep 25, 2020 · 4 comments

Comments

@roosemberth
Copy link

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

  • Python version: Python 3.7.7
  • Alot version: 0.9.1
  • Nixpkgs 0682ec40c68bf86fc002b56395e68dd5fe754738 (release 20.09).

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 b1c93c4. But I am unable to fix the problem myself.

@pazz
Copy link
Owner

pazz commented Sep 25, 2020

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
Copy link
Author

roosemberth commented Sep 25, 2020

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 roosemberth changed the title Cannot open threads on alot 0.9.1 mailcap entry for plain/text requiring a tty crashes alot 0.9.1 Sep 25, 2020
@roosemberth roosemberth changed the title mailcap entry for plain/text requiring a tty crashes alot 0.9.1 mailcap handler for plain/text requiring a tty crashes alot 0.9.1 Sep 25, 2020
@roosemberth
Copy link
Author

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
Copy link
Owner

pazz commented Sep 26, 2020 via email

roosemberth added a commit to roosemberth/dotfiles that referenced this issue Sep 27, 2020
In NixOS 20.09, alot was updated to version 0.9.1.

Since alot 0.9.1 it is possible to specify a mailcap for text/plain.
This was delegating it to xdg-open, which in turns delegates it to
nvim. which probably tried to take control of the tty and crashed alot
(see pazz/alot#1544). This adds an explicit
entry for text/plain.

Mind that the order in which alot matches this file seems to be important.
This is probably a bug, but fixed here as a workaround.

Signed-off-by: Roosembert Palacios <[email protected]>
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

No branches or pull requests

2 participants