mirror of
https://github.com/sharkdp/bat
synced 2026-06-09 10:03:18 +00:00
66e336bcfb
Every shell completion script (bash, zsh, fish, PowerShell) shells out to bat to enumerate languages/themes for tab completion candidates. If the user has wired bat into LESSOPEN (e.g. LESSOPEN='|-bat -f -pp %s'), bat's normal pager auto-detection can engage when stdout looks like a terminal at completion time and reflect ANSI escape sequences back into the candidate list. The result is the issue's reproducer: tab completion expands 'Per' to '\033[38;2;248;248;242mPerl' instead of 'Perl'. The list-languages/list-themes calls are always meant to be machine- readable, so they should never page. Pass --no-paging explicitly to every bat invocation inside the four completion files. The flag is the public alias for --paging=never (already documented in bat --help) and is the same form completion scripts elsewhere in the codebase use. Touches the four completion files only; no production code changes.