{"record":{"id":"66ce8964632f1425","repo":"jesseduffield/lazygit","slug":"unexpected-value-s-for-s-allowed-values-s","errorCode":null,"errorMessage":"Unexpected value '%s' for '%s'. Allowed values: %s","messagePattern":"Unexpected value '(.+?)' for '(.+?)'\\. Allowed values: (.+?)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/config/user_config_validation.go","lineNumber":143,"sourceCode":"\t\t\t\treturn errors.New(\"git.diffRenderers: 'args' cannot be used with diff renderer type 'extDiff'.\")\n\t\t\t}\n\t\tcase \"rawGit\":\n\t\t\tif diffRenderer.Command != \"\" {\n\t\t\t\treturn errors.New(\"git.diffRenderers: 'command' cannot be used with diff renderer type 'rawGit'.\")\n\t\t\t}\n\t\tdefault:\n\t\t\treturn fmt.Errorf(\"git.diffRenderers: unknown type '%s'. Allowed values: stdinFilter, extDiff, rawGit\", diffRenderer.Type)\n\t\t}\n\t}\n\treturn nil\n}\n\nfunc validateEnum(name string, value string, allowedValues []string) error {\n\tif slices.Contains(allowedValues, value) {\n\t\treturn nil\n\t}\n\tallowedValuesStr := strings.Join(allowedValues, \", \")\n\treturn fmt.Errorf(\"Unexpected value '%s' for '%s'. Allowed values: %s\", value, name, allowedValuesStr)\n}\n\nfunc validateKeybindingsRecurse(path string, node any) error {\n\tvalue := reflect.ValueOf(node)\n\tif value.Kind() == reflect.Struct {\n\t\tfor _, field := range reflect.VisibleFields(reflect.TypeOf(node)) {\n\t\t\tvar newPath string\n\t\t\tif len(path) == 0 {\n\t\t\t\tnewPath = field.Name\n\t\t\t} else {\n\t\t\t\tnewPath = fmt.Sprintf(\"%s.%s\", path, field.Name)\n\t\t\t}\n\t\t\tif err := validateKeybindingsRecurse(newPath,\n\t\t\t\tvalue.FieldByName(field.Name).Interface()); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\t} else if value.Kind() == reflect.Slice {","sourceCodeStart":125,"sourceCodeEnd":161,"githubUrl":"https://github.com/jesseduffield/lazygit/blob/c477a2959b229fbf3284be0d4d2904ab61ec3c94/pkg/config/user_config_validation.go#L125-L161","documentation":"Generic enum validator in pkg/config/user_config_validation.go: validateEnum(name, value, allowedValues) returns this error when a config string field does not match any allowed value. It is the shared backstop for several enum-ish user config options (e.g. git.log config values, custom command output modes such as '', none, terminal, log, logWithPty, popup).","triggerScenarios":"Any config field validated via validateEnum receiving a value outside its allowed list — e.g. customCommands output 'window' instead of 'popup', or a v.value like 'menu' for a field that only permits a fixed set.","commonSituations":"Typos or casing differences in enum-valued config keys; values valid in older lazygit versions that were renamed; hand-written configs instead of copying from docs.","solutions":["Read the allowed values listed in the error message and set the field to one of them exactly.","Check casing — matching is exact string equality, not case-insensitive.","If you believe the value should be valid, check the field's allowed list in user_config_validation.go for your lazygit version."],"exampleFix":"# before\ncustomCommands:\n  - key: 'a'\n    command: make test\n    output: window\n\n# after\ncustomCommands:\n  - key: 'a'\n    command: make test\n    output: popup","handlingStrategy":"validation","validationCode":"func inEnum(v string, allowed ...string) bool {\n\tfor _, a := range allowed {\n\t\tif v == a {\n\t\t\treturn true\n\t\t}\n\t}\n\treturn false\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Copy enum values verbatim from the docs of the running lazygit version.","Watch casing — matching is exact."],"tags":["config","enum","validation"],"backgroundTag":null,"analyzedSha":"c477a2959b229fbf3284be0d4d2904ab61ec3c94","analyzedAt":"2026-08-15T08:34:32.451Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}