aboutsummaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* ui: update vaxis to v0.8.5Tim Culverhouse2024-04-022-3/+3
| | | | | | | | | | | | | Update vaxis library to v0.8.5 which includes several terminal widget fixes: - Tab stop positions were off by 1 - Now reponds to secondary DA queries - Fix encoding of function keys higher than F12 Signed-off-by: Tim Culverhouse <tim@timculverhouse.com> Tested-by: Inwit <inwit@sindominio.net> Acked-by: Robin Jarry <robin@jarry.cc>
* config: make popover dialogs configurableJohannes Thyssen Tishman2024-04-028-39/+85
| | | | | | | | | | | | Add the [ui].dialog-{position,width,height} options in aerc.conf to set the position, width and height of popover dialogs such as the one from :menu, :envelope or :attach -m relative to the main window. Changelog-added: Add `[ui].dialog-{position,width,height}` to set the position, width and height of popover dialogs. Signed-off-by: Johannes Thyssen Tishman <johannes@thyssentishman.com> Reviewed-by: Tim Culverhouse <tim@timculverhouse.com> Acked-by: Robin Jarry <robin@jarry.cc>
* notmuch: add strategies for multi-file messagesJason Cox2024-04-0214-132/+586
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | A single notmuch message can represent multiple files. As a result, file-based operations like move, copy, and delete can be ambiguous. Add a new account config option, multi-file-strategy, to tell aerc how to handle these ambiguous cases. Also add options to relevant commands to set the multi-file strategy on a per-invocation basis. If no multi-file strategy is set, refuse to take file-based actions on multi-file messages. This default behavior is mostly the same as aerc's previous behavior, but a bit stricter in some cases which previously tried to be smart about multi-file operations (e.g., move and delete). Applying multi-file strategies to cross-account copy and move operations is not implemented. These operations will proceed as they have in the past -- aerc will copy/move a single file. However, for cross-account move operations, aerc will refuse to delete multiple files to prevent data loss as not all of the files are added to the destination account. See the changes to aerc-notmuch(5) for details on the currently supported multi-file strategies. Changelog-added: Tell aerc how to handle file-based operations on multi-file notmuch messages with the account config option `multi-file-strategy` and the `-m` flag to `:archive`, `:copy`, `:delete`, and `:move`. Signed-off-by: Jason Cox <me@jasoncarloscox.com> Tested-by: Maarten Aertsen <maarten@nlnetlabs.nl> Acked-by: Robin Jarry <robin@jarry.cc>
* notmuch: simplify moving a messageJason Cox2024-04-021-10/+1
| | | | | | | | | Delete the existing file from the database after indexing the new one to avoid the need to remember and re-apply tags. Signed-off-by: Jason Cox <me@jasoncarloscox.com> Tested-by: Maarten Aertsen <maarten@nlnetlabs.nl> Acked-by: Robin Jarry <robin@jarry.cc>
* notmuch: ignore duplicate msg ID error on deleteJason Cox2024-04-021-1/+1
| | | | | | | | | | | | | | | | | | According to the comments in notmuch.h, removing a file returns NOTMUCH_STATUS_DUPLICATE_MESSAGE_ID when the "filename was removed but the message persists in the database with at least one other filename." Based on the fact that the db.DeleteMessage() function is used in a context that explicitly recognizes the possibility of multiple files and only attempts to delete one of them, I'm fairly certain that the existing behavior of ignoring all errors *except* the deplicate message ID error is the result of a typo. (It also doesn't make sense to ignore other errors, such as NOTMUCH_STATUS_XAPIAN_EXCEPTION.) Cc: Tim Culverhouse <tim@timculverhouse.com> Signed-off-by: Jason Cox <me@jasoncarloscox.com> Tested-by: Maarten Aertsen <maarten@nlnetlabs.nl> Acked-by: Robin Jarry <robin@jarry.cc>
* search: fix crash during message searchjp392024-04-021-5/+3
| | | | | | | | | | Initialize info in SearchMessage irregardless of the message parts flags otherwise it will crash when we attempt to read it in the next switch statement. Fixes: 8464b3738 ("search: use a common api for all workers") Signed-off-by: jp39 <jp39@gmx.com> Acked-by: Robin Jarry <robin@jarry.cc>
* mod: update all dependenciesRobin Jarry2024-04-023-101/+105
| | | | | | | | | | | | | | | | | | Patch produced with the following commands: go mod edit -dropreplace=golang.org/x/crypto go get -t -u go mod tidy I dropped the replace of x/crypto. The only use for the fork from ProtonMail is for openpgp which has been deprecated by the official implementation. And aerc explicitly uses the correct import path where needed. go-smtp update was a bit harsh. The API was changed completely. Signed-off-by: Robin Jarry <robin@jarry.cc> Tested-by: Bence Ferdinandy <bence@ferdinandy.com>
* filters: add matching against attachment filenameBence Ferdinandy2024-03-253-1/+31
| | | | | | | | | | | | The mimetype of attachments are set by the sender, which can results in attachments getting not so useful mimetypes (e.g. application/octet-stream for a csv). Allow matching filter against filenames directly, by adding the `.filename,` and `.filename,~` syntax, similarly to headers. Changelog-added: Match filters on filename via `.filename,~<regexp> =`. Signed-off-by: Bence Ferdinandy <bence@ferdinandy.com> Acked-by: Robin Jarry <robin@jarry.cc>
* docs: update filter tips for imagesBence Ferdinandy2024-03-251-7/+9
| | | | | | | | | | Since aerc uses vaxis, the image/* filter has incorrect information. Update this with the new behaviour. Fixes: 4e26faf498b8 ("msgviewer: implement inline image viewing") Signed-off-by: Bence Ferdinandy <bence@ferdinandy.com> Reviewed-by: Inwit <inwit@sindominio.net> Acked-by: Robin Jarry <robin@jarry.cc>
* docs: correct IMAP IDLE default settingGary Kim2024-03-251-1/+1
| | | | | | | | Correct aerc-imap(5) which currently has the default idle-timeout listed as 10ms even though the actual default is 10s. Signed-off-by: Gary Kim <gary@garykim.dev> Acked-by: Robin Jarry <robin@jarry.cc>
* templates: do not add new line after signatureDaniel Gray2024-03-251-1/+1
| | | | | | | | | The new_message template currently adds a new line after the signature which is an error and not likely what the user expects. Signed-off-by: Daniel Gray <dngray@polarbear.army> Acked-by: Moritz Poldrack <moritz@poldrack.dev> Acked-by: Robin Jarry <robin@jarry.cc>
* mod: update vaxisTim Culverhouse2024-03-102-3/+3
| | | | | | | | | | | | | Update Vaxis to v0.8.4. This version has a few bug fixes relevant to aerc: - Charset handling in the terminal (John) - Various key encoding issues (Robin) - Fix resize race conditions with underlying terminal (inwit, Bence) - Explicit cursor positioning on new rows to fix wrapped selections (Tristan) Signed-off-by: Tim Culverhouse <tim@timculverhouse.com> Acked-by: Robin Jarry <robin@jarry.cc>
* detach: add glob supportTristan Partin2024-03-102-4/+43
| | | | | | | | | This matches the behavior of :attach. Changelog-added: The `:detach` command now understands globs similar to `:attach`. Signed-off-by: Tristan Partin <tristan@partin.io> Acked-by: Robin Jarry <robin@jarry.cc>
* quit: add :q aliasTristan Partin2024-03-102-2/+3
| | | | | | | | | | | | This used to work, but after f3a61a34 (where :query) was added, we had two commands which then started with q. So, the automatic alias stopped working. Changelog-added: Specify a ":q" alias for quit. Signed-off-by: Tristan Partin <tristan@partin.io> Acked-by: Moritz Poldrack <moritz@poldrack.dev> Acked-by: Robin Jarry <robin@jarry.cc>
* mk: allow overriding install binaryRobin Jarry2024-03-101-3/+4
| | | | | | | | | | | This can be used by downstream packaging to force specific options. E.g.: make install INSTALL="/usr/bin/install -p" Signed-off-by: Robin Jarry <robin@jarry.cc> Tested-by: Gavin-John Noonan <mail@gjnoonan.co.uk> Reviewed-by: Gavin-John Noonan <mail@gjnoonan.co.uk>
* gpg: use export-minimal when attaching public keyRobin Jarry2024-03-101-1/+2
| | | | | | | | | | | Depending on how many signatures the public key has, it may be very large. The key signatures are not required to verify the authenticity of an email. Link: https://lists.sr.ht/~rjarry/aerc-devel/%3CCZKDO3ETIOAI.1DDOYI8Z8LY5O%40cepl.eu%3E Reported-by: Matěj Cepl <mcepl@cepl.eu> Signed-off-by: Robin Jarry <robin@jarry.cc> Tested-by: Matěj Cepl <mcepl@cepl.eu>
* gpg: fix mime-version header positionRobin Jarry2024-03-102-11/+27
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Some MTAs try to normalize the case of all headers (including signed text parts headers). Unfortunately, Mime-Version can be normalized to different casing depending on the implementation (MIME- vs Mime-). Since the signature is computed on the whole part, including its header, changing the case can cause the signature to become invalid. Due to how multipart/signed messages are constructed, we need to hack around go-message writers to intercept the writing of a text part, compute its signature and write the actual message with the proper headers. Unfortunately, go-message does not allow creating a message writer that does not insert a Mime-Version header. This causes the Mime-Version header to be inserted in the wrong place: it is put inside the signed text part header instead on the top level header. Thus, included in the signed content. Make sure to remove any Mime-Version header from the signed part header. Finally, ensure that Mime-Version is set on the top-level header so that messages are compliant with RFC 2045. Fixes: https://todo.sr.ht/~rjarry/aerc/143 Link: https://github.com/emersion/go-message/issues/165 Link: https://github.com/emersion/go-pgpmail/pull/15 Link: https://lists.sr.ht/~rjarry/aerc-devel/%3CCQRPF5EA0TF8.PEJ4AKCEGMFM%40fembook%3E Changelog-fixed: `Mime-Version` is no longer inserted in signed text parts headers. MTAs normalizing header case will not corrupt signatures anymore. Reported-by: Coco Liliace <chloe@liliace.dev> Reported-by: Kirill Chibisov <contact@kchibisov.com> Signed-off-by: Robin Jarry <robin@jarry.cc> Tested-by: Tim Culverhouse <tim@timculverhouse.com>
* templates: add visual mode indicator to TrayInfoJason Cox2024-03-045-2/+29
| | | | | | | | | | | It's useful to have some indicator of whether or not aerc is in visual mark mode. Add such an indicator to the TrayInfo available in the status line. Changelog-changed: The `TrayInfo` template variable now includes a visual mark mode indicator. Signed-off-by: Jason Cox <me@jasoncarloscox.com> Acked-by: Robin Jarry <robin@jarry.cc>
* commands: rename confusing constantsRobin Jarry2024-03-0441-47/+45
| | | | | | | | There is an overlap between ACCOUNT and MESSAGE. Rename ACCOUNT to MESSAGE_LIST and use MESSAGE_LIST|MESSAGE_VIEWER instead of MESSAGE. Signed-off-by: Robin Jarry <robin@jarry.cc> Reviewed-by: Tim Culverhouse <tim@timculverhouse.com>
* mk: add validate targetRobin Jarry2024-03-043-12/+7
| | | | | | | | | | Instead of hiding the actual checks deep into the CI framework and into the sendemail-validate hook, add a validate make target that uses proper variables and runs the required checks. Use it in the sendemail-validate hook and the CI builds. Signed-off-by: Robin Jarry <robin@jarry.cc> Reviewed-by: Bence Ferdinandy <bence@ferdinandy.com>
* contrib: use sed -E for shell scriptsMaarten Aertsen2024-02-294-11/+11
| | | | | | | | | The + character is not part of the 'basic regular expressions' in BSD grep. Use -E to enable extended (modern) regular expressions. Also remove escaping. This makes the commit msg hook work on macOS 14.2. Signed-off-by: Maarten Aertsen <maarten@nlnetlabs.nl> Signed-off-by: Robin Jarry <robin@jarry.cc>
* aerc-stylesets: document msglist_thread_contextMaarten Aertsen2024-02-281-0/+3
| | | | | | | | | | Document the msglist_thread_context styleset object that allows styling the additional messages displayed when using the show-thread-context option. Fixes: 4ec1e1a5e4c7 ("ui: enable showing of thread-context") Signed-off-by: Maarten Aertsen <maarten@nlnetlabs.nl> Acked-by: Robin Jarry <robin@jarry.cc>
* imap: drain updates channel when moving messagesKoni Marti2024-02-261-0/+3
| | | | | | | | | | | | | Drain the updates channel when moving messages to prevent a backend freeze. This also fixes a possible freeze for large-scale archive operations since the archive command uses the move operation. Reported-by: Moritz Poldrack <moritz@poldrack.dev> Signed-off-by: Koni Marti <koni.marti@gmail.com> Tested-by: Jeremy Baxter <jtbx@disroot.org> Tested-by: Moritz Poldrack <moritz@poldrack.dev> Acked-by: Robin Jarry <robin@jarry.cc>
* release: improve generated emailRobin Jarry2024-02-261-34/+63
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Do not hard wrap changelog entries. * Add changes to go.mod to help downstream packagers * Improve dry run to show the generated email instead of just printing the changelog. Example output for 0.17.0: From: Robin Jarry <robin@jarry.cc> To: aerc-annouce <~rjarry/aerc-announce@lists.sr.ht> Cc: aerc-devel <~rjarry/aerc-devel@lists.sr.ht> Bcc: aerc <~sircmpwn/aerc@lists.sr.ht>, Robin Jarry <robin@jarry.cc> Reply-To: aerc-devel <~rjarry/aerc-devel@lists.sr.ht> Subject: aerc 0.17.0 User-Agent: aerc/0.17.0 Message-ID: <20240201091423.4YZK4ZQ3XVKJ@ringo> Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset=UTF-8 MIME-Version: 1.0 Hi all, I am glad to announce the release of aerc 0.17.0. https://git.sr.ht/~rjarry/aerc/refs/0.17.0 Release highlights: # Added - New `flagged` criteria for `:sort`. - New `:send-keys` command to control embedded terminals. - Account aliases now support fnmatch-style wildcards. - New `:suspend` command bound to `<C-z>` by default. - Disable parent context bindings by declaring them empty. - Toggle folding with `:fold -t`. - `mail-deleted` hook that triggers when a message is removed/moved from a folder. - `mail-added` hook that triggers when a message is added to a folder. - Customize key to trigger completion with `$complete` in `binds.conf`. - Setting `complete-min-chars=manual` in `aerc.conf` now disables automatic completion, leaving only manually triggered completion. - `.ThreadUnread` is now available in templates. - Allow binding commands to `Alt+<number>` keys. - `AERC_ACCOUNT` and `AERC_ADDRESS_BOOK_CMD` are now defined in the editor's environment when composing a message. - Reply with a different account than the current one with `:reply -A <account>`. - New `[ui].tab-title-viewer` setting to configure the message viewer tab title. - The `{{.Subject}}` template is evaluated to the new option `[ui].empty-subject` if the subject is empty. - Change to a folder of another account with `:cf -a <account> <folder>`. - Patch management with `:patch`. - Add filepath to messages in templates as .Filename(s) - New `:menu` command to invoke other aerc commands based on a shell command output. - CLI flags to override paths to config files. - Automatically attach signing key with `pgp-attach-key` in `accounts.conf`. - Copy messages across accounts with `:cp -a <account> <folder>`. - Move messages across accounts with `:mv -a <account> <folder>`. - Support the `draft` flag. - Thread arrow prefixes are now fully configurable. # Fixed - `colorize` support for wildcards `?` and `*`. - Selection of headers in composer after `:compose -e` followed by `:edit -E`. - Don't lose child messages of non-queried parents in notmuch threads - Notmuch folders defined by the query `*` handle search, filter, and unread counts correctly. # Changed - `:open` commands are now executed with `sh -c`. - `:pipe` commands are now executed with `sh -c`. - Improved command completion. - Message viewer tab titles will now show `(no subject)` if there is no subject in the viewed email. - Signature placement is now controlled via the `{{.Signature}}` template variable and not hardcoded. # Changed dependencies for downstream packagers diff --git a/go.mod b/go.mod index 9b712a340a41..a94a7afa11e0 100644 --- a/go.mod +++ b/go.mod @@ -5,0 +6 @@ require ( + git.sr.ht/~rjarry/go-opt v1.3.0 @@ -7,2 +8 @@ require ( - git.sr.ht/~rockorager/tcell-term v0.8.0 - git.sr.ht/~sircmpwn/getopt v1.0.0 + git.sr.ht/~rockorager/tcell-term v0.10.0 @@ -14 +14 @@ require ( - github.com/emersion/go-maildir v0.3.0 + github.com/emersion/go-maildir v0.4.1 @@ -26 +25,0 @@ require ( - github.com/google/shlex v0.0.0-20191202100458-e7afc7fbc510 @@ -33 +32 @@ require ( - github.com/stretchr/testify v1.8.2 + github.com/stretchr/testify v1.8.4 @@ -54,0 +54 @@ require ( + golang.org/x/mod v0.8.0 // indirect Thanks to all contributors! ~$ contrib/git-stats.sh 0.16.0..0.17.0 Author Commits Changed Files Insertions Deletions Robin Jarry 61 650 +4908 -5576 Koni Marti 45 120 +4250 -729 Bence Ferdinandy 15 44 +452 -139 Jason Cox 14 59 +490 -232 Moritz Poldrack 11 19 +170 -568 Vitaly Ovchinnikov 11 27 +379 -38 Inwit 9 32 +497 -103 Johannes Thyssen Tishman 5 8 +292 -63 Sebastien Binet 3 5 +36 -25 Michal Siedlaczek 2 5 +66 -43 Erik Terpstra 1 2 +30 +0 George Honeywood 1 2 +3 -3 Jens Grassel 1 1 +8 +0 Karel Balej 1 1 +1 -1 Max Schillinger 1 1 +0 -1 Nojus Gudinavičius 1 5 +64 +0 Thomas Böhler 1 1 +0 -2 delitako 1 5 +30 -18 Reviewer/Tester Commits Robin Jarry 121 Inwit 31 Moritz Poldrack 28 Koni Marti 22 Bence Ferdinandy 13 Johannes Thyssen Tishman 8 Jason Cox 4 Karel Balej 3 Thomas Böhler 3 Tim Culverhouse 3 Vitaly Ovchinnikov 2 Callum Andrew 1 Ciarán Ainsworth 1 Maarten van Gompel 1 Tristan Partin 1 Signed-off-by: Robin Jarry <robin@jarry.cc>
* commands: add :query to create named notmuch dirsJason Cox2024-02-2610-45/+165
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The current :cf command can be used to create folders for arbitrary notmuch queries. These folders use the query as their namee. In some cases, though, it's useful to give a more human-readable name. Create a new :query command to allow doing so. The :query command accepts an optional -n flag to specify a name. The remaining arguments are interpreted verbatim as a notmuch query. If no name is specified, the query itself is used as the name. For example, to create a new folder with the full thread of the current message, named by its subject, run the following command: :query -n "{{.SubjectBase}}" thread:"{mid:{{.MessageId}}}" :query could have been implemented as an additional flag to :cf. Giving a name to the created folder would make the smantics of :cf strange, though. For example, to create a named query folder, one would use :cf -n <name> <query>. This syntax feels odd; the name of the folder seems like it ought to be the positional argument of the change folder command. Alternatively, the usage could be :cf -q <query> <name>, but this feels wrong as well: the query, which is provided as a positional parameter when no name is specified, becomes a flag parameter when a name is specified. What's more, both of these potential usages add a notmuch-specific flag to an otherwise general command. Creating a new command feels cleaner. Perhaps the current query functionality of the :cf command could eventually be deprecated to remove the duplicate functionality and keep :cf limited to changing to existing folders. Changelog-added: Create notmuch named queries with the `:query` command. Signed-off-by: Jason Cox <me@jasoncarloscox.com> Tested-by: Inwit <inwit@sindominio.net> Acked-by: Robin Jarry <robin@jarry.cc>
* imap: drain updates channel when deleting messagesKoni Marti2024-02-261-0/+40
| | | | | | | | | | | | | Drain the buffered updates channel when deleting messages to prevent a backend freeze. Unilateral update messages from the IMAP server can fill up the buffered channel if not handled during a large operation (more than ~50 messages). Link: https://lists.sr.ht/~rjarry/aerc-discuss/%3CCZCPBTWI3PIW.T8MWNCBG7FGL%40disroot.org%3E Changelog-fixed: Prevent a freeze for large-scale deletions with IMAP. Signed-off-by: Koni Marti <koni.marti@gmail.com> Tested-by: Jeremy Baxter <jtbx@disroot.org> Acked-by: Robin Jarry <robin@jarry.cc>
* ui: update vaxis and only use disambiguate csi-u flagTim Culverhouse2024-02-263-3/+4
| | | | | | | | | | | | | | | | | | Update vaxis to 0.8.2, which adds the ability to specify any CSI-u flag combination. Explicitly only use the disambiguate flag. This enables aerc to have additional keybinds not previously possible (C-i, C-m) while preventing some internal logic bugs relating to single-modifier key presses. While these events can be useful, they are not needed in aerc and aerc currently would need several workarounds to properly handle them so let's just not request them in the first place. Fixes a bug with encoding shift+space in the presence of CSI-u in the terminal widget Signed-off-by: Tim Culverhouse <tim@timculverhouse.com> Tested-by: Inwit <inwit@sindominio.net> Tested-by: Jason Cox <dev@jasoncarloscox.com> Acked-by: Robin Jarry <robin@jarry.cc>
* ipc: fix deadlock when aerc is not runningRobin Jarry2024-02-221-4/+7
| | | | | | | | | | | | | Defer the execution of failed IPC commands *after* the IPC socket has been unblocked. Fixes: fd4dd4240885 ("ipc: wait for app to be ready before accepting commands") Fixes: https://todo.sr.ht/~rjarry/aerc/229 Changelog-fixed: Deadlock when running `aerc mailto:foo@bar.com` without another instance of aerc already running. Reported-by: Skejg <grolleman@zoho.com> Signed-off-by: Robin Jarry <robin@jarry.cc> Reviewed-by: Tim Culverhouse <tim@timculverhouse.com>
* commands: remove compose commands from message viewerRobin Jarry2024-02-221-1/+1
| | | | | | | | | | | | | | | | All compose commands were made available in the message viewer context by mistake. Remove them. This fixes a crash when the :send command is invoked while viewing a message: Fixes: 159fb38daf53 ("commands: refactor registration") Fixes: https://lists.sr.ht/~rjarry/aerc-devel/%3CCZ01NTGWNUBV.14A9POG9ITJ6F%40posteo.net%3E Changelog-fixed: Fixed crash when running `:send` with a `:preview` tab focused. Reported-by: Sertonix <sertonix@posteo.net> Signed-off-by: Robin Jarry <robin@jarry.cc> Tested-by: Maarten Aertsen <maarten@nlnetlabs.nl>
* msglist: allow configuring default splitRobin Jarry2024-02-225-17/+88
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add a new setting to configure the default split layout for message list tabs. The syntax is a bit different from the :split and :vsplit commands since it needs to convey the direction in the value as well. I didn't reuse split/vsplit since they are a bit confusing when used in a configuration file. The syntax is as follows: message-list-split = [<direction>] <size> The direction is optional and defaults to horizontal. The size is the number of terminal cells that will be used to display the message list. All these examples are equivalent: message-list-split = horiz 12 message-list-split = h 12 message-list-split = 12 Same idea for vertical splits: message-list-split = vertical 120 message-list-split = vert 120 message-list-split = v 120 Both :split and :vsplit commands remain usable as before. The configuration options only affect the initial layout at startup. Add config.SPLIT_* constants and sanitize AccountView.{Split,Vsplit} methods. Changelog-added: Configure default message list `:split` or `:vsplit` on startup with `message-list-split` in `aerc.conf`. Signed-off-by: Robin Jarry <robin@jarry.cc> Tested-by: Tim Culverhouse <tim@timculverhouse.com>
* ui: enable CSIu key encodingTim Culverhouse2024-02-221-2/+8
| | | | | | | | | | | | | | Enable CSIu key encoding protocol when support is detected. This will enable keybinds which traditionally have been unavailable due to conflicting with other keys (C-i, C-m, C-[, etc). Remove numlock and capslock from all keypresses to prevent interfering with key matching. Changelog-added: Virtually any key binding can now be configured in `binds.conf`, including Shift+Alt+Control modifier combinations. Signed-off-by: Tim Culverhouse <tim@timculverhouse.com> Acked-by: Robin Jarry <robin@jarry.cc>
* binds: refactor parser to be more tolerantTim Culverhouse2024-02-223-272/+64
| | | | | | | | Refactor the bind parser to construct arbitrary modified keys instead of only relying on built in maps. Add additional tests to cover edge cases. Signed-off-by: Tim Culverhouse <tim@timculverhouse.com> Acked-by: Robin Jarry <robin@jarry.cc>
* revert: "ui: enable kitty keyboard protocol"Robin Jarry2024-02-191-1/+2
| | | | | | | | | | | | | | This reverts commit d73cf33c2c6c3e564ce8aff04acc329a06eafc54. This breaks virtually all key bindings on foot. Almost zero ctrl- bindings work, and even in some cases, single key binds, like n don't register anymore. It looked harmless, but I should probably have tested before applying this. Signed-off-by: Robin Jarry <robin@jarry.cc> Acked-by: Tim Culverhouse <tim@timculverhouse.com>
* readme: rename default log exampleRobin Jarry2024-02-191-1/+1
| | | | | | | Now that this feaking log folder has moved away, we can finally redirect to a file named log. Signed-off-by: Robin Jarry <robin@jarry.cc>
* ui: enable kitty keyboard protocolTim Culverhouse2024-02-191-2/+1
| | | | | | | | | | | | Enable kitty keyboard protocol when support is detected. This will enable keybinds which traditionally have been unavailable due to conflicting with other keys (C-i, C-m, C-[, etc). Reported-by: Jonathan Dowland <jon+aerc-discuss@dow.land> Signed-off-by: Tim Culverhouse <tim@timculverhouse.com> Tested-by: Jonathan Dowland <jon@dow.land> Acked-by: Robin Jarry <robin@jarry.cc>
* ui: update vaxisTim Culverhouse2024-02-192-4/+4
| | | | | | | | | | | | | | | Update vaxis to v0.7.4. Release notes: - Fix encoding of Ctrl+z in legacy key encodings - Add new grapheme width calc mode: nozwj where we handle VS16 and skintone selectors but _not_ zwjs - Enable forcing of grapheme width calc mode - Add styled underlines to terminal widget Signed-off-by: Tim Culverhouse <tim@timculverhouse.com> Tested-by: Julio B <julio.bacel@gmail.com> Acked-by: Moritz Poldrack <moritz@poldrack.dev> Acked-by: Robin Jarry <robin@jarry.cc>
* ipc: accept verbatim commandsJason Cox2024-02-192-2/+14
| | | | | | | | | | | | | | | | | | | | | | | When aerc receives a command over IPC, it quotes the arguments before passing them on to the internal command parser. In many cases, the parser interprets the quotes, and the command runs with the arguments exactly as they were specified in the shell. In some cases, though, the quotes are not interpreted and the additional quotes can cause the command to fail. Simply eliminating the addition of quotes is not possible because some commands need them. Allow a command and its arguments to be specified as a single argument in the shell. In that case, pass that argument verbatim to the internal command parser so that it is interpreted exactly as if it had been typed directly in aerc's command line. Link: https://lists.sr.ht/~rjarry/aerc-devel/%3C20240203085541.27416-2-contact%40willowbarraco.fr%3E Changelog-added: Execute IPC commands verbatim by providing the command and its args as a single argument in the shell. Cc: Willow Barraco <contact@willowbarraco.fr> Signed-off-by: Jason Cox <me@jasoncarloscox.com> Acked-by: Robin Jarry <robin@jarry.cc>
* status: make message counts available in templatesJason Cox2024-02-191-0/+1
| | | | | | | | | Make .Recent, .Unread, .Exists, and .RUE work in statusline templates. Changelog-added: Message counts are available in statusline templates. Signed-off-by: Jason Cox <me@jasoncarloscox.com> Acked-by: Robin Jarry <robin@jarry.cc>
* format: remove unused codeTim Culverhouse2024-02-191-27/+0
| | | | | | | | Remove unused TruncateHead function. Signed-off-by: Tim Culverhouse <tim@timculverhouse.com> Acked-by: Robin Jarry <robin@jarry.cc>
* stylesets/nord: change border styleJonathan Dowland2024-02-191-1/+1
| | | | | | | | | | Replace a reverse-video black-on-white border, inherited from default, which does not match the rest of the "nord" style, with a thinner line border, using a fg value that ties into the theme better. Signed-off-by: Jonathan Dowland <jon@dow.land> Acked-by: Robin Jarry <robin@jarry.cc>
* store: fix split view blinkingNicolas Dichtel2024-02-151-10/+14
| | | | | | | | | | | | | | | | | | | | | When split view and threading mode are enabled, the message is blinking. First, since commit ddfa5cac1fe9 ("msgstore: fix deadlock in thread builder"), the threadCallback is never set to nil: the thread builder calls it continuously. After setting it to nil, the message is still blinking once. To avoid this, don't call the onSelect method (which points to AccountView.updateSplitView()) from the thread builder: the message is already displayed. Let's rewrite Select and selectPriv: - Select(): it takes the lock and calls the onSelect callback; - selectPriv: the assumption is that the lock is held. It doesn't call the onSelect callback. This function is only used by the thread builder. Fixes: 588be1a28422 ("store: improve cursor position") Fixes: ddfa5cac1fe9 ("msgstore: fix deadlock in thread builder") Signed-off-by: Nicolas Dichtel <nicolas.dichtel@6wind.com> Acked-by: Robin Jarry <robin@jarry.cc>
* commands: allow to forward from emlKoni Marti2024-02-141-7/+25
| | | | | | | | | | | Forward messages from the message viewer when they are opened with :eml (e.g. rfc822 attachments). Those messages have no associated message store and currently :forward would complain about that. References: https://todo.sr.ht/~rjarry/aerc/227 Signed-off-by: Koni Marti <koni.marti@gmail.com> Acked-by: Robin Jarry <robin@jarry.cc>
* commands: allow to reply to emlKoni Marti2024-02-141-6/+11
| | | | | | | | | | | | | | | | Reply to messages in the message viewer that were opened with :eml (e.g. rfc822 attachments). Those messages have no associated message store and currently :reply would complain about that. However, we can still use the message data to create a reply, but we would have to disable setting the replied flag and/or archiving messages (obviously, these operations don't make sense for such messages in the first place). Implements: https://todo.sr.ht/~rjarry/aerc/227 Signed-off-by: Koni Marti <koni.marti@gmail.com> Acked-by: Robin Jarry <robin@jarry.cc>
* binds: allow account and folder binds to coexistJason Cox2024-02-141-0/+6
| | | | | | | | | | | | | | | | | | | | | When loading binds, account-specific binds are first applied, and then folder-specific binds are applied. However, in the process of merging the account-specific binds with the general binds, the folder-specific binds are lost. As a result, if both account- and folder-specific binds exist, the folder-specific binds will do nothing when in the specified account. The following minimal binds.conf reproduces this behavior: [messages] [messages:account=<ACCOUNT>] [messages:folder=<FOLDER>] q = :quit<Enter> Fix this issue by ensuring contextual binds are preserved when merging. Changelog-fixed: Allow account- and folder-specific binds to coexist. Signed-off-by: Jason Cox <me@jasoncarloscox.com> Acked-by: Robin Jarry <robin@jarry.cc>
* lint: update dependencies to work with go v1.22Jason Cox2024-02-143-16/+18
| | | | | | | | | | Linting with golangci-lint and contrib/linters.go both started crashing for me after upgrading go to v1.22.0 from v1.21.7. Bump golangci-lint and golang.org/x/tools to their latest versions to fix this problem. Signed-off-by: Jason Cox <me@jasoncarloscox.com> Acked-by: Robin Jarry <robin@jarry.cc>
* hooks: add Message-ID to variables for mail-receivedMoritz Poldrack2024-02-142-0/+2
| | | | | | | | | | | | When scripting for the mail-received hook, it can be useful to identify a mail in a maildir. In that case the Message-ID might be one of the most useful parameters to go for identifying the file of a message. Changelog-changed: Add Message-ID to the variables of `[hooks].mail-received`. Suggested-by: Kirill Chibisov <contact@kchibisov.com> Signed-off-by: Moritz Poldrack <git@moritz.sh> Acked-by: Robin Jarry <robin@jarry.cc>
* colorize: preserve defaults unless overriddenRobin Jarry2024-02-1410-6/+53
| | | | | | | | | | | | | | | To be consistent with stylesets for the rest of aerc's UI, settings in the [viewer] section now only override the default colorize theme. Implements: https://todo.sr.ht/~rjarry/aerc/222 Changelog-changed: The `[viewer]` section of stylesets now preserve default values as documented in `aerc-stylesets(7)` unless explicitly overridden. Requested-by: Karel Balej <balejk@matfyz.cz> Signed-off-by: Robin Jarry <robin@jarry.cc> Tested-by: Karel Balej <balejk@matfyz.cz> Tested-by: Matěj Cepl <mcepl@cepl.eu> Tested-by: Nicolas Dichtel <nicolas.dichtel@6wind.com>
* colorize: adapt default style for light backgroundsRobin Jarry2024-02-145-53/+68
| | | | | | | | | | | | | | | | | | | | | The current default theme is unusable on light backgrounds. Some colors are too light and are almost invisible. Use only palette colors to ensure that everything is customizable by the user. I tested this with white on black, grey on dark purple, black on yellow, black on white. Text remains readable everywhere. Update stylesets that don't use these new defaults to explicitly override them. Changelog-changed: The default `colorize` theme has been changed to use the base terminal colors. Cc: Jason Cox <me@jasoncarloscox.com> Reported-by: Matěj Cepl <mcepl@cepl.eu> Signed-off-by: Robin Jarry <robin@jarry.cc> Tested-by: Nicolas Dichtel <nicolas.dichtel@6wind.com>
* config: improve styleset error reportingRobin Jarry2024-02-143-6/+8
| | | | | | | | | Include the styleset filepath and exact statement that caused the error. Remove the "failed to load config: " prefix in the error message. The line is often very long already. Signed-off-by: Robin Jarry <robin@jarry.cc> Tested-by: Nicolas Dichtel <nicolas.dichtel@6wind.com>
* config: change default appearanceRobin Jarry2024-02-148-202/+230
| | | | | | | | | | | | | | | | | | | The default styleset and ui settings are quite dull and don't make use of the "newer" features that have been added to aerc in the past two years. Change the default styleset to something more colorful that renders correctly on both dark and light backgrounds. Change the default ui settings to get something more appealing to new users. Save the previous default color theme to a new `monochrome` styleset. Changelog-changed: The default `[ui]` settings and the `default` styleset have changed extensively. A no-color theme can be restored with the `monochrome` styleset. Cc: Marc Coquand <marc@mccd.space> Signed-off-by: Robin Jarry <robin@jarry.cc> Tested-by: Nicolas Dichtel <nicolas.dichtel@6wind.com>