From 6a818c80c43be3511388ed601f36fd90554c8bd3 Mon Sep 17 00:00:00 2001 From: yory8 Date: Mon, 9 Mar 2020 16:08:04 +0100 Subject: [PATCH] fix(selector): add missing newline at the end of input --- CHANGELOG.md | 6 ++++++ selector.go | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6a3ad8f..f522faa 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,9 @@ +# Next + +**Notable bug fixes** + +- when using bemenu, the selector didn't work for the oldest element in history + # 1.4.0 **New features** diff --git a/selector.go b/selector.go index ffe8b03..1064343 100644 --- a/selector.go +++ b/selector.go @@ -58,7 +58,7 @@ func selector(data []string, max int, tool string, prompt string, toolArgs strin processed, guide := preprocessData(data, true, false) - cmd := exec.Cmd{Path: bin, Args: args, Stdin: strings.NewReader(strings.Join(processed, "\n"))} + cmd := exec.Cmd{Path: bin, Args: args, Stdin: strings.NewReader(strings.Join(processed, "\n") + "\n")} cmd.Stderr = os.Stderr // let stderr pass to console b, err := cmd.Output() if err != nil {