chore: rebase fork onto upstream aerc master (0.22+) #2
No reviewers
Labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
public/aerc!2
Loading…
Reference in a new issue
No description provided.
Delete branch "sync/upstream-2026-10"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Rebases the fork onto upstream aerc
master(0.22.0-34-g0d169b79, +228 commits over our 0.21.0 base).Landing: this is a rebase, so the history is linear and does not share commits with the current
release/mirus. Land it by fast-forwarding/force-updatingrelease/mirusto this branch, not with a merge commit.Kept (rebased)
:ai-summarize/ask/draft/translate/ai), CLI provider, result pagerrefactor(ai)moves[ai]onto upstream's atomic config pattern and the newFetchBodyPart(ctx, …)APIDropped (superseded upstream)
0d3d75cc), same# labelannotations from binds.conf. Config:which-key-enabled/-delay→keyhint/keyhint-delay; styleswhichkey_*→keyhint_*(dotfiles-local updated).51fd25c0, todo #319).Verification
go build ./...,go test -vet=off ./...: all passaerc.fork-0.21-whichkey)🤖 Generated with Claude Code
https://claude.ai/code/session_012S3mRY7CzPt8r9zhPWBZjz
When reloading the configuration with :reload, global variables in the config package are reset to their startup values and then, the config is parsed from disk. While the parsing is done, these variables are temporarily in an inconsistent and possibly invalid state. When commands are executed interactively from aerc, they are handled by the main goroutine which also deals with UI rendering. No UI render will be done while :reload is in progress. However, the IPC socket handler runs in an independent goroutine. This has the unfortunate side effect to let the UI goroutine to run while config parsing is in progress and causes crashes: [signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0x6bb142] goroutine 1 [running]: git.sr.ht/~rjarry/aerc/lib/log.PanicHandler() lib/log/panic-logger.go:51 +0x6cf panic({0xc1d960?, 0x134a6e0?}) /usr/lib/go/src/runtime/panic.go:783 +0x132 git.sr.ht/~rjarry/aerc/config.(*StyleConf).getStyle(0xc00038b908?, 0x4206b7?) config/style.go:386 +0x42 git.sr.ht/~rjarry/aerc/config.StyleSet.Get({0x0, 0x0, 0x0, {0x0, 0x0, 0x0}}, 0x421a65?, 0x0) config/style.go:408 +0x8b git.sr.ht/~rjarry/aerc/config.(*UIConfig).GetStyle(...) config/ui.go:379 git.sr.ht/~rjarry/aerc/lib/ui.(*TabStrip).Draw(0xc000314700, 0xc000192230) lib/ui/tab.go:378 +0x15b git.sr.ht/~rjarry/aerc/lib/ui.(*Grid).Draw(0xc000186fc0, 0xc0002c25f0) lib/ui/grid.go:126 +0x28e git.sr.ht/~rjarry/aerc/app.(*Aerc).Draw(0x14b9f00, 0xc0002c25f0) app/aerc.go:192 +0x1fe git.sr.ht/~rjarry/aerc/lib/ui.Render() lib/ui/ui.go:155 +0x16b main.main() main.go:310 +0x997 Make the reload operation safe by changing how config objects are exposed and updated. Change all objects to be atomic pointers. Expose public functions to access their value atomically. Only update their value after a complete and successful config parse. This way the UI thread will always have access to a valid configuration. NB: The account configuration is not included in this change since it cannot be reloaded. Fixes: https://todo.sr.ht/~rjarry/aerc/319 Reported-by: Anachron <[email protected]> Signed-off-by: Robin Jarry <[email protected]>This is basically an 'æ' character enclosed in a '@' character followed by a '_' character. An icon version is enclosed in a mini terminal. .@@@@@@@@@@@@@@@@@@@. @@@@@@@@. @@@@@@@ @@@@@@ @@@@@% @@@@& .-@@@@%. @@@@@. @@@@@ @@@@ @@@@@@@@@@@@* @@@@@@@@@@ @@@@. @@@@ `@ ,@@@@@@ @@@. @@@& @@@* .@@@@ @@@ @@@. @@@@ @@@ @@@ @@@@ /@@@ @@@ @@@ (@@@ @@@@ @@@@@@@@@@@@@@@@@@@@@@@@@@@ &@@@ @@@@ @@@@@ @@@ @@@@ *@@@ @@@@ @@@ @@@@ @@@@ @@@@ @@@@, @@@@ @@@# @@@@ %@@@@@/ .@@@@. @@@@ @@@@@ .@@@, @@@@@/ &@@@@@ @@@@/ @@@@@@@@ @@@@@@@@@@@ @@@@@ @@@@@@ @@@@ &@@@@@@@& &@@@@@@@ @@@@@@@@@@@@@@@@@@@ @@@@@@@@@ Install the icon and reference it in the XDG .desktop file. Reference the logo in README.md for maximum enjoyment. Signed-off-by: Robin Jarry <[email protected]> Acked-by: Moritz Poldrack <[email protected]>If you start aerc with mouse mode activated and you happen to touch the mouse, you might encounter this crash [1]. The problem is that if the grid has not been drawn yet, reflow has not been called, hence {row,column}Layout is nil, and we crash accessing their elements. There might be ways to better synchronize things (?), but the easiest is to simply ignore mouse events if {row,column}Layout is nil; this is what this patch does. [1] panic: runtime error: slice bounds out of range [:2] with capacity 0 goroutine 1 [running]: git.sr.ht/~rjarry/aerc/lib/log.PanicHandler() git.sr.ht/~rjarry/aerc/lib/log/panic-logger.go:51 +0x6cf panic({0xc8c660?, 0xc001914000?}) runtime/panic.go:792 +0x132 git.sr.ht/~rjarry/aerc/lib/ui.(*Grid).MouseEvent(0xc000162090, 0x63, 0x16, {0xc9ac60?, 0xc000414440?}) git.sr.ht/~rjarry/aerc/lib/ui/grid.go:144 +0x5a6 git.sr.ht/~rjarry/aerc/app.(*AccountView).MouseEvent(0x142db50?, 0xcd1640?, 0xc0000478f0?, {0xc9ac60?, 0xc000414440?}) git.sr.ht/~rjarry/aerc/app/account.go:192 +0x25 [...] Signed-off-by: Simon Martin <[email protected]> Acked-by: Robin Jarry <[email protected]>I've setup aerc to use a message split and display the Message-Id header, and have been experiencing a few crashes upon (I think) opening new messages. Here's an excerpt of the associated stack trace: [signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0x10967aa01] goroutine 1 [running]: git.sr.ht/~rjarry/aerc/lib/log.PanicHandler() git.sr.ht/~rjarry/aerc/lib/log/panic-logger.go:51 +0x6cf panic({0x10994e6c0?, 0x10a072b40?}) runtime/panic.go:792 +0x132 git.sr.ht/~rjarry/aerc/app.fmtHeader(0xc0045ab130, {0xc00011ee8c, 0xa}, {0x109952f40, 0x1b}, {0x0, 0x0}, {0x0, 0x0}, {0x0, ...}) git.sr.ht/~rjarry/aerc/app/msgviewer.go:193 +0x381 The problem is that we happily dereference msg.RFC822Headers in fmtHeaders, that happens to be nil. While it's not clear why that happens (it could be linked to the fact we're working on a message we're fetching (?)), we should definitely check RFC822Headers against nil before dereferencing it. Signed-off-by: Simon Martin <[email protected]> Acked-by: Robin Jarry <[email protected]>Currently, the aerc icon is installed to: /usr/share/icons/hicolor/scalable/apps/aerc.svg/icon.svg ^^^^^^^^^ The install_file macro expects an installation directory, not file path. Rename the source file so that the target install path is correct. Fixes:29413dc783("contrib: add application icon and logos") Reported-by: Matěj Cepl <[email protected]> Signed-off-by: Robin Jarry <[email protected]> Tested-by: Matěj Cepl <[email protected]> Reviewed-by: Simon Martin <[email protected]>Just as prior to this commit, the GMail extension for labels is used towards servers where the X-GM-EXT-1 capability is available. For other servers, this commit adds storing labels using keyword flags, if PERMANENTFLAGS is either empty or allows `\*`, in accordance with section 6.3.2 of rfc9051. No feature validation has been done with either GMail nor Proton, as I don't have accounts setup for either of those providers. Labels are not visible by default. Taking inspiration from something like these lines and adding to the appropriate sections of the configuration can make them show up in the UI: column-subject = {{if .Labels}}{{.Labels | join " "}}|{{ end }}{{.Subject}} header-layout = From|To,Cc|Bcc,Date,Subject,Labels Existing unit test coverage for imap is sparse. This commit does not change that fact, as it is hard do see test cases which might be meaningful to add. Implements: https://todo.sr.ht/~rjarry/aerc/320 Changelog-added: Add support for Labels when using imap. Signed-off-by: cos <[email protected]> Acked-by: Robin Jarry <[email protected]>Instead of creating new mail files in the general temporary directory, where they might be erased upon system restart, create them in ${XDG_STATE_HOME:-~/.local/state}/aerc/compose. Adjust :recover to find those files automatically. Changelog-changed: Temporary files for messages being composed now reside in the system's proper state home directory. Signed-off-by: inwit <[email protected]> Acked-by: Robin Jarry <[email protected]>Previously, commands.Register allowed using pointers to new command, e.g.: commands.Register(&Prefetch{}) which however made aerc crash later when some methods (e.g., Aliases, Execute) got double pointer instead of the simple pointer they expected. Signed-off-by: Matěj Cepl <[email protected]> Reviewed-by: Tristan Partin <[email protected]> Acked-by: Robin Jarry <[email protected]>go-opt v2.2.0 now supports providing individual descriptions for completion items by appending a newline character to the completion item followed by its description. Do that for patch sub commands. Here's what it looks like: apply (Apply the selected message(s) to the current project.) cd (Change aerc's working directory to the current project.) drop (Drop a patch from the repository.) find (Search for applied patches.) init (Create a new project.) list (List the current project with the tracked patch sets.) ls (List the current project with the tracked patch sets.) rebase (Rebase the patch data.) switch (Switch context to the specified project.) term (Open a shell or run a command in the current project's directory.) unlink (Delete all patch tracking data for the specified project.) :patch Signed-off-by: Robin Jarry <[email protected]> Tested-by: Antonin Godard <[email protected]>At times messages from the message store may be incomplete and not contain the sender. This is unexpected, but should not crash the application. [signal SIGSEGV: segmentation violation code=0x1 addr=0x28 pc=0x55f3cee9b99e] panic({0x55f3cf118720?, 0x55f3cf72e6f0?}) runtime/panic.go:783 +0x132 git.sr.ht/~rjarry/aerc/commands/msg.Mark.Execute.senderFilter.func2({0xc0019c4000, 0x801, 0x0?}) git.sr.ht/~rjarry/aerc/commands/msg/mark.go:180 +0x1fe git.sr.ht/~rjarry/aerc/commands/msg.Mark.Execute({0x1, 0x0, 0x0, 0x0, 0x0, 0x1, 0x0, {0xc00190eb70, 0x7}}, {0xc001542810, ...}) git.sr.ht/~rjarry/aerc/commands/msg/mark.go:106 +0x68c git.sr.ht/~rjarry/aerc/commands.ExecuteCommand({0x55f3cf21c8f0, 0x55f3cf8cd220?}, {0xc00190ea90?, 0x500c000fb2300?}) git.sr.ht/~rjarry/aerc/commands/commands.go:221 +0x4d3 Fixes:6baffcda("mark: add filter-based marking") Signed-off-by: Moritz Poldrack <[email protected]> Acked-by: Robin Jarry <[email protected]>Tabs move the cursor to the next 8-column boundary, not 8 spaces unconditionally. The old code replaced all tabs with 8 spaces regardless of position, breaking alignment when tabs appeared mid-line. "x\ty" (x at col 0, tab, y): terminal: y appears at column 8 old filter: "x y" y at column 9 new filter: "x y" y at column 8 (7 spaces) "abcd\ty" (4 chars, tab, y): terminal: y appears at column 8 old filter: "abcd y" y at column 12 new filter: "abcd y" y at column 8 (4 spaces) Also handle multibyte characters via mbtowc/wcwidth for correct column width calculation with UTF-8. A 2-column wide character (like CJK or some emoji) followed by a tab needs 6 spaces to reach column 8, not 7. Signed-off-by: Fredrik Foss-Indrehus <[email protected]> Acked-by: Robin Jarry <[email protected]>Check for diff meta lines before +/- diff content when rendering quoted text. The "+++ b/file" line was incorrectly rendered as a diff addition because startswith("+") matched before the diff_meta_re check. Previously in a quoted diff: > --- a/file.c rendered with quote style + bold (correct) > +++ b/file.c rendered as diff addition (wrong, green) Now both render as bold with the quote color, same as unquoted diff meta lines. Fixes:c0e1bb1e0b("colorize: highlight diffstat summary lines") Signed-off-by: Fredrik Foss-Indrehus <[email protected]> Acked-by: Robin Jarry <[email protected]>xposinstead ofsizeto improve readability 57f8e9097ecfwith notmuch b18e12b53dSince glibc 2.43, strchr is a const-preserving macro when building in C23 mode. It returns a const pointer when given a const input, which causes a type mismatch when assigning the result to a non-const pointer. This was introduced in glibc commit cd748a63ab1a ("Implement C23 const-preserving standard library macros") where strchr, along with other standard library functions, gained _Generic-based macro wrappers that preserve const-qualification of the input pointer. Replace the manual strchr/null-terminate/advance pattern with strtok which handles comma-delimited tokenization directly and avoids the const-correctness issue. Link: https://sourceware.org/git/?p=glibc.git;a=commitdiff;h=cd748a63ab1a Signed-off-by: Robin Jarry <[email protected]> Reviewed-by: Simon Martin <[email protected]>Replace the explicit database path and config file in the source URL with automatic discovery via libnotmuch (environment variables NOTMUCH_CONFIG, NOTMUCH_DATABASE, NOTMUCH_PROFILE and XDG conventions). The source URL hostname is now interpreted as an optional profile name: source = notmuch:// source = notmuch://work Replace the maildir-store path option with an enable-maildir boolean (default: true). The maildir root is now always obtained from the notmuch API via notmuch_config_get(NOTMUCH_CONFIG_MAIL_ROOT) instead of being specified manually. Deprecation warnings are emitted when old-style source URLs with database paths or the maildir-store option are detected in accounts.conf. Legacy database paths are identified by checking if the URL hostname+path resolves to an existing file or directory on disk; if it does not exist, it is treated as a profile name. The account wizard no longer shells out to "notmuch config get" to pre-fill the database path. The server field now accepts an optional profile name instead. Remove dead code from lib/notmuch/ related to database and config paths. Implements: https://todo.sr.ht/~rjarry/aerc/325 Changelog-changed: The notmuch maildir-store option has been replaced by enable-maildir (default: true). The maildir root is always obtained from the notmuch database configuration. Changelog-changed: The notmuch source URL no longer accepts an explicit database path or config query parameter. Database and configuration are now discovered automatically. An optional profile name can be specified as the URL hostname. Changelog-deprecated: The notmuch maildir-store option and explicit database paths in the source URL now emit deprecation warnings. Signed-off-by: Robin Jarry <[email protected]> Tested-by: septante <[email protected]> Acked-by: septante <[email protected]>The :tag/:modify-labels command produces a terse message in the status bar ("labels updated"). Change that message to inform the user not only that the tags have been changed but also about the specific changes performed. Use the alias "tag" or "label" in accordance to the user's choice. Signed-off-by: inwit <[email protected]> Tested-by: Simon Martin <[email protected]> Reviewed-by: Simon Martin <[email protected]> Acked-by: Robin Jarry <[email protected]>Make it possible to bind dash ("-", aka hyphen-minus) to a function Signed-off-by: Daniel Lublin <[email protected]> Tested-by: Francesc Elies <[email protected]> Acked-by: Robin Jarry <[email protected]>Unfold RFC 6350 continuation lines before parsing. Without this, properties with long parameter lists like EMAIL are split across lines and fail to match. Also handle FN fields with parameters (e.g. FN;DERIVED=TRUE:Name) which were previously skipped by the exact "FN:" prefix check. For example, the following vCard was not parsed correctly: BEGIN:VCARD EMAIL;PROP-ID=364320a92d58a502b191d9f8430d0ffacb471a24;PREF=1; TYPE=HOME,PREF:[email protected] FN;DERIVED=TRUE:Joe Smith END:VCARD The EMAIL line is folded (continuation line starts with a space) and the FN line has a parameter. Both were silently ignored. Changelog-fixed: `carddav-query` now correctly parses vCard contacts with folded lines and parameterized properties. Signed-off-by: Tristan Partin <[email protected]> Acked-by: Robin Jarry <[email protected]>Marking read and unread mail currently involves manual filtering, which can be a quite bothersome approach when working with large amounts of mail. Add new -u (unread) and -U (read) flags to filter by. These can be combined with -r, -s, and subject-based filtering allowing for calls like: :mark -U -s bence To mark all read messages from Bence. Changelog-added: Added `-u` and `-U` to the mark command to mark messages based on read-status. Suggested-by: andyrtr Signed-off-by: Moritz Poldrack <[email protected]> Tested-by: Andreas Radke <[email protected]> Acked-by: Robin Jarry <[email protected]>:sort readand:sort flaggedae3b3019f4When executing filters, we add the various filters subdirectories of our search directories. However, we were not doing the same for hooks. By searching for hooks in the subdirectories, users can keep their `PATH` a bit cleaner and hook can be looked up by name without the user needing to do their own `PATH` manipulation. Changelog-added: Hooks are now also searched in `${XDG_CONFIG_HOME:-~/.config}/aerc/hooks`, `~/.local/libexec/aerc/hooks`, `${XDG_DATA_HOME:-~/.local/share}/aerc/hooks`, `$PREFIX/libexec/aerc/hooks`, `$PREFIX/share/aerc/hooks`, `/usr/libexec/aerc/hooks`, `/usr/share/aerc/hooks`. Co-authored-by: Robin Jarry <[email protected]> Signed-off-by: Tristan Partin <[email protected]> Acked-by: Robin Jarry <[email protected]>Normalize several configuration comments to a common format. The proposed format is the following: # This is the description of an option that can be arbitrarily long # and for readability purposes can span multiple lines or paragraphs # # Default: foo #sample-option=foo Most of the configuration comments already conform to the above format, empty comment lines are trimmed/added for the ones that don't. Alignment for some example values is also normalized to be consistent. Casing mismatch for default configuration keys in templates section is also fixed. Signed-off-by: Loukas Agorgianitis <[email protected]> Acked-by: Simon Martin <[email protected]>New [ai] command option: when set, :ai-* write the combined system+user prompt to the command's stdin and use stdout as the response (takes precedence over endpoint/model; no API key). Enables using the Claude Code CLI ('claude -p') via its subscription, or 'ollama run', etc. aiCheckConfigured/confirm-prompt updated to accept either provider.Landed by force-updating
release/mirusto this branch (dd987afb), as agreed (rebase landing, linear history). The previous line is preserved at tagarchive/release-mirus-pre-0.22.Pull request closed