{"record":{"id":"e90797f252c79fe0","repo":"jesseduffield/lazygit","slug":"git-diffrenderers-args-cannot-be-used-with-diff-e90797","errorCode":null,"errorMessage":"git.diffRenderers: 'args' cannot be used with diff renderer type 'extDiff'.","messagePattern":"git\\.diffRenderers: 'args' cannot be used with diff renderer type 'extDiff'\\.","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/config/user_config_validation.go","lineNumber":125,"sourceCode":"\t}) {\n\t\treturn errors.New(\"All gui.spinner.frames entries must have the same width.\")\n\t}\n\treturn nil\n}\n\nfunc validateDiffRenderers(diffRenderers []DiffRendererConfig) error {\n\tfor _, diffRenderer := range diffRenderers {\n\t\tswitch diffRenderer.Type {\n\t\tcase \"stdinFilter\", \"\":\n\t\t\tif diffRenderer.Command == \"\" {\n\t\t\t\treturn errors.New(\"git.diffRenderers: 'command' must be specified for diff renderer type 'stdinFilter'.\")\n\t\t\t}\n\t\t\tif len(diffRenderer.Args) > 0 {\n\t\t\t\treturn errors.New(\"git.diffRenderers: 'args' cannot be used with diff renderer type 'stdinFilter'.\")\n\t\t\t}\n\t\tcase \"extDiff\":\n\t\t\tif len(diffRenderer.Args) > 0 {\n\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)","sourceCodeStart":107,"sourceCodeEnd":143,"githubUrl":"https://github.com/jesseduffield/lazygit/blob/c477a2959b229fbf3284be0d4d2904ab61ec3c94/pkg/config/user_config_validation.go#L107-L143","documentation":"Validation error from validateDiffRenderers (user_config_validation.go:125). For type 'extDiff' (external whole-file diff tool, mirroring git's extDiff config), lazygit does not support per-entry args — the tool is invoked like git's difftool and must be configured via its own config file or a wrapper script. A non-empty args list fails config validation.","triggerScenarios":"A git.diffRenderers entry with type extDiff and an args list, e.g. type: extDiff, command: meld, args: ['--newtab'].","commonSituations":"Porting a .gitconfig difftool entry that used cmd with flags into lazygit's structured fields; wanting to pass flags to meld/kdiff3/difftastic.","solutions":["Create a small wrapper script that invokes the tool with the flags, and set command to the wrapper path","Or configure the tool's own config file (delta: ~/.gitconfig-delta; difftastic: env vars) to carry the options","Remove the args field and restart lazygit"],"exampleFix":"# before\ngit:\n  diffRenderers:\n    - type: extDiff\n      command: meld\n      args: ['--newtab']\n\n# after\n# ~/bin/meld-wrap: exec meld --newtab \"$@\"\ngit:\n  diffRenderers:\n    - type: extDiff\n      command: ~/bin/meld-wrap","handlingStrategy":"validation","validationCode":"func extDiffHasNoArgs(e DiffRendererConfig) bool {\n    return e.Type == \"extDiff\" && len(e.Args) == 0\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Wrap flag-heavy diff tools in a shell script and point command at it","Configure tool flags in the tool's own config, not lazygit's args","Keep extDiff entries to type+command only"],"tags":["config","validation","diff","extdiff"],"backgroundTag":null,"analyzedSha":"c477a2959b229fbf3284be0d4d2904ab61ec3c94","analyzedAt":"2026-08-15T08:34:32.451Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}