From 771e676953c54aa6c818020687b53470ec5597f3 Mon Sep 17 00:00:00 2001 From: Jason Cox Date: Thu, 22 Feb 2024 20:25:22 -0500 Subject: ipc: add more fine-grained options to disable IPC Add disable-ipc-mailto and disable-ipc-mbox to make mailto:... and mbox:... commands always run in a new instance, while still allowing aerc-internal commands (i.e., aerc :) to run over IPC. Changelog-added: Add config options `disable-ipc-mailto` and `disable-ipc-mbox` to make `mailto:...` and `mbox:...` commands always run in a new aerc instance. Signed-off-by: Jason Cox Acked-by: Robin Jarry --- main.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'main.go') diff --git a/main.go b/main.go index b7437fbd..21805345 100644 --- a/main.go +++ b/main.go @@ -171,7 +171,10 @@ func main() { noIPC := opts.NoIPC || config.General.DisableIPC - if len(opts.Command) > 0 && !noIPC { + if len(opts.Command) > 0 && !noIPC && + !(config.General.DisableIPCMailto && strings.HasPrefix(opts.Command[0], "mailto:")) && + !(config.General.DisableIPCMbox && strings.HasPrefix(opts.Command[0], "mbox:")) { + response, err := ipc.ConnectAndExec(opts.Command) if err == nil { if response.Error != "" { -- cgit