summaryrefslogtreecommitdiff
path: root/debug.go
diff options
context:
space:
mode:
authorJeff Carr <[email protected]>2019-05-24 09:02:35 -0700
committerJeff Carr <[email protected]>2019-05-24 09:02:35 -0700
commit265a8f6813f9be5dbf6c4c7f02f7a3e6dd9ab1be (patch)
tree5301cdbfa142c2f6094336a142591b3f33b431ef /debug.go
parent9b29c265b26d1231cf9ddb7abf51e390197dabf1 (diff)
more mouse click handling cleanups
Signed-off-by: Jeff Carr <[email protected]>
Diffstat (limited to 'debug.go')
-rw-r--r--debug.go25
1 files changed, 25 insertions, 0 deletions
diff --git a/debug.go b/debug.go
index 6ce49fb..7f7571b 100644
--- a/debug.go
+++ b/debug.go
@@ -3,6 +3,8 @@ package gui
import "log"
import "time"
import "fmt"
+import "strings"
+import "os/exec"
import "github.com/gookit/config"
@@ -109,4 +111,27 @@ func addDebuggingButtons(vbox *ui.Box, custom func(*ButtonMap, string)) {
vbox.Append(add5button, false)
vbox.Append(CreateButton("DEBUG goroutines", "DEBUG", custom), false)
+ vbox.Append(CreateButton("xterm", "XTERM", runTestExecClick), false)
+}
+
+func runTestExecClick(b *ButtonMap, msg string) {
+ log.Println("runTestExecClick START")
+ go runCommand("xterm -report-fonts")
+ log.Println("runTestExecClick END")
+}
+
+func runCommand(s string) {
+ log.Println("runXterm START")
+ log.Println("runXterm START")
+ log.Println("runXterm START")
+ cmd := strings.TrimSpace(s) // this is like 'chomp' in perl
+ cmdArgs := strings.Fields(cmd)
+ process := exec.Command(cmdArgs[0], cmdArgs[1:len(cmdArgs)]...)
+ log.Println("runXterm process.Start()")
+ process.Start()
+ log.Println("runXterm process.Wait()")
+ process.Wait()
+ log.Println("runXterm END")
+ log.Println("runXterm END")
+ log.Println("runXterm END")
}