diff options
-rw-r--r-- | config/aerc.conf | 12 | ||||
-rw-r--r-- | config/general.go | 2 | ||||
-rw-r--r-- | doc/aerc-config.5.scd | 12 | ||||
-rw-r--r-- | main.go | 5 |
4 files changed, 30 insertions, 1 deletions
diff --git a/config/aerc.conf b/config/aerc.conf index 70f07949..5fa1e6f1 100644 --- a/config/aerc.conf +++ b/config/aerc.conf @@ -45,6 +45,18 @@ # Default: false #disable-ipc=false +# Don't run mailto:... commands over IPC; start a new aerc instance with the +# composer instead. +# +# Default: false +#disable-ipc-mailto=false +# +# Don't run mbox:... commands over IPC; start a new aerc instance with the mbox +# file instead. +# +# Default: false +#disable-ipc-mbox=false + # Set the $TERM environment variable used for the embedded terminal. # # Default: xterm-256color diff --git a/config/general.go b/config/general.go index 6dc674b0..6fd37dcf 100644 --- a/config/general.go +++ b/config/general.go @@ -17,6 +17,8 @@ type GeneralConfig struct { LogFile string `ini:"log-file"` LogLevel log.LogLevel `ini:"log-level" default:"info" parse:"ParseLogLevel"` DisableIPC bool `ini:"disable-ipc"` + DisableIPCMailto bool `ini:"disable-ipc-mailto"` + DisableIPCMbox bool `ini:"disable-ipc-mbox"` EnableOSC8 bool `ini:"enable-osc8" default:"false"` Term string `ini:"term" default:"xterm-256color"` DefaultMenuCmd string `ini:"default-menu-cmd"` diff --git a/doc/aerc-config.5.scd b/doc/aerc-config.5.scd index fae2abc2..d457e0ab 100644 --- a/doc/aerc-config.5.scd +++ b/doc/aerc-config.5.scd @@ -70,6 +70,18 @@ These options are configured in the *[general]* section of _aerc.conf_. Default: _false_ +*disable-ipc-mailto* = _true_ | _false_ + Don't run _mailto:..._ commands over IPC; start a new aerc instance with the + composer instead. + + Default: _false_ + +*disable-ipc-mbox* = _true_ | _false_ + Don't run _mbox:..._ commands over IPC; start a new aerc instance with the + mbox file instead. + + Default: _false_ + *term* = _<TERM>_ Set the $TERM environment variable used for the embedded terminal. @@ -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 != "" { |