From f80b32df29835a28434473b0c0d134cb7ab9ed31 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Wed, 22 May 2024 07:46:39 +0530 Subject: [PATCH] Fix kitten @ set-background-opacity limited to min opacity of 0.1 instead of 0 Fixes #7463 --- docs/changelog.rst | 2 ++ kitty/rc/set_background_opacity.py | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/docs/changelog.rst b/docs/changelog.rst index a00e7f075..ca329adc0 100644 --- a/docs/changelog.rst +++ b/docs/changelog.rst @@ -92,6 +92,8 @@ Detailed list of changes - Scrolling with mouse wheel when a selection is active should update the selection (:iss:`7453`) +- Fix kitten @ set-background-opacity limited to min opacity of 0.1 instead of 0 (:iss:`7463`) + 0.34.1 [2024-04-19] ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ diff --git a/kitty/rc/set_background_opacity.py b/kitty/rc/set_background_opacity.py index 3ebfdf4c2..9ce327871 100644 --- a/kitty/rc/set_background_opacity.py +++ b/kitty/rc/set_background_opacity.py @@ -25,7 +25,7 @@ if TYPE_CHECKING: class SetBackgroundOpacity(RemoteCommand): protocol_spec = __doc__ = ''' - opacity+/float: A number between 0.1 and 1 + opacity+/float: A number between 0 and 1 match_window/str: Window to change opacity in match_tab/str: Tab to change opacity in all/bool: Boolean indicating operate on all windows @@ -54,7 +54,7 @@ equal to the specified value, otherwise it will be set to the specified value. args = RemoteCommand.Args(spec='OPACITY', count=1, json_field='opacity', special_parse='parse_opacity(args[0])') def message_to_kitty(self, global_opts: RCOptions, opts: 'CLIOptions', args: ArgsType) -> PayloadType: - opacity = max(0.1, min(float(args[0]), 1.0)) + opacity = max(0, min(float(args[0]), 1)) return { 'opacity': opacity, 'match_window': opts.match, 'all': opts.all, 'match_tab': opts.match_tab, 'toggle': opts.toggle,