Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I would like to do the following:

  • Press a macro combination
  • Enter a script of my own making (Python) which has user interaction (think: UNIX dialog utility for shell scripts)
  • Do some processing based on the dialog response
  • Run some other mutt macro based on the dialog response (e.g. if X, do Y; else do Z)

Is this possible?

share|improve this question

Yes, it's possible. The macro to run your script should be done like:

macro index X "<enter-command>source /path/to/your/command|<enter>"

Replacing index and X with the menu name and key that you want to use. Note the | after the command name.

In order to interact with the terminal, the script will need to reopen /dev/tty. The script can then send back to STDOUT muttrc commands to cause other actions. To run a macro you can send back push Y where Y is the key to which the macro is bound.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.