fix: stop failing with text beginning with hyphen

This commit is contained in:
yory8 2019-04-16 14:30:07 +02:00
parent b231836f35
commit 68d2543d24
2 changed files with 2 additions and 2 deletions

View file

@ -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)
}
}

View file

@ -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
}