diff options
Diffstat (limited to 'app')
-rw-r--r-- | app/aerc.go | 10 | ||||
-rw-r--r-- | app/compose.go | 8 | ||||
-rw-r--r-- | app/msgviewer.go | 7 |
3 files changed, 8 insertions, 17 deletions
diff --git a/app/aerc.go b/app/aerc.go index 046c7871..c7307540 100644 --- a/app/aerc.go +++ b/app/aerc.go @@ -873,9 +873,9 @@ func (aerc *Aerc) isExKey(event *tcell.EventKey, exKey config.KeyStroke) bool { return event.Modifiers() == exKey.Modifiers && event.Key() == exKey.Key } -// cmdFallbackSearch checks cmds for the first executable availabe in PATH. An error is +// CmdFallbackSearch checks cmds for the first executable availabe in PATH. An error is // returned if none are found -func cmdFallbackSearch(cmds []string) (string, error) { +func CmdFallbackSearch(cmds []string, silent bool) (string, error) { var tried []string for _, cmd := range cmds { if cmd == "" { @@ -885,8 +885,10 @@ func cmdFallbackSearch(cmds []string) (string, error) { _, err := exec.LookPath(params[0]) if err != nil { tried = append(tried, cmd) - warn := fmt.Sprintf("cmd '%s' not found in PATH, using fallback", cmd) - PushWarning(warn) + if !silent { + warn := fmt.Sprintf("cmd '%s' not found in PATH, using fallback", cmd) + PushWarning(warn) + } continue } return cmd, nil diff --git a/app/compose.go b/app/compose.go index 75f90f12..35fdd9bf 100644 --- a/app/compose.go +++ b/app/compose.go @@ -1320,13 +1320,7 @@ func (c *Composer) showTerminal() error { if c.editor != nil { c.editor.Destroy() } - cmds := []string{ - config.Compose.Editor, - os.Getenv("EDITOR"), - "vi", - "nano", - } - editorName, err := cmdFallbackSearch(cmds) + editorName, err := CmdFallbackSearch(config.EditorCmds(), false) if err != nil { c.acct.PushError(fmt.Errorf("could not start editor: %w", err)) } diff --git a/app/msgviewer.go b/app/msgviewer.go index abed93fd..e45a6d3e 100644 --- a/app/msgviewer.go +++ b/app/msgviewer.go @@ -421,12 +421,7 @@ func NewPartViewer( pagerin io.WriteCloser term *Terminal ) - cmds := []string{ - config.Viewer.Pager, - os.Getenv("PAGER"), - "less -Rc", - } - pagerCmd, err := cmdFallbackSearch(cmds) + pagerCmd, err := CmdFallbackSearch(config.PagerCmds(), false) if err != nil { acct.PushError(fmt.Errorf("could not start pager: %w", err)) return nil, err |