Commit graph

58 commits

Author SHA1 Message Date
Christopher Vittal
ecd803aae4 Add :prompt command
Usage:
    :prompt <prompt> <command...>

Displays the prompt on the status bar, waits for user input, then
appends that input as the last argument to the command and executes it.
The input is passed as one argument to the command, unless it is empty,
in which case no extra argument is added.
2019-08-26 09:48:39 +09:00
Drew DeVault
4fc6fee734 Revert "add close command at global level"
This reverts commit f0a0c5aa73.
2019-08-13 10:55:50 +09:00
Aditya Srivastava
f0a0c5aa73 add close command at global level 2019-08-13 10:49:34 +09:00
Reto Brunner
072b5f453c Close backends prior to shutdown
We need some way to signal the backends that we are about to shutdown,
allowing them to clean up (for example in notmuch committing the db changes).
This commit implements a hook which gets called upon shutdown, providing
backends implement the io.Closer interface.
2019-08-08 10:24:03 +09:00
Ben Burwell
152f8c9519 Ring bell when new messages arrive
Add a "new-message-bell" option to the UI section of aerc.conf. A new
hook into the message store allows the msglist widget to detect new
messages being added to the displayed list. When new messages are
delivered, and the new-message-bell option is enabled (as it is by
default), the terminal will beep.
2019-07-29 15:01:49 -04:00
Jeffas
989730d470 Add index option to change-tab
This allows selection of a tab using its index. It attempts to parse the
given argument as a number, if it fails then it uses it as a name.

Also supports relative indexes using prefixed + or -.
2019-07-27 12:40:28 -04:00
Galen Abell
8635c70fda Add command history and cycling
Aerc will keep track of the previous 1000 commands, which the user can
cycle through using the arrow keys while in the ex-line. Pressing up
will move backwards in history while pressing down will move forward.
2019-07-26 14:29:34 -04:00
Daniel Bridges
67fb0938a6 Support configurable header layout in compose widget 2019-07-26 14:22:04 -04:00
Jeffas
dc4c36adbf Add new-email trigger
This patch sets up the trigger config section of aerc.conf.

Each trigger has its own function which is called from the place where
it is triggered. Currently only the new-email trigger is implemented.

The triggers make use of format strings. For instance, in the new-email
trigger this allows the user to select the trigger command and also the
information extracted from the command and placed into their command.

To actually execute the trigger commands the keypresses are simulated.

Further triggers can be implemented in the future.

Formatting of the command is moved to a new package.
2019-07-26 14:00:24 -04:00
Jeffas
e42b95a617 Add change tab command
This command allows the user to change tab by giving the tab name. This
can be tab completed too. The previous tab is stored in the tabs module
so that when a new tab is created it is still possible to go to the
previous one.

Normal invocation is :ct folder
Previous tab is :ct -
2019-07-23 10:27:59 -04:00
Drew DeVault
7a489cb001 Add Unix socket for communicating with aerc 2019-07-19 14:15:48 -04:00
Jeffas
d7975132b6 Show currently pressed keys in statusline
This patch adds the currently pressed keys to the statusline. This is
useful when keybindings are multiple keys long and you might forget
which keys are already pressed.
2019-07-17 17:12:52 -04:00
Jeffas
3b09c07e7a Add clickable tabs
This introduces a new interface `Clickable`. I'd imagine this would be
implemented for most widgets eventually and would allow for programs run
in the terminal to also have their mouse events forwarded to them.

For the tabs it was relatively simple to check that the position of the
click is within the boxes for the tabs. For other components I'd imagine
that some state representing their currently drawn bounding box would be
useful.
2019-07-11 19:45:53 -04:00
Gregory Mullen
2a0961701c Implement basic tab completion support
Tab completion currently only works on commands. Contextual completion
will be added in the future.
2019-06-29 14:24:19 -04:00
Drew DeVault
ceeb30abeb Fix Cc & Bcc handling in replies 2019-06-21 14:33:09 -04:00
Kevin Kuehler
a54f4adb8f lib/ui/tab: Add Replace method
Also expose a light wrapper method in aerc.go for tab replacement

Signed-off-by: Kevin Kuehler <kkuehler@brave.com>
2019-06-11 09:34:45 -04:00
Galen Abell
28fc9fa53d Add :save and :pipe commands to viewer
* :save takes a path and saves the current message part to that location
* :pipe is the same as pipe on the account page, but uses the current
  message part rather than the whole email (ie :pipe gzip -d)
* Refactored account:pipe and extracted common pipe code to
  commands.util.QuickTerm
* Added helper command aerc.PushError
2019-05-27 09:37:07 -04:00
Drew DeVault
9b19e3ad05 Show account wizard if no accounts configured 2019-05-22 11:35:55 -04:00
Drew DeVault
a7341aff21 Fix always showing last account tab 2019-05-22 10:39:52 -04:00
Drew DeVault
6811143925 New account wizard, part one 2019-05-21 16:53:50 -04:00
Simon Ser
a15ea01cfb Update internal state and draw from the same goroutine
This commit introduces a new Aerc.Tick function that should be called to
refresh the internal state. This in turn makes each AccountView process worker
events.

The UI goroutine repeatedly refreshes the internal state before drawing a new
frame. The reason for this is that many worker messages may need to be
processed for a single frame, and drawing the UI is far slower than refreshing
the internal state. This has been confirmed in my testing (calling Aerc.Tick
only once per frame results in a slower display).

Many synchronization code has been removed. We can now write widgets without
having to care so much about races. The remaining sync users are:

- widgets/spinner: the spinner value is updated from inside an internal
  goroutine
- lib/ui/invalidatable: Invalidate may be called from any goroutine
- lib/ui/grid: same
- lib/ui/ui: an internal goroutine needs read access to UI.exit
- worker/types/worker: Worker.callbacks is used for both worker and UI
  callbacks

The exact goroutine requirements for Drawable have been documented.
2019-05-19 11:51:16 -04:00
Drew DeVault
98da4c9509 s/aerc2/aerc/g 2019-05-17 20:57:10 -04:00
Drew DeVault
f77d7c2c3d Add distinct keybindings for each compose view 2019-05-14 14:27:28 -04:00
Drew DeVault
577248f5e1 Add initial compose widget 2019-05-12 00:06:09 -04:00
Drew DeVault
27b25174e2 Make the message viewer real, part one 2019-03-31 12:14:37 -04:00
Drew DeVault
5d0402aeea Add message view commands, :close 2019-03-30 21:45:41 -04:00
Drew DeVault
fa04a1e036 Add basic message viewer mockup 2019-03-30 14:12:04 -04:00
Drew DeVault
2958579ee7 Correct color of error messages 2019-03-30 13:05:00 -04:00
Drew DeVault
84965d680c Use tcell.Style.Reverse instead of black on white 2019-03-30 12:59:18 -04:00
Drew DeVault
e591221509 Expire status errors on input 2019-03-21 21:34:12 -04:00
Drew DeVault
699f1cf7a6 Use : for keybindings even when ex is overridden 2019-03-21 17:49:59 -04:00
Drew DeVault
6d01332b55 Rig up terminal keybinding group 2019-03-21 17:44:44 -04:00
Drew DeVault
4130956b4c Use user's configured ex key 2019-03-21 17:40:50 -04:00
Drew DeVault
f5bf4a9324 Add context-specific keybindings 2019-03-21 17:37:19 -04:00
Drew DeVault
60b17c473a Wrap Terminal in TermHost 2019-03-17 17:39:49 -04:00
Drew DeVault
dee0f8938b Add :term-close 2019-03-17 17:23:53 -04:00
Drew DeVault
16c3f0a893 Handle terminal title, login shell 2019-03-17 17:08:54 -04:00
Drew DeVault
14cb8cb51f Implement :next-tab, :prev-tab 2019-03-17 16:24:17 -04:00
Drew DeVault
589db742cb Move exline handling up to aerc, add :term 2019-03-17 16:19:15 -04:00
Drew DeVault
9e28a02f6a commands: handle case where no account selected 2019-03-17 14:57:05 -04:00
Drew DeVault
1170893e39 Add basic terminal widget 2019-03-17 14:02:33 -04:00
Drew DeVault
a729179f9f Implement sidebar-width config option 2019-03-15 20:40:28 -04:00
Drew DeVault
24dfc47126 Rig up key bindings 2019-03-15 01:46:14 -04:00
Drew DeVault
b60999c39e Start building out command subsystem 2019-03-10 21:15:24 -04:00
Elias Naur
607ece8302 Fix build 2019-02-10 17:11:19 -05:00
Drew DeVault
12284487b4 Implement Container interface in widgets/ 2019-01-20 15:08:30 -05:00
Drew DeVault
8492a21a51 Send commands up to the top-level aerc widget 2019-01-14 08:14:03 -05:00
Drew DeVault
c286d3da6b Move ex line into account 2019-01-13 13:33:43 -05:00
Drew DeVault
b76deea963 Move status line into account, update behavior 2019-01-13 13:25:56 -05:00
Drew DeVault
0911cd5050 Initialize worker in account widget 2019-01-13 13:03:28 -05:00