mirror of
https://github.com/kovidgoyal/kitty
synced 2026-07-12 02:42:56 +02:00
Fix spurious error message when setting image to none
This commit is contained in:
@@ -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
|
||||
|
||||
|
||||
@@ -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:
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user