{"record":{"id":"bd7fc787e2befe22","repo":"kovidgoyal/kitty","slug":"invalid-value-s-in-video-preview","errorCode":null,"errorMessage":"invalid value %s in video_preview","messagePattern":"invalid value (.+?) in video_preview","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"kittens/choose_files/main.go","lineNumber":326,"sourceCode":"\treturn\n}\n\nfunc load_config(opts *Options) (ans *Config, err error) {\n\tans = NewConfig()\n\tp := config.ConfigParser{LineHandler: ans.Parse}\n\terr = p.LoadConfig(\"choose-files.conf\", opts.Config, opts.Override)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tans.KeyboardShortcuts = config.ResolveShortcuts(ans.KeyboardShortcuts)\n\tparts, err := shlex.Split(ans.Video_preview)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tfor _, x := range parts {\n\t\tk, v, found := strings.Cut(x, \"=\")\n\t\tif !found {\n\t\t\treturn nil, fmt.Errorf(\"invalid value %s in video_preview\", x)\n\t\t}\n\t\tvar i uint64\n\t\tswitch k {\n\t\tcase \"duration\":\n\t\t\tif video_duration, err = strconv.ParseFloat(v, 64); err != nil {\n\t\t\t\treturn nil, fmt.Errorf(\"invalid %s in video_preview: %s\", k, v)\n\t\t\t}\n\t\tcase \"fps\":\n\t\t\tif i, err = strconv.ParseUint(v, 10, 0); err != nil {\n\t\t\t\treturn nil, fmt.Errorf(\"invalid %s in video_preview: %s\", k, v)\n\t\t\t}\n\t\t\tvideo_fps = int(i)\n\t\tcase \"width\":\n\t\t\tif i, err = strconv.ParseUint(v, 10, 0); err != nil {\n\t\t\t\treturn nil, fmt.Errorf(\"invalid %s in video_preview: %s\", k, v)\n\t\t\t}\n\t\t\tvideo_width = int(i)\n\t\tdefault:","sourceCodeStart":308,"sourceCodeEnd":344,"githubUrl":"https://github.com/kovidgoyal/kitty/blob/6d5d0c440603ad9bdf6dcd599f73f6dde21acb44/kittens/choose_files/main.go#L308-L344","documentation":"A comma-separated item in the video_preview setting has no '=' separator, so kitty cannot parse it as key=value. Valid keys are duration, fps, and width.","triggerScenarios":"Setting --video-preview to something like '30fps' or a bare number instead of 'fps=30'.","commonSituations":"Assuming positional/flag syntax; typos like 'duration:' instead of 'duration='.","solutions":["Rewrite each item as key=value: --video-preview 'duration=5,fps=10,width=80'","Remove stray items that are not key=value pairs"],"exampleFix":"# before\n--video-preview '5,10,80'\n# after\n--video-preview 'duration=5,fps=10,width=80'","handlingStrategy":"validation","validationCode":"for _, x := range strings.Split(val, \",\") { if !strings.Contains(x, \"=\") { /* reject item */ } }","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Use key=value syntax exclusively","Keep a canonical example of video_preview in your config template"],"tags":["kitty","config","video-preview","choose-files"],"backgroundTag":"config-parse-error","analyzedSha":"6d5d0c440603ad9bdf6dcd599f73f6dde21acb44","analyzedAt":"2026-08-27T14:20:20.142Z","schemaVersion":2},"datasetVersion":"2026-08-27T19:17:21.184Z"}