You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
How can one start neomutt in such a way, that it opens a mailbox with unread mail on start, and when there is no unread mail it opens any (or even better: a specified) mailbox?
I know of -Z that opens a mailbox with unread mail. But with this option, neomutt immediately exits when there is no new mail. -Zf "/some/mailbox" doesn't work either.
startup-hook 'exec next-unread-mailbox' doesn't work, probably because it's too early when this hook is executed.
A workaround is sh -c 'neomutt -Z || neomutt -f "/some/mailbox"'. But this calls neomutt twice, which will definitely and unnecessarily do some stuff twice, and it also forces one to start a shell, which is also unnecessary, making it pretty ugly.
The text was updated successfully, but these errors were encountered:
Hi @dorsiflexion, that definitely sounds useful. I'm not aware of a way to do that in NeoMutt at the moment.
I see two ways to build this:
Add a new CLI arg. Not sure if I like this. Adding CLI args for every new use-cases easily could lead to a mess. 😏
Rethink our hooks. This is something @flatcap and me briefly discussed on IRC. We could add more hooks on clearly defined points (after initialize, after gui initialized, ...). This seems like a good use-case for it.
How can one start neomutt in such a way, that it opens a mailbox with unread mail on start, and when there is no unread mail it opens any (or even better: a specified) mailbox?
I know of
-Z
that opens a mailbox with unread mail. But with this option, neomutt immediately exits when there is no new mail.-Zf "/some/mailbox"
doesn't work either.startup-hook 'exec next-unread-mailbox'
doesn't work, probably because it's too early when this hook is executed.A workaround is
sh -c 'neomutt -Z || neomutt -f "/some/mailbox"'
. But this calls neomutt twice, which will definitely and unnecessarily do some stuff twice, and it also forces one to start a shell, which is also unnecessary, making it pretty ugly.The text was updated successfully, but these errors were encountered: