-
-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Description
Here's why I want set_color to be a builtin, despite the law of minimalism:
set_color is too complicated to be a function. This means it has to be an executable, and we run into the "relocatable fish" problem of how do we update PATH? We can address this in other cases with a function-wrapper that looks it up in $__fish_bin_dir, but that's a pretty slow process - ok for fish_indent but not set_color.
There's also a number of places in fish where we call set_color and cache the output and then try to determine when to invalidate the cache. If it were just a builtin, we could drop all of that. This also means that our prompts will fork less.
So keeping it as a separate executable incurs a moderate complexity and performance price, and makes it harder to achieve the goal of no longer needing to modify PATH.