diff --git a/kitty/rc/set_background_image.py b/kitty/rc/set_background_image.py index 0bb1f036c..100882ec8 100644 --- a/kitty/rc/set_background_image.py +++ b/kitty/rc/set_background_image.py @@ -63,7 +63,7 @@ default=false Don't wait for a response from kitty. This means that even if setting the background image failed, the command will exit with a success code. ''' + '\n\n' + MATCH_WINDOW_OPTION - args = RemoteCommand.Args(spec='PATH_TO_PNG_IMAGE', count=1, json_field='data', special_parse='!read_window_logo(args[0])', + args = RemoteCommand.Args(spec='PATH_TO_PNG_IMAGE', count=1, json_field='data', special_parse='!read_window_logo(io_data, args[0])', completion=ImageCompletion) reads_streaming_data = True diff --git a/kitty/rc/set_window_logo.py b/kitty/rc/set_window_logo.py index 92b3e1258..41bb1c95b 100644 --- a/kitty/rc/set_window_logo.py +++ b/kitty/rc/set_window_logo.py @@ -59,7 +59,8 @@ default=false Don't wait for a response from kitty. This means that even if setting the image failed, the command will exit with a success code. ''' - args = RemoteCommand.Args(spec='PATH_TO_PNG_IMAGE', count=1, json_field='data', special_parse='!read_window_logo(args[0])', completion=ImageCompletion) + args = RemoteCommand.Args(spec='PATH_TO_PNG_IMAGE', count=1, json_field='data', special_parse='!read_window_logo(io_data, args[0])', + completion=ImageCompletion) reads_streaming_data = True def message_to_kitty(self, global_opts: RCOptions, opts: 'CLIOptions', args: ArgsType) -> PayloadType: diff --git a/tools/cmd/at/set_window_logo.go b/tools/cmd/at/set_window_logo.go index 0cb1af4a9..04ea668eb 100644 --- a/tools/cmd/at/set_window_logo.go +++ b/tools/cmd/at/set_window_logo.go @@ -27,8 +27,9 @@ func set_payload_data(io_data *rc_io_data, data string) { set_payload_string_field(io_data, "Data", data) } -func read_window_logo(path string) (func(io_data *rc_io_data) (bool, error), error) { +func read_window_logo(io_data *rc_io_data, path string) (func(io_data *rc_io_data) (bool, error), error) { if strings.ToLower(path) == "none" { + io_data.rc.Stream = false return func(io_data *rc_io_data) (bool, error) { set_payload_data(io_data, "-") return true, nil