[neomutt-users] Too few arguments on folder-hook

Kenneth Flak kennethflak at protonmail.com
Tue Nov 5 16:00:25 CET 2019

Hi Rich,

The fix you suggested works beautifully. However, when this is enabled it takes neomutt around three seconds longer to launch than when it is disabled. Is this expected behavior? Alternatively, is there a way to run this command asynchronously?

Best, and thanks so much for your work on neomutt!

Roosna & Flak - Contemporary Dance & Music
Web: roosnaflak.com
Code: {github,gitlab}.com/kflak
Mastodon: @kf at vis.social
On  4 Nov 2019  16:50, Richard Russon wrote:
>Hi Kenneth,
>> folder-hook . `rm -f /tmp/neomutt-arch/*`
>Ah, there are a couple of problems here.
>The first is quite subtle.  Your command isn't quoted.
>Because of this, the *parser* executes the `backticked` command on startup
>and NeoMutt sees the processed config:
>    folder-hook .
>There's nothing after the '.' because `rm` didn't print anything.
>Meaning you see:
>    Error: Too few arguments on folder-hook
>Let's quote the command:
>    folder-hook . '`rm -f /tmp/neomutt-arch/*`'
>Now, it's not executed when the hook is parsed.
>When NeoMutt opens a folder, it processes the `backticks` first,
>then tries to run the command, which is an empty string.
>    : unknown command
>So, let's add a NeoMutt 'echo' command to keep it happy:
>    folder-hook . 'echo `rm -f /tmp/neomutt-arch/*`'
>I hope that makes sense.
>    Rich / FlatCap

More information about the neomutt-users mailing list