mirror of
https://github.com/rwinkhart/MUTN.git
synced 2026-09-05 16:47:20 -04:00
Implement untested MacOS clipboard support via pbcopy
This commit is contained in:
@@ -10,8 +10,6 @@ import (
|
||||
"time"
|
||||
)
|
||||
|
||||
// TODO Avoid index out of range errors when copying fields that do not exist
|
||||
|
||||
// CopyField copies a field from an entry to the clipboard
|
||||
func CopyField(targetLocation string, field int, executableName string) {
|
||||
if isFile, _ := TargetIsFile(targetLocation, true); isFile {
|
||||
@@ -49,12 +47,12 @@ func CopyField(targetLocation string, field int, executableName string) {
|
||||
|
||||
} else {
|
||||
fmt.Println(AnsiError + "Failed to read \"" + targetLocation + "\" - it is a directory" + AnsiReset)
|
||||
os.Exit(1)
|
||||
}
|
||||
os.Exit(0)
|
||||
}
|
||||
|
||||
// ClipClear is called in a separate process to clear the clipboard after 30 seconds
|
||||
// TODO Make clear time period configurable
|
||||
func ClipClear(oldContents string) {
|
||||
time.Sleep(30 * time.Second)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user