Remote control: Allow matching for self window even over sockets when run inside a kitty window

Have kitty-tool send the value of KITTY_WINDOW_ID if present.
This commit is contained in:
Kovid Goyal
2022-12-30 12:14:42 +05:30
parent c18bff7821
commit 456af90ad2
5 changed files with 47 additions and 22 deletions

View File

@@ -10,6 +10,7 @@ import (
"io"
"os"
"reflect"
"strconv"
"strings"
"time"
"unicode/utf16"
@@ -268,6 +269,10 @@ func send_rc_command(io_data *rc_io_data) (err error) {
if err != nil {
return err
}
wid, err := strconv.Atoi(os.Getenv("KITTY_WINDOW_ID"))
if err == nil && wid > 0 {
io_data.rc.KittyWindowId = uint(wid)
}
err = create_serializer(global_options.password, "", io_data)
if err != nil {
return