From 68d2543d24d2ffce8d3e7b443726de7571f3051f Mon Sep 17 00:00:00 2001 From: yory8 <> Date: Tue, 16 Apr 2019 14:30:07 +0200 Subject: [PATCH] fix: stop failing with text beginning with hyphen --- demon.go | 2 +- selector.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/demon.go b/demon.go index 88c3c62..171649a 100644 --- a/demon.go +++ b/demon.go @@ -91,7 +91,7 @@ func listen(history []string, histfile string, persist bool, max int) error { if persist { // make the copy buffer available to all applications, // even when the source has disappeared - if err := exec.Command("wl-copy", text).Run(); err != nil { + if err := exec.Command("wl-copy", []string{"--", text}...).Run(); err != nil { return fmt.Errorf("error running wl-copy (demon.91): %s", err) } } diff --git a/selector.go b/selector.go index eaa6d4f..9c1fc4c 100644 --- a/selector.go +++ b/selector.go @@ -20,7 +20,7 @@ func selector(history []string, max int) error { } // serve selection to the OS - if err := exec.Command("wl-copy", selected).Run(); err != nil { + if err := exec.Command("wl-copy", []string{"--", selected}...).Run(); err != nil { return err }