Thanks to visit codestin.com
Credit goes to github.com

Skip to content

set_color to be a built-in #578

@ridiculousfish

Description

@ridiculousfish

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions