From 3c77229f619e0b1a3c43e5e07c61334503ab5e6c Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Sat, 15 May 2021 09:41:22 +0530 Subject: [PATCH] Add --no-response to set-background-image --- kitty/rc/set_background_image.py | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/kitty/rc/set_background_image.py b/kitty/rc/set_background_image.py index 0de0ef5e6..953308d46 100644 --- a/kitty/rc/set_background_image.py +++ b/kitty/rc/set_background_image.py @@ -53,6 +53,11 @@ choices=tiled,scaled,mirror-tiled,configured How the image should be displayed. The value of configured will use the configured value. +--no-response +type=bool-set +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 argspec = 'PATH_TO_PNG_IMAGE' args_count = 1 @@ -61,8 +66,10 @@ How the image should be displayed. The value of configured will use the configur current_file_obj: Optional[IO[bytes]] = None def message_to_kitty(self, global_opts: RCOptions, opts: 'CLIOptions', args: ArgsType) -> PayloadType: - if not args: - self.fatal('Must specify path to PNG image') + if len(args) != 1: + self.fatal('Must specify path to exactly one PNG image') + if opts.no_response: + global_opts.no_command_response = True path = args[0] ret = { 'match': opts.match,