fix(selector): let stderr of selector pass through to the console

This commit is contained in:
yory8 2019-09-30 19:14:54 +02:00
parent d3c5a2c158
commit 637f58f95c

View file

@ -47,8 +47,8 @@ func selector(data []string, max int, tool string) (string, error) {
processed, guide := preprocessData(data, true, false) 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"))}
cmd.Stderr = os.Stderr // let stderr pass to console
b, err := cmd.Output() b, err := cmd.Output()
// note: ignore stderr, necessary e.g. for wofi's gtk errors
if err != nil { if err != nil {
if err.Error() == "exit status 1" { if err.Error() == "exit status 1" {
// dmenu/rofi exits with this error when no selection done // dmenu/rofi exits with this error when no selection done