From 5b76547c3b3566ef878d0937b5cb1e91376d2206 Mon Sep 17 00:00:00 2001 From: Robin Jarry Date: Tue, 5 Dec 2023 00:15:45 +0100 Subject: commands: add menu Add a new :menu command that can be used to spawn a shell command in an interactive dialog and execute aerc commands for each of the lines printed on its standard output like xargs(1) would do in a shell. The shell command can be configured in aerc.conf under [general].default-menu-cmd and overridden via the :menu -c option. There are two flags to provide input text to the shell command which can be useful in combination with other aerc commands: -a: All account names, one per line: '' LF -d: All current account directory names, one per line: '' LF -ad: All directories of all accounts, one per line: '' '' LF Here are some examples: :menu -adc fzf :cf -a :menu -c 'fzf --multi' :attach :menu -dc 'fzf --multi' :cp And also for key bindings: = :menu -adc fzf :cf -a Changelog-added: New `:menu` command to invoke other aerc commands based on a shell command output. Signed-off-by: Robin Jarry Tested-by: Bence Ferdinandy Tested-by: Johannes Thyssen Tishman --- commands/commands.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'commands/commands.go') diff --git a/commands/commands.go b/commands/commands.go index fa8ef287..b617bade 100644 --- a/commands/commands.go +++ b/commands/commands.go @@ -113,7 +113,7 @@ func (err NoSuchCommand) Error() string { // im --> import-mbox func ExpandAbbreviations(name string) (string, Command, error) { context := CurrentContext() - name = strings.TrimLeft(name, ":") + name = strings.TrimLeft(name, ": \t") cmd, found := allCommands[name] if found && cmd.Context()&context != 0 { -- cgit