Skip to content

Group switching fails with identical group-colors ANSI reset sequences #581

Description

@zambetti

Describe the bug

When configuring zstyle ':fzf-tab:*' group-colors to produce a monochromatic appearance using identical ANSI reset sequences ($'\e[0m' repeated for all groups), group switching via < and > stops working.

However, if the list contains multiple syntactically different but semantically identical ANSI reset sequences (e.g. $'\e[0m', $'\e[00m', $'\e[0;0m', $'\e[00;00m'), group switching works as expected.

This suggests that internal group handling may incorrectly depend on the string identity or uniqueness of group-colors entries, rather than treating them purely as ANSI sequences applied at render time.

To Reproduce

  1. Set
zstyle ':fzf-tab:*' group-colors $'\e[0m' $'\e[0m' $'\e[0m' $'\e[0m'
  1. Trigger completion with groups
  2. Try switching groups using < / >
  3. Observe that group switching does not work
  4. Change config to:
zstyle ':fzf-tab:*' group-colors $'\e[0m' $'\e[00m' $'\e[0;0m' $'\e[00;00m'
  1. Repeat steps 2–4
  2. Observe that group switching works again

Expected behavior

Group switching with < / > should work regardless of whether group-colors entries are identical or different, as long as they produce valid ANSI escape sequences.

Environment:

zsh 5.9 (arm64-apple-darwin24.0)
fzf 0.73.1 (Homebrew)
fzf-tab 1.3.0

Minimal zshrc

zstyle ':completion:*:descriptions' format '%d'
zstyle ':fzf-tab:*' switch-group '<' '>'

# Group switching works
zstyle ':fzf-tab:*' group-colors $'\033[0m' $'\033[00m' $'\033[0;0m' $'\033[00;00m'

# Group switching does not work
# zstyle ':fzf-tab:*' group-colors $'\e[0m' $'\e[0m' $'\e[0m' $'\e[0m'

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions