[neomutt-devel] [Feature Request] Inter Process Communication

Richard Russon rich at flatcap.org
Sat Nov 6 11:50:46 CET 2021


Hi Charalampos,

> ... send commands directly to the running neomutt instance.
> I found Issue #2 [1] on GitHub

There was also #922 (also abandoned), where we discussed some other ideas

  Create hooks for SIGUSR1 and SIGUSR2
  https://github.com/neomutt/neomutt/issues/922

which lead to a discussion about fifos.

> I would be interested in trying to implement such a feature.

Fanstastic!

> I ... managed to add a really basic conditional
> inside monitor.c:mutt_monitor_poll in order to check if a socket
> I have defined is ready to receive data.

Nice!

What feature(s) would you like?

- Just `mailto:` handling?
- Full-automation

or somewhere in-between ;-)

> One problem is ...
> > * Only STDIN and INotify file handles currently expected/supported.

I don't know the reasoning behind the comment (it's been there since the
monitor code was added), but...

A big problem with externally automating NeoMutt is its modal nature.
A function's behaviour will depend on where you are, Index, Pager, etc

> Could you educate me on the matter?

The monitor code is plugged into the key handling, so it could create an
event any time NeoMutt's waiting for a keypress.

Using this method, we'd have to queue up the commands and have the
dialog check the queue when it's safe to do so.

The alternative would be to call the polling function from specific
places like the Index and Pager.

The possibility of full automation (or scripting) has taken a step
forward recently.  Historically, when you hit `<some-function>` it would
be handled by a block of code in a `switch` statement in an enormous
C function.  These `switch`s are being broken up into simple functions
that operate on some data.

> I would like some directions on how to move forward.

Pick the feature most important to you.
Think how NeoMutt should react when in the Index, Pager, Compose, etc
Then we can come up with a plan of how to implement the feature.

We can discuss your ideas here, on GitHub (raise an issue),
or IRC (most active weekdays) #neomutt on irc.libera.chat

Cheers,
    Rich / FlatCap
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <https://mailman.neomutt.org/pipermail/neomutt-devel-neomutt.org/attachments/20211106/2b5d2831/attachment.sig>


More information about the neomutt-devel mailing list