aboutsummaryrefslogtreecommitdiffstats
path: root/config
diff options
context:
space:
mode:
Diffstat (limited to 'config')
-rw-r--r--config/accounts.go25
-rw-r--r--config/general.go2
-rw-r--r--config/style.go12
-rw-r--r--config/ui.go1
4 files changed, 35 insertions, 5 deletions
diff --git a/config/accounts.go b/config/accounts.go
index 5bbae39f..6748f8a4 100644
--- a/config/accounts.go
+++ b/config/accounts.go
@@ -1,6 +1,7 @@
package config
import (
+ "bytes"
"errors"
"fmt"
"net/url"
@@ -18,6 +19,12 @@ import (
"github.com/go-ini/ini"
)
+var (
+ EnablePinentry func()
+ DisablePinentry func()
+ SetPinentryEnv func(*exec.Cmd)
+)
+
type RemoteConfig struct {
Value string
PasswordCmd string
@@ -52,11 +59,26 @@ func (c *RemoteConfig) ConnectionString() (string, error) {
pw := c.cache
if pw == "" {
+ usePinentry := EnablePinentry != nil &&
+ DisablePinentry != nil &&
+ SetPinentryEnv != nil
+
cmd := exec.Command("sh", "-c", c.PasswordCmd)
cmd.Stdin = os.Stdin
+
+ buf := new(bytes.Buffer)
+ cmd.Stderr = buf
+
+ if usePinentry {
+ EnablePinentry()
+ defer DisablePinentry()
+ SetPinentryEnv(cmd)
+ }
+
output, err := cmd.Output()
if err != nil {
- return "", fmt.Errorf("failed to read password: %w", err)
+ return "", fmt.Errorf("failed to read password: %v: %w",
+ buf.String(), err)
}
pw = strings.TrimSpace(string(output))
}
@@ -80,6 +102,7 @@ type AccountConfig struct {
Default string `ini:"default" default:"INBOX"`
Postpone string `ini:"postpone" default:"Drafts"`
From *mail.Address `ini:"from"`
+ UseEnvelopeFrom bool `ini:"use-envelope-from" default:"false"`
Aliases []*mail.Address `ini:"aliases"`
Source string `ini:"source" parse:"ParseSource"`
Folders []string `ini:"folders" delim:","`
diff --git a/config/general.go b/config/general.go
index 7ea2509b..7d86b0fb 100644
--- a/config/general.go
+++ b/config/general.go
@@ -23,6 +23,8 @@ type GeneralConfig struct {
EnableOSC8 bool `ini:"enable-osc8" default:"false"`
Term string `ini:"term" default:"xterm-256color"`
DefaultMenuCmd string `ini:"default-menu-cmd"`
+ QuakeMode bool `ini:"enable-quake-mode" default:"false"`
+ UsePinentry bool `ini:"use-terminal-pinentry" default:"false"`
}
var General = new(GeneralConfig)
diff --git a/config/style.go b/config/style.go
index a8f17e8d..c81e7204 100644
--- a/config/style.go
+++ b/config/style.go
@@ -54,6 +54,7 @@ const (
STYLE_PART_MIMETYPE
STYLE_COMPLETION_DEFAULT
+ STYLE_COMPLETION_DESCRIPTION
STYLE_COMPLETION_GUTTER
STYLE_COMPLETION_PILL
@@ -105,9 +106,10 @@ var StyleNames = map[string]StyleObject{
"part_filename": STYLE_PART_FILENAME,
"part_mimetype": STYLE_PART_MIMETYPE,
- "completion_default": STYLE_COMPLETION_DEFAULT,
- "completion_gutter": STYLE_COMPLETION_GUTTER,
- "completion_pill": STYLE_COMPLETION_PILL,
+ "completion_default": STYLE_COMPLETION_DEFAULT,
+ "completion_description": STYLE_COMPLETION_DESCRIPTION,
+ "completion_gutter": STYLE_COMPLETION_GUTTER,
+ "completion_pill": STYLE_COMPLETION_PILL,
"tab": STYLE_TAB,
"stack": STYLE_STACK,
@@ -337,9 +339,11 @@ selector_chooser.bold = true
selector_focused.bold = true
selector_focused.bg = 12
selector_focused.fg = 15
+completion_*.bg = 8
completion_pill.bg = 12
-completion_default.bg = 8
completion_default.fg = 15
+completion_description.fg = 15
+completion_description.dim = true
`
func NewStyleSet() StyleSet {
diff --git a/config/ui.go b/config/ui.go
index bcdc6ef4..bd8eb4a1 100644
--- a/config/ui.go
+++ b/config/ui.go
@@ -33,6 +33,7 @@ type UIConfig struct {
MessageViewThisYearTimeFormat string `ini:"message-view-this-year-time-format"`
PinnedTabMarker string "ini:\"pinned-tab-marker\" default:\"`\""
SidebarWidth int `ini:"sidebar-width" default:"22"`
+ QuakeHeight int `ini:"quake-terminal-height" default:"20"`
MessageListSplit SplitParams `ini:"message-list-split" parse:"ParseSplit"`
EmptyMessage string `ini:"empty-message" default:"(no messages)"`
EmptyDirlist string `ini:"empty-dirlist" default:"(no folders)"`