fish 4.8.1 exposes command types through syntax colors
fish 4.8.1 can color builtins and functions separately. The highlighter retains command-type information it previously reduced to a validity result, with fallbacks for existing themes.
Fish already checked whether a command was a builtin, function, or external command while highlighting the input line. It then discarded that distinction and used one command-color category. The change proposed in pull request 12837 preserves the classification so the display can use it. Fish 4.8.1, released on July 14, makes builtin and function colors independently configurable.
The release notes name fish_color_builtin and fish_color_function. Both are optional. The versioned interactive reference specifies that they fall back to the existing command color when unset. Existing themes can retain their appearance while theme authors choose whether the additional distinction helps their users.
Live syntax feedback is one of the things I like about fish. After years in Bash and Zsh, its interactive defaults made it immediately appealing as a personal shell. Command-type colors add useful information at the point of entry, provided the chosen theme makes that information legible without making the rest of the command harder to read.
Classification survives the validity check
The patch changes the command-validity helper from a boolean result to a CommandType result. Its categories distinguish builtins and functions from other valid commands and invalid input. The coloring path can therefore select an appropriate highlighting role after validity has been established.
Previously, a successful validity check could only say that a command should receive ordinary command highlighting. The richer result carries the reason that it was accepted. That is a small but useful design change because the display no longer needs to repeat the lookup solely to recover the category.
The patch also maps the new roles to their configuration variable names and adds fallbacks to the ordinary command role. This connects classification, presentation, and configuration without requiring every theme to define every new role. The fallback is part of the compatibility behavior, not an accidental consequence of leaving the values blank.
The highlighter still contains cases where it cannot perform the normal command check and assumes the command is valid for coloring. The new categories therefore should not be treated as a complete execution trace. They are feedback produced during editing under the highlighter's available information. Execution remains the operation that actually runs the command.
A theme can opt into the distinction
A session can assign different colors with ordinary fish variables:
set -g fish_color_builtin blue
set -g fish_color_function magenta
The interactive reference identifies cd and set as builtin examples and user-defined functions as the function category. The values use the same color vocabulary accepted by set_color. Theme authors can also use supported formatting modifiers, so the distinction need not depend solely on two different foreground hues.
This is configuration of the command line's presentation. Setting these variables does not change the body of a function, replace a builtin, or alter a command's arguments. A color can draw attention to a category that the highlighter recognizes. It cannot explain everything that a wrapper function does internally.
That limit matters because functions are executable configuration. A function name can be concise while its body contains several operations. Separate highlighting makes the category visible, and inspection remains available when the body matters. The color is useful as an entry point to understanding a command, without becoming a substitute for its definition.
I prefer the optional fallback here. A theme with a deliberate, restrained palette should not need an immediate update simply because fish gained a new category. Users who want the extra distinction can choose it, while existing command colors still provide a defined appearance for the new roles.
The patch updates the formatter as well. Its HTML output maps the builtin and function highlighting roles to corresponding class names. That keeps another consumer of the highlighting result aware of the additional categories instead of collapsing them back into the general command role.
Editing helpers also need valid cursor boundaries
The release fixes a crash in commandline --current-process when the cursor is inside a combined-output pipe. The report in issue 12868 reproduced it by pressing Alt+S on the pipe character in echo hi &| less. Its panic reported subtraction overflow.
That example connects an everyday key binding to command-line parsing. A helper that asks for the current process must interpret a cursor position inside a multi-character separator, not only positions within command names and arguments. The release repairs the documented case, allowing the editing operation to examine that command line without the crash.
Fish 4.8.1 also removes argument-position completion offers for abbreviations declared with --position=anywhere, reversing a 4.8.0 change that cluttered the pager. This concerns which candidates appear, while the new color variables concern how recognized command categories appear. Both affect the amount of useful information visible during command entry, with separate configuration and behavior for each.