I am experiencing a strange problem with my new macro in mutt. The following macro works OK. s moves message to my archive folder immediately

macro index s ":set confirmappend=no delete=yes auto_tag=yes\n<save-message>=archive\n<sync-mailbox>:set confirmappend=yes delete=ask-yes\n"

however, when I remove confirmappend=no at the beginning and confirmappend=yes at the end:

macro index s ":set delete=yes auto_tag=yes\n<save-message>=archive\n<sync-mailbox>:set delete=ask-yes\n"

the macro does not work, and moreover mutt freezes so that I have to kill it with pkill

Can somebody please explain what is wrong? Why doeas the macro cause mutt to freeze?

If I want the macro to ask me confirmation for the append (but not for deleting), how can I do it?

1 Answer 1


As I understand it, if confirmappend is set to anything other than 'no', then Mutt will be expecting keyboard input in response to its "Append to mailbox?" prompt. That input needs to be present in the macro.

I'm not sure what Mutt does with the remainder of a macro string if the expected input for a yes-no prompt isn't found immediately -- whether it gobbles up characters until it sees a 'y' or an 'n', or something crazier. This is why many Mutt macros set options to values with predictable behavior before doing anything fancy.

  • thanks. Do you know how to modify the macro (i.e. how to add the necessary input, that mutt is expecting)? Commented Dec 24, 2013 at 19:12
  • I would suggest that your first macro is very nearly the correct incantation -- setting the options such that no prompts are generated. The only thing I might add is saving the previous value of the options in temporary variables, as is illustrated in Mutt manual example 3.17: :set my_delete=\$delete<enter>\ :set delete=yes<enter>\ :do_something<enter>\ :set delete=\$my_delete<enter>\ :unset my_delete<enter>
    – ewhac
    Commented Dec 28, 2013 at 7:31
  • so how should I modify my macro to make it do what I need (that is, move message to my archive, while being asked for confirmation) ? Commented Dec 30, 2013 at 10:55
  • I'm afraid we've walked off the end of my expertise. Near as I can tell from available sources, Mutt macros are barely more sophisticated than a keystroke replay routine. There appears to be no provision for stopping in the middle of a macro to wait for interactive input (this Web page says pretty much that: dev.mutt.org/trac/wiki/MuttGuide/Macros ).
    – ewhac
    Commented Dec 30, 2013 at 22:50

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .