Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 7 additions & 3 deletions uniclip.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ import (
"encoding/gob"
"errors"
"fmt"
"golang.org/x/crypto/ssh/terminal"
"io"
"io/ioutil"
"net"
Expand All @@ -22,6 +21,8 @@ import (
"syscall"
"time"

"golang.org/x/crypto/ssh/terminal"

"golang.org/x/crypto/scrypt"
)

Expand Down Expand Up @@ -355,7 +356,9 @@ func runGetClipCommand() string {
return "An error occurred wile getting the local clipboard"
}
if runtime.GOOS == "windows" {
return strings.TrimSuffix(string(out), "\r\n") // powershell's get-clipboard adds a windows newline to the end for some reason
str := string(out)
str = strings.ReplaceAll(str, "\r\n", "\n") // powershell's get-clipboard transfers "\n" to "\r\n" and adds a windows newline "\r\n" to the end for some reason, so transfer it back
return strings.TrimSuffix(str, "\n")
}
return string(out)
}
Expand Down Expand Up @@ -434,7 +437,8 @@ func handleError(err error) {

func debug(a ...interface{}) {
if printDebugInfo {
fmt.Println("verbose:", a)
// fmt.Println("verbose:", a)
fmt.Printf("%q\n", fmt.Sprint(a))
}
}

Expand Down