aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--CHANGELOG.md4
-rw-r--r--config/aerc.conf5
-rw-r--r--doc/aerc-config.5.scd5
-rw-r--r--widgets/msgviewer.go5
4 files changed, 16 insertions, 3 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 0af1cb45..3c7c3764 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -35,6 +35,10 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
- Names formatted like "Last Name, First Name" are better supported in templates
- Composing an email is now aborted if the text editor exits with an error
(e.g. with `vim`, abort an email with `:cq`).
+- Aerc builtin filters path (usually `/usr/libexec/aerc/filters`) is now
+ **prepended** to the default system `PATH` to avoid conflicts with installed
+ distro binaries which have the same name as aerc builtin filters (e.g.
+ `/usr/bin/colorize`).
## [0.15.2](https://git.sr.ht/~rjarry/aerc/refs/0.15.2) - 2023-05-11
diff --git a/config/aerc.conf b/config/aerc.conf
index 79a3936a..3eb30c45 100644
--- a/config/aerc.conf
+++ b/config/aerc.conf
@@ -469,7 +469,7 @@
# Filters allow you to pipe an email body through a shell command to render
# certain emails differently, e.g. highlighting them with ANSI escape codes.
#
-# The commands are invoked with sh -c. The following folders are appended to
+# The commands are invoked with sh -c. The following folders are prepended to
# the system $PATH to allow referencing filters from their name only:
#
# ${XDG_CONFIG_HOME:-~/.config}/aerc/filters
@@ -480,6 +480,9 @@
# /usr/libexec/aerc/filters
# /usr/share/aerc/filters
#
+# If you want to run a program in your default $PATH which has the same name
+# as a builtin filter (e.g. /usr/bin/colorize), use its absolute path.
+#
# The following variables are defined in the filter command environment:
#
# AERC_MIME_TYPE the part MIME type/subtype
diff --git a/doc/aerc-config.5.scd b/doc/aerc-config.5.scd
index 0cdad99b..e420d52c 100644
--- a/doc/aerc-config.5.scd
+++ b/doc/aerc-config.5.scd
@@ -664,7 +664,7 @@ _/usr/libexec/aerc/filters_). Note that these may have additional dependencies
that aerc does not have alone.
The filter commands are invoked with _sh -c command_. The following folders are
-appended to the system *$PATH* to allow referencing filters from their name only.
+prepended to the system *$PATH* to allow referencing filters from their name only.
```
${XDG_CONFIG_HOME:-~/.config}/aerc/filters
@@ -676,6 +676,9 @@ $PREFIX/share/aerc/filters
/usr/share/aerc/filters
```
+If you want to run a program in your default *$PATH* which has the same
+name as a builtin filter (e.g. _/usr/bin/colorize_), use its absolute path.
+
The following variables are defined in the filter command environment:
*AERC_MIME_TYPE*
diff --git a/widgets/msgviewer.go b/widgets/msgviewer.go
index 987d3133..d1bee8c6 100644
--- a/widgets/msgviewer.go
+++ b/widgets/msgviewer.go
@@ -598,9 +598,12 @@ func NewPartViewer(
var noFilter *ui.Grid
if filter != nil {
path, _ := os.LookupEnv("PATH")
+ var paths []string
for _, dir := range config.SearchDirs {
- path += fmt.Sprintf(":%s/filters", dir)
+ paths = append(paths, dir+"/filters")
}
+ paths = append(paths, path)
+ path = strings.Join(paths, ":")
filter.Env = os.Environ()
filter.Env = append(filter.Env, fmt.Sprintf("PATH=%s", path))
filter.Env = append(filter.Env,