{"record":{"id":"0f08c595c53633f3","repo":"kovidgoyal/kitty","slug":"layout-action-bias-must-contain-at-least-one-numbe","errorCode":null,"errorMessage":"layout_action bias must contain at least one number between 10 and 90","messagePattern":"layout_action bias must contain at least one number between 10 and 90","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"warning","filePath":"kitty/layout/tall.py","lineNumber":278,"sourceCode":"            if self.layout_opts.full_size > 1:\n                self.layout_opts.full_size -= 1\n                self.main_bias = list(self.layout_opts.build_bias_list())\n                return True\n        if action_name == 'mirror':\n            action = (args or ('toggle',))[0]\n            ok = False\n            if action == 'toggle':\n                self.layout_opts.mirrored = not self.layout_opts.mirrored\n                ok = True\n            else:\n                new_val = to_bool(action)\n                if new_val != self.layout_opts.mirrored:\n                    self.layout_opts.mirrored = new_val\n                    ok = True\n            return ok\n        if action_name == 'bias':\n            if len(args) == 0:\n                raise ValueError('layout_action bias must contain at least one number between 10 and 90')\n            biases = args[0].split()\n            if len(biases) == 1:\n                biases.append('50')\n            try:\n                i = biases.index(str(self.layout_opts.bias)) + 1\n            except ValueError:\n                i = 0\n            try:\n                self.layout_opts.bias = int(biases[i % len(biases)])\n                self.remove_all_biases()\n                return True\n            except Exception:\n                return False\n        return None\n\n    def minimal_borders(self, windows: WindowList) -> Iterator[BorderLine]:\n        num = windows.num_groups\n        if num < 2 or not lgd.draw_minimal_borders:","sourceCodeStart":260,"sourceCodeEnd":296,"githubUrl":"https://github.com/kovidgoyal/kitty/blob/6d5d0c440603ad9bdf6dcd599f73f6dde21acb44/kitty/layout/tall.py#L260-L296","documentation":"The 'bias' layout action on the tall layouts requires at least one numeric argument (a bias percentage). The layout code raises this immediately when layout_action('bias', ...) is called with zero arguments, before any parsing of the value string.","triggerScenarios":"Calling layout_action('bias') with an empty args list, e.g. via remote control: kitten @ launch --type=action ... or kitty @ kitten layout_action bias with no value, or a key mapping mapped to 'layout_action bias' with no parameter.","commonSituations":"User maps :map ctrl+b layout_action bias but forgets the numeric argument; a remote-control script iterates over layout actions and passes an empty list.","solutions":["Supply a bias value: layout_action bias 70 (10–90)","If only one bias is given a default of 50 is appended, so passing one number is enough","Fix the key mapping to include the numeric argument"],"exampleFix":"# before\nkitty @ kitten layout_action bias\n# after\nkitty @ kitten layout_action bias 70","handlingStrategy":"validation","validationCode":"if action == 'bias' and not args:\n    args = ['50']  # or reject before calling\nlayout_action('bias', args)","typeGuard":null,"tryCatchPattern":"try:\n    boss.layout_action('bias', args)\nexcept ValueError as e:\n    show_user_message(f'bias needs a number 10-90: {e}')","preventionTips":["Always pass a bias number in key mappings","Default missing args to 50 in wrappers","Range-check bias to 10-90 before calling"],"tags":["kitty","layout","tall","argument-missing"],"backgroundTag":"missing-required-argument","analyzedSha":"6d5d0c440603ad9bdf6dcd599f73f6dde21acb44","analyzedAt":"2026-08-27T14:20:20.142Z","schemaVersion":2},"datasetVersion":"2026-08-27T19:17:21.184Z"}