junegunn/fzf · error

non-ascii jump labels are not allowed

Error message

non-ascii jump labels are not allowed

What it means

fzf restricts jump-label characters to printable ASCII (rune values 32-126). Labels are matched as single keystrokes, so control characters, DEL, and multi-byte Unicode cannot function as labels. The loop at options.go:3535 rejects any rune outside that range when validateJumpLabels is true.

Source

Thrown at src/options.go:3535

		return errors.New("scroll offset must be a non-negative integer")
	}

	if opts.Tabstop < 1 {
		return errors.New("tab stop must be a positive integer")
	}

	if len(opts.JumpLabels) == 0 {
		return errors.New("empty jump labels")
	}

	if opts.FreezeLeft < 0 || opts.FreezeRight < 0 {
		return errors.New("number of fields to freeze must be a non-negative integer")
	}

	if validateJumpLabels {
		for _, r := range opts.JumpLabels {
			if r < 32 || r > 126 {
				return errors.New("non-ascii jump labels are not allowed")
			}
		}
	}
	return err
}

func applyPreset(opts *Options, preset string) error {
	// Reset to the platform default
	defaultBorderShape = tui.DefaultBorderShape

	switch strings.ToLower(preset) {
	case "default":
		opts.ListBorderShape = tui.BorderUndefined
		opts.InputBorderShape = tui.BorderUndefined
		opts.HeaderBorderShape = tui.BorderUndefined
		opts.FooterBorderShape = tui.BorderUndefined
		opts.Preview.border = defaultBorderShape
		opts.Preview.info = true

View on GitHub (pinned to bd4efa277b)

Solutions

  1. Restrict labels to printable ASCII (letters, digits, punctuation)
  2. Use the default 'ascii' preset
  3. Sanitize user-supplied label sets before passing them to fzf

Example fix

# before
fzf --jump-labels='asdfghjklé'
# after
fzf --jump-labels='asdfghjkl'
Defensive patterns

Strategy: type-guard

Validate before calling

// Go: sanitize labels to printable ASCII
func asciiLabels(s string) string {
    out := []rune{}
    for _, r := range s {
        if r >= 32 && r <= 126 { out = append(out, r) }
    }
    if len(out) == 0 { return "abcdefghijklmnopqrstuvwxyz" }
    return string(out)
}

Type guard

func validJumpLabelSet(s string) bool {
    if s == "" { return false }
    for _, r := range s {
        if r < 32 || r > 126 { return false }
    }
    return true
}

Prevention

When it happens

Trigger: Passing --jump-labels with Unicode letters (e.g. 'héllo'), emoji, control characters, or DEL, e.g. --jump-labels='αβγ'. Each rune r < 32 || r > 126 triggers the error.

Common situations: Non-English keyboard layouts tempting users to use native alphabet characters; copy-pasting label sets that include invisible characters or smart quotes; terminals that cannot render the chosen glyphs.

Related errors


AI-assisted analysis of junegunn/fzf@bd4efa277b (2026-08-15). Data as JSON: /api/errors/b4fab6674f967e51. Report an issue: GitHub.