{"record":{"id":"cb64b3f090c36767","repo":"kovidgoyal/kitty","slug":"passwords-are-not-allowed-to-start-with-hyphens-i","errorCode":null,"errorMessage":"Passwords are not allowed to start with hyphens, ignoring this password","messagePattern":"Passwords are not allowed to start with hyphens, ignoring this password","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"kitty/options/utils.py","lineNumber":974,"sourceCode":"        return ()\n    from glob import glob\n\n    x = resolve_abs_or_config_path(x, None)\n    return tuple(x for x in sorted(glob(x)) if x.rpartition('.')[-1].lower() in ('jpeg', 'jpg', 'png', 'webp', 'tif', 'tiff', 'bmp', 'gif')) or (x,)\n\n\ndef filter_notification(val: str, current_val: dict[str, str]) -> Iterator[tuple[str, str]]:\n    yield val, ''\n\n\ndef remote_control_password(val: str, current_val: dict[str, str]) -> Iterator[tuple[str, Sequence[str]]]:\n    val = val.strip()\n    if val:\n        parts = to_cmdline(val, expand=False)\n        if parts[0].startswith('-'):\n            # this is done so in the future we can add --options to the cmd\n            # line of remote_control_password\n            raise ValueError('Passwords are not allowed to start with hyphens, ignoring this password')\n        if len(parts) == 1:\n            yield parts[0], ()\n        else:\n            yield parts[0], tuple(parts[1:])\n\n\ndef clipboard_control(x: str) -> tuple[str, ...]:\n    return tuple(x.lower().split())\n\n\ndef custom_shaders(x: str) -> tuple[str, ...]:\n    return tuple(shlex_split(x)) if x else ()\n\n\ndef allow_hyperlinks(x: str) -> int:\n    if x == 'ask':\n        return 0b11\n    return 1 if to_bool(x) else 0","sourceCodeStart":956,"sourceCodeEnd":992,"githubUrl":"https://github.com/kovidgoyal/kitty/blob/6d5d0c440603ad9bdf6dcd599f73f6dde21acb44/kitty/options/utils.py#L956-L992","documentation":"remote_control_password yields passwords from kitty.conf; each value is shell-split via to_cmdline and if the first component starts with '-', this error is raised. The restriction reserves leading hyphens so future --option flags can be added to the directive.","triggerScenarios":"remote_control_password -mysecret or any password beginning with '-' in kitty.conf.","commonSituations":"Auto-generated passwords starting with a dash; users trying to pass flag-like strings.","solutions":["Change the password to not start with a hyphen","Regenerate the password or prefix it with an allowed non-hyphen character"],"exampleFix":"# before\nremote_control_password -abc123\n# after\nremote_control_password abc123","handlingStrategy":"validation","validationCode":"def valid_rc_password(v: str) -> bool:\n    return not v.strip().split()[0].startswith('-')","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Generate passwords from [A-Za-z0-9_~] character sets","Strip leading hyphens before writing remote_control_password lines"],"tags":["kitty","config","remote-control","security"],"backgroundTag":"config-value-validation-failed","analyzedSha":"6d5d0c440603ad9bdf6dcd599f73f6dde21acb44","analyzedAt":"2026-08-27T14:20:20.142Z","schemaVersion":2},"datasetVersion":"2026-08-27T19:17:21.184Z"}