Fall back to termwiz on openbsd
Fixes
@@ -3,11 +3,13 @@ package cui
import (
"context"
"fmt"
+ "os"
"runtime"
"github.com/fatih/color"
"github.com/jroimartin/gocui"
"github.com/justwatchcom/gopass/utils/ctxutil"
+ "github.com/justwatchcom/gopass/utils/termwiz"
)
type selection struct {
@@ -162,6 +164,9 @@ func (s *selection) sync(g *gocui.Gui, v *gocui.View) error {
// GetSelection show a navigateable multiple-choice list to the user
// and returns the selected entry along with the action
func GetSelection(ctx context.Context, prompt, usage string, choices []string) (string, int) {
+ if tw := os.Getenv("GOPASS_CUI_TERMWIZ"); tw != "" || runtime.GOOS == "openbsd" {
+ return termwiz.GetSelection(ctx, prompt, usage, choices)
+ }
if ctxutil.IsAlwaysYes(ctx) || !ctxutil.IsInteractive(ctx) {
return "impossible", 0
}
