{"record":{"id":"f27709dacb9a1a6e","repo":"junegunn/fzf","slug":"scrollbar-should-be-given-one-or-two-characters","errorCode":null,"errorMessage":"--scrollbar should be given one or two characters","messagePattern":"--scrollbar should be given one or two characters","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/options.go","lineNumber":3635,"sourceCode":"\t\t\treturn err\n\t\t}\n\t}\n\n\tif opts.Marker != nil {\n\t\tif err := validateSign(*opts.Marker, \"marker\", 2); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\tif opts.Gutter != nil && uniseg.StringWidth(*opts.Gutter) != 1 ||\n\t\topts.GutterRaw != nil && uniseg.StringWidth(*opts.GutterRaw) != 1 {\n\t\treturn errors.New(\"gutter display width should be 1\")\n\t}\n\n\tif opts.Scrollbar != nil {\n\t\trunes := []rune(*opts.Scrollbar)\n\t\tif len(runes) > 2 {\n\t\t\treturn errors.New(\"--scrollbar should be given one or two characters\")\n\t\t}\n\t\tfor _, r := range runes {\n\t\t\tif uniseg.StringWidth(string(r)) != 1 {\n\t\t\t\treturn errors.New(\"scrollbar display width should be 1\")\n\t\t\t}\n\t\t}\n\t}\n\n\tif opts.Height.auto && (opts.Tmux == nil || opts.Tmux.index < opts.Height.index) {\n\t\tfor _, s := range []sizeSpec{opts.Margin[0], opts.Margin[2]} {\n\t\t\tif s.percent {\n\t\t\t\treturn errors.New(\"adaptive height is not compatible with top/bottom percent margin\")\n\t\t\t}\n\t\t}\n\t\tfor _, s := range []sizeSpec{opts.Padding[0], opts.Padding[2]} {\n\t\t\tif s.percent {\n\t\t\t\treturn errors.New(\"adaptive height is not compatible with top/bottom percent padding\")\n\t\t\t}","sourceCodeStart":3617,"sourceCodeEnd":3653,"githubUrl":"https://github.com/junegunn/fzf/blob/bd4efa277b49ef34ca4025bff9b1a288e1980eff/src/options.go#L3617-L3653","documentation":"fzf's --scrollbar accepts exactly one character (uniform scrollbar) or two characters (separate thumb and track). The check at options.go:3635 rejects any value of more than two runes.","triggerScenarios":"Passing --scrollbar with three or more characters, e.g. --scrollbar='::' is fine but --scrollbar=':::' or --scrollbar=' - ' triggers len(runes) > 2.","commonSituations":"Trying to build a multi-segment scrollbar from ASCII art; copy-pasting strings with surrounding spaces; misunderstanding the two-character form as thumb+track rather than a pattern.","solutions":["Provide exactly one character (used for both thumb and track) or two characters (thumb then track)","Trim accidental spaces from the value","To disable the scrollbar, unset the option instead of padding it"],"exampleFix":"# before\nfzf --scrollbar='=== '\n# after\nfzf --scrollbar='=·'","handlingStrategy":"validation","validationCode":"// Go: enforce the one-or-two rune rule\nrunes := []rune(scrollbar)\nif len(runes) > 2 { scrollbar = string(runes[:2]) }","typeGuard":"func validScrollbarLen(s string) bool { n := len([]rune(s)); return n >= 1 && n <= 2 }","tryCatchPattern":null,"preventionTips":["Remember the two-character form is thumb+track, not a repeating pattern","Trim whitespace from configured scrollbar strings","Use one character when thumb and track should look identical"],"tags":["fzf","cli","validation","scrollbar"],"backgroundTag":null,"analyzedSha":"bd4efa277b49ef34ca4025bff9b1a288e1980eff","analyzedAt":"2026-08-15T06:11:46.983Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}