From b89dfc6d1dbd9ebe452d69bed508445f246be062 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Fri, 14 Oct 2022 11:54:54 +0530 Subject: [PATCH] Actually run the remote control commands from the shell --- tools/cmd/at/shell.go | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/tools/cmd/at/shell.go b/tools/cmd/at/shell.go index 2520ee167..61f3873e4 100644 --- a/tools/cmd/at/shell.go +++ b/tools/cmd/at/shell.go @@ -7,6 +7,7 @@ import ( "fmt" "io" "os" + "os/exec" "strings" "github.com/google/shlex" @@ -142,6 +143,22 @@ func exec_command(cmdline string) bool { } } return true + default: + exe, err := os.Executable() + if err != nil { + exe, err = exec.LookPath("kitty-tool") + if err != nil { + fmt.Fprintln(os.Stderr, "Could not find the kitty-tool executable") + return false + } + } + cmdline := []string{"kitty-tool", "@"} + cmdline = append(cmdline, parsed_cmdline...) + cmd := exec.Cmd{Path: exe, Args: cmdline, Stdin: os.Stdin, Stdout: os.Stdout, Stderr: os.Stderr} + err = cmd.Run() + if err != nil { + fmt.Fprintln(os.Stderr, err) + } } return true }