aboutsummaryrefslogtreecommitdiffstats
path: root/commands/account
Commit message (Collapse)AuthorAgeFilesLines
* filter: clear filter when called with no argsKoni Marti2022-04-251-0/+3
| | | | | | | | Clear filter when called with no arguments. Fixes: https://todo.sr.ht/~rjarry/aerc/35 Signed-off-by: Koni Marti <koni.marti@gmail.com> Acked-by: Robin Jarry <robin@jarry.cc>
* store: keep current message selectedKoni Marti2022-04-171-0/+25
| | | | | | | | | | | | Keep current message selected when clearing or changing filters and when toggling threads. Add -s flag to the clear command to also clear the selected message and set cursor to the top of the message list. Implements: https://todo.sr.ht/~rjarry/aerc/36 Signed-off-by: Koni Marti <koni.marti@gmail.com> Acked-by: Robin Jarry <robin@jarry.cc>
* compose: parse headers correctly from -HEvan Gates2022-04-061-2/+15
| | | | | | | | | | | | By using :compose -H <header> a user should be able to add arbitrary headers to an email. The existing implementation from 5b523880b4b4cd2abd9457b4b09c384af33be14b added the headers as lines to the beginning of the body. These lines were not interpreted as headers anywhere and ended up as plain text in the body of the email. Fix the code to parse and add the headers correctly. Signed-off-by: Evan Gates <evan.gates@gmail.com> Tested-by: Moritz Poldrack <moritz@poldrack.dev>
* statusline: indicate when sorting is in progressKoni Marti2022-03-251-2/+3
| | | | | | | Indicate when sorting is in progress in the statusline. Signed-off-by: Koni Marti <koni.marti@gmail.com> Acked-by: Robin Jarry <robin@jarry.cc>
* sort: keep sort criteria applied to folderKoni Marti2022-03-251-3/+10
| | | | | | | | | | | | | | | Keep the sort criteria applied to the selected folder until the default sort order should be restored. Call the sort command without arguments to restore the default sort order. The current behavior is that the default sort order is restored as soon as the folder reloads. This happens often and then the results of the sort command are lost. This makes the sort command not very user-friendly. Instead, we should keep the sort criteria applied until the user explicitly wants to restore the default sort order again. Signed-off-by: Koni Marti <koni.marti@gmail.com> Acked-by: Robin Jarry <robin@jarry.cc>
* logging: added a log on panicMoritz Poldrack2022-03-232-2/+12
| | | | | | | | | | | | | Since panics still regularly "destroy" the terminal, it is hard to get a stack trace for panics you do not anticipate. This commit adds a panic handler that automatically creates a logfile inside the current working directory. It has to be added to every goroutine that is started and will repair the terminal on a panic. Signed-off-by: Moritz Poldrack <git@moritz.sh> Acked-by: Robin Jarry <robin@jarry.cc>
* statusline: make statusline folder-specificKoni Marti2022-03-231-0/+2
| | | | | | | | | | | | Make statusline folder-specific. Update filter, search and threading status when changing folders. Commit 2512c04 ("statusline: implement per-account status") introduced an account-specific statusline. This makes it account- and folder-specific. Signed-off-by: Koni Marti <koni.marti@gmail.com> Tested-by: Moritz Poldrack <moritz@poldrack.dev>
* statusline: implement per-account statusKoni Marti2022-03-183-10/+17
| | | | | | | | | | | | | | | | Implement a statusline state for each account. Keep the ex line and the push notifications global. Add account name prefix to push notifications. Prefix status line with account name when multiple accounts are available. Use account-specific status line for each tab where an account is defined. Handle threading, filter/search, viewer passthrough and connection status. Signed-off-by: Koni Marti <koni.marti@gmail.com> Acked-by: Robin Jarry <robin@jarry.cc>
* commands: use SelectedAccountUiConfig instead of explicit nil checkkt programs2022-03-162-13/+4
| | | | | | | Remove code duplication and provide completion even when acct is nil Signed-off-by: kt programs <ktprograms@gmail.com> Acked-by: Robin Jarry <robin@jarry.cc>
* commands: implement fuzzy completion for commands and optionskt programs2022-03-072-14/+36
| | | | | | | | Change the option to enable fuzzy completion to be fuzzy-complete, since it's no longer only used for folders Signed-off-by: Kt Programs <ktprograms@gmail.com> Acked-by: Koni Marti <koni.marti@gmail.com>
* aerc: always check SelectedAccount return valueRobin Jarry2022-02-252-0/+6
| | | | | | | | | | | | | | | | aerc.SelectedAccount() is used in lots of places. Most of them without checking the return value. In some cases, the currently selected tab is not related to any account (widget.Terminal for example). This can lead to unexpected crashes when accessing account specific configuration. When possible, return an error when no account is currently selected. If no error can be returned, fallback to non-account specific configuration. Signed-off-by: Robin Jarry <robin@jarry.cc> Reviewed-by: Koni Marti <koni.marti@gmail.com>
* commands: add expand-folder and collapse-folderKoni Marti2022-02-231-0/+42
| | | | | | | | add the expand-folder and collapse-folder commands to navigate the directory tree view. Provide keybinds for a vi-like folder navigation experience. Signed-off-by: Koni Marti <koni.marti@gmail.com>
* search/filter: display in extra statusRobin Jarry2022-02-232-7/+6
| | | | | | | | | | Add an extra attribute to the status line. When non-empty, display it after the current status. Set that extra status after a successful :search or :filter. Remove it after :clear. Signed-off-by: Robin Jarry <robin@jarry.cc>
* search/filter: remove from status bar after 20 secondsRobin Jarry2022-02-191-4/+5
| | | | | | | The status is not cleared. It is annoying. Fixes: c37f1eaaeaa1 ("filter/search: display current search/filter arguments") Signed-off-by: Robin Jarry <robin@jarry.cc>
* filter/search: display current search/filter argumentsinwit2022-02-191-2/+3
| | | | | | | Make the statusbar message after search and filter completion more informative by showing the full call that was used. Signed-off-by: inwit <inwit@sindominio.net>
* recover: recover emails from tempdir after a crashKoni Marti2022-01-291-0/+110
| | | | | | | | | | | | | | | | | | | implements a recover command that searches the local temp dir for aerc emails. If a file is found and selected, a new composer tab will open with the file contents as the message body. No header data is stored in the temp file and thus this information cannot be recovered. Recover will not remove the temporary file unless the force flag (-f) is explicitly used. This recovery method only works when the editor buffer is saved to disk and the Close() function of the composer has not been called yet. Sending, postponing or quitting will call the Close() function which removes the temporary file completely. After Close() is called, no recovery is possible anymore. Signed-off-by: Koni Marti <koni.marti@gmail.com>
* compose: add default template for new messagesRobin Jarry2022-01-191-0/+3
| | | | | | | Allow defining a default template to use when composing new messages. Add an example to be used for new users. Signed-off-by: Robin Jarry <robin@jarry.cc>
* docs: mention missing -T options for compose and forwardRobin Jarry2022-01-191-1/+1
| | | | | | A template file may be specified for compose and forward as well. Signed-off-by: Robin Jarry <robin@jarry.cc>
* imap: add manual {dis,}connect supportRobin Jarry2021-11-051-0/+37
| | | | Signed-off-by: Robin Jarry <robin@jarry.cc>
* go.mod: change base git urlRobin Jarry2021-11-0513-19/+19
| | | | | | | I'm not sure what are the implications but it seems required. Link: https://github.com/golang/go/issues/20883 Signed-off-by: Robin Jarry <robin@jarry.cc>
* Get rid of the aerc.PushError(" " + $string) idiomReto Brunner2021-01-302-2/+2
| | | | The individual callers should not be responsible for padding
* handle message unknown charset errorJeff Martin2020-08-311-0/+4
| | | | | | | | | | | | | | This change handles message parse errors by printing the error when the user tries to view the message. Specifically only handling unknown charset errors in this patch, but there are many types of invalid messages that can be handled in this way. aerc currently leaves certain messages in the msglist in the pending (spinner) state, and I'm unable to view or modify the message. aerc also only prints parse errors with message when they are initially loaded. This UX is a little better, because you can still see the header info about the message, and if you try to view it, you will see the specific error.
* Add support for :rmdirARaspiK2020-08-191-0/+96
| | | | | | | | | | | | | | | | | | | | | The `:rmdir` command removes the current directory (`-f` is required if the directory is not empty). This is not supported on the notmuch backend. An issue with the maildir backend is that some sync programs (e.g. offlineimap) may recover the directory after it is deleted. They need to specifically be configured to accept deletions, or special commands need to be executed (e.g. `offlineimap --delete-folder`) to properly delete folders. A danger of using this on the IMAP backend is that it is possible for a new message to be added to the directory and for aerc to not show it immediately (due to a slow connection) - using `:rmdir` at this moment (with `-f` if the directory already contains messages) would delete the directory and the new message that just arrived (and all other contents). This is documented in aerc(1) so that users are aware of possible risks.
* run go fmtReto Brunner2020-07-171-1/+1
|
* Use PushStatus instead of SetStatus where it makes senseHeiko Carrasco2020-07-091-1/+2
|
* Rework msglist scrollingJeffas2020-06-093-5/+5
| | | | | | | | | | | | This changes the scrolling to be done on the draw, when the height is updated, ensuring that the selected item is kept on screen during resizing. Also, this ensures that messages will fill the screen when resizing the window, for instance, shrinking and then growing drags down more messages if possible. This is a transplant of the dirlist scrolling logic.
* Revert "Add Style configuration"Drew DeVault2020-05-282-3/+2
| | | | This reverts commit 0f78f06610c0e8887aba2ae50e99b86477a384b3.
* Revert "Remove duration from the status methods"Drew DeVault2020-05-282-3/+5
| | | | This reverts commit f06d683688e3d2139b14f67b7e349089e7200bf4.
* Remove duration from the status methodsReto Brunner2020-05-272-5/+3
| | | | We always set 10 seconds anyhow, might as well do that without repeating ourselfs.
* Add Style configurationReto Brunner2020-05-272-2/+3
| | | | | | | | | | The following functionalities are added to configure aerc ui styles. - Read stylesets from file with very basic fnmatch wildcard matching - Add default styleset - Support different stylesets as part of UiConfig allowing contextual styles. - Move widgets/ui elements to use the stylesets. - Add configuration manual for the styleset
* pgp: fail gracefully from email decryptionRay Ganardi2020-05-251-1/+5
| | | | | Aerc panics when there's an error on email decryption. Instead, an error message should be shown.
* gofmt fixesDrew DeVault2020-04-241-1/+1
|
* Add recall commandJeffas2020-04-241-1/+1
| | | | | | This command allows recalling the selected postponed email to edit in the composer. The command only allows recalling from the postpone directory.
* Add postpone commandJeffas2020-04-241-1/+1
| | | | | | | This command uses the Postpone folder from the account config to save messages to. Messages are saved as though they were sent so have a valid 'to' recipient address and should be able to be read back in for later editing.
* Remove ability to specify headers in the editorReto Brunner2020-04-241-1/+1
| | | | | | | | | | Due to headers being essentially free text, we constantly run into issues with parts of the body being interpreted as headers. Remove the ability to overwrite headers to avoid that, while keeping the ability to specify headers in the template files. Fixes #383
* Use aerc.PushError where appropriateBen Fiedler2020-04-231-4/+1
| | | | Forgot an unused import, to save you the hassle here is v2.
* Initial support for PGP decryption & signaturesDrew DeVault2020-03-031-2/+6
|
* create OriginalMail structLeszek CimaƂa2020-01-091-1/+3
|
* Fix crash when no message is selectedWiktor Kwapisiewicz2019-12-041-1/+4
| | | | | | | | | | | Pressing `Enter` on a view that has not yet loaded messages (e.g. at startup) would return `nil` from `Selected()`. Accessing `msg.Uid` on a `nil` reference crashes aerc. This patch moves the `msg == nil` check before accessing `msg.Uid` thus avoiding the crash. To test this patch repeatedly press `Enter` on startup.
* commands/account: Disable :view for deleted msgsKevin Kuehler2019-11-171-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | Allowing the user to view deleted messages creates all sorts of race conditions. The most devious race condition is pv.source can be set to a nil while another PartViewer is still running a goroutine in attemptCopy. Here is a trace when this happens. goroutine 76 [running]: io.copyBuffer(0x7f8ad02641d0, 0xc00040f590, 0x0, 0x0, 0xc0007cc000, 0x8000, 0x8000, 0x0, 0x0, 0x8b3d60) /usr/lib/go/src/io/io.go:402 +0x101 io.Copy(...) /usr/lib/go/src/io/io.go:364 git.sr.ht/~sircmpwn/aerc/widgets.(*PartViewer).attemptCopy.func4(0xc00017efd0, 0xc0004da7c0) /home/keur/repos/aerc/widgets/msgviewer.go:576 +0x611 created by git.sr.ht/~sircmpwn/aerc/widgets.(*PartViewer).attemptCopy /home/keur/repos/aerc/widgets/msgviewer.go:544 +0x144 We could add a guard in store.FetchBodyPart to only call the callback when msg.Part.Reader != nil, but we still get a hanging pager. Therefore it seems more reasonable to disable this completely. Signed-off-by: Kevin Kuehler <keur@xcf.berkeley.edu>
* Add Templates with ParsingSrivathsan Murali2019-11-101-9/+15
| | | | | | | | | | | | | | | + Changes NewComposer to return error. + Add lib to handle templates using "text/template". + Add -T option to following commands - compose. - reply - forward + Quoted replies using templates. + Forwards as body using templates + Default templates are installed similar to filters. + Templates Config in aerc.conf. - Required templates are parsed while loading config. + Add aerc-templates.7 manual for using template data.
* Make commands join args with spacesJeffas2019-09-202-8/+7
| | | | | | | | | | | | | | | This patch ensures the following commands join their arguments with spaces to make it easier to interact with: - cf - mkdir - cd - attach - detach - ct - copy - move - save
* Add sorting functionalityJeffas2019-09-201-0/+85
| | | | | | | | There is a command and config option. The criteria are a list of the sort criterion and each can be individually reversed. This only includes support for sorting in the maildir backend currently. The other backends are not supported in this patch.
* Add signaturesJeffas2019-09-121-2/+2
| | | | | | | | | | | | | This adds the ability for per-account signatures in the accounts.conf config file. The signature is added to emails in the editor at the bottom of the email. This includes when forwarding, replying to, and composing emails. There are two config options: signature-file and signature-cmd. The former allows a signature to be read from a file and the latter allows an arbitrary command to be executed to return the signature. The config options have been documented in aerc-config
* commands: move ParseNextPrevMessage error value to its last return valueWagner Riffel2019-09-041-5/+5
| | | | Signed-off-by: Wagner Riffel <wgrriffel@gmail.com>
* all: rewrite references to strings.Index to strings.ContainsWagner Riffel2019-09-041-1/+1
| | | | Signed-off-by: Wagner Riffel <wgrriffel@gmail.com>
* all: use fmt.Errorf for fomartting errorsWagner Riffel2019-09-043-3/+3
| | | | Signed-off-by: Wagner Riffel <wgrriffel@gmail.com>
* all: purge redundant underscoresWagner Riffel2019-09-0410-30/+30
| | | | Signed-off-by: Wagner Riffel <wgrriffel@gmail.com>
* extract search criteria parsing into the backendsReto Brunner2019-08-291-26/+1
|
* Add optional body argument to compose commandDaniel Bridges2019-08-131-3/+14
|