-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
fish_pager_color_*background
variables don't support -b
option
#8053
Comments
Ah, good catch!
The color variables are supposed to be usable as arguments to
Well, no. That's the issue. This is supposed to accept arguments like Lines 354 to 376 in 6950272
(and of course there's a TODO, but that's not trivial because it'd really require untangling the argument parsing from set_color - which is awkward because that also has "--help", and getopt needs a null-terminated array, and... it's entirely possible, just annoying work that someone needs to do)
Both. Fish interprets the option, and prints the corresponding escape sequences. The terminal then interprets those and emits the corresponding color. With "--reverse", it prints the "enter reverse mode" escape sequence (the same as
It also allows "--reverse" could be "the reverse of the background I gave". Which is weird, and it will probably also apply to the text, but at least it will have an effect on the background.
Alright, so let's first fix the issue at hand - you can't do Then, after that, we can solve #25 and allow background colors for more colors, and then possibly decide that we don't need some special background variables anymore. |
This spoke of "--bold" and "-b", which are two different things - "-b" is short for "--background", bold is "-o". Instead let's just mention the long versions of all the switches. See #8053.
Eg.
set fish_pager_color_background --background=red
works, whileset fish_pager_color_background -b red
does not, but probably should.While you're at it, please add some clarification to the docs:
The relevant section "Syntax highlighting variables" states:
This is misleading, because for
set_color
,-b
is equivalent to--background
, while--bold
is shortened to-o
. Additionally, all other options (bold, italic, underline, reverse, dim) also seem to be supported, both as long and short options.It's a little bit confusing that the variables ending in
_background
have to be set with the additional--background
option. I know this is technically easier to do, and I don't even know if it would be less confusing if we could omit that. Current state seems to be:a) every
_background
variable only suppports the--background
option, nothing else.b) every other (foreground) variable supports every styling option from
set_color
(i.e. bold, underline, italic, reverse, dim), but not--background
.Question: how does fish internally color these parts? Are foreground and background color handled differently, or is there a call to set_color somewhere? Because I don't know why we shouldn't be able to also color the background for fish's syntax highlighting. I noticed that the foreground colors still support the
reverse
option, but I'm not sure if this is handled by fish or my terminal.Tested with both version 3.2.2 and latest build 3.2.2-388-g695027234 from git on Arch Linux.
The text was updated successfully, but these errors were encountered: