New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

set_color to be a built-in #578

Closed
ridiculousfish opened this Issue Feb 15, 2013 · 2 comments

Comments

Projects
None yet
2 participants
@ridiculousfish
Member

ridiculousfish commented Feb 15, 2013

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.

@ridiculousfish

This comment has been minimized.

Show comment
Hide comment
Member

ridiculousfish commented Feb 15, 2013

@terlar

This comment has been minimized.

Show comment
Hide comment
@terlar

terlar Feb 16, 2013

Contributor

Sounds very sane, great change 👍

Contributor

terlar commented Feb 16, 2013

Sounds very sane, great change 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment