{"record":{"id":"898643b2b2657305","repo":"junegunn/fzf","slug":"scrollbar-display-width-should-be-1","errorCode":null,"errorMessage":"scrollbar display width should be 1","messagePattern":"scrollbar display width should be 1","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/options.go","lineNumber":3639,"sourceCode":"\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}\n\t\t}\n\t}\n\n\tif opts.Theme.Nth.IsColorDefined() {","sourceCodeStart":3621,"sourceCodeEnd":3657,"githubUrl":"https://github.com/junegunn/fzf/blob/bd4efa277b49ef34ca4025bff9b1a288e1980eff/src/options.go#L3621-L3657","documentation":"Each character of --scrollbar must be exactly one terminal column wide, because the scrollbar occupies a single column on the right edge. After the length check, options.go:3639 loops over the runes and rejects any whose uniseg.StringWidth != 1.","triggerScenarios":"Using CJK ideographs, full-width forms, or emoji as scrollbar characters: --scrollbar='█·' is fine (both width 1) but --scrollbar='一' or --scrollbar='👍' fails since those runes are width 2.","commonSituations":"Aesthetic customization with box-drawing or Unicode art that includes a wide glyph; terminals/fonts rendering some glyphs as double width; combining characters with zero width.","solutions":["Restrict scrollbar characters to half-width glyphs (block elements like '█' and '·' are width 1)","Pick a different glyph if the current one renders wide in your font","Verify each candidate rune's width programmatically before configuring"],"exampleFix":"# before\nfzf --scrollbar='▓一'\n# after\nfzf --scrollbar='▓·'","handlingStrategy":"type-guard","validationCode":"// Go: every scrollbar rune must be exactly one column wide\nfunc validScrollbarWidths(s string) bool {\n    for _, r := range s {\n        if uniseg.StringWidth(string(r)) != 1 { return false }\n    }\n    return true\n}","typeGuard":"func allRunesWidthOne(s string) bool {\n    for _, r := range s {\n        if uniseg.StringWidth(string(r)) != 1 { return false }\n    }\n    return true\n}","tryCatchPattern":null,"preventionTips":["Stick to half-width block elements ('█', '▓', '·', '-')","Avoid CJK ideographs, full-width forms, and emoji in scrollbar config","If a glyph renders wide in your terminal font, pick another"],"tags":["fzf","cli","validation","unicode","scrollbar"],"backgroundTag":null,"analyzedSha":"bd4efa277b49ef34ca4025bff9b1a288e1980eff","analyzedAt":"2026-08-15T06:11:46.983Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}