Document differences between builtin set_color and fish_color_* handling

This commit is contained in:
Johannes Altmanninger
2025-04-18 13:02:41 +02:00
parent 939902eb29
commit c32b7d35ea

View File

@@ -126,6 +126,11 @@ pub fn set_color(parser: &Parser, streams: &mut IoStreams, argv: &mut [&wstr]) -
if is_reset || [fg, bg].iter().any(|c| c.is_some_and(|c| c.is_normal())) {
outp.reset_text_face();
} else {
// Historically we have not used set_text_face() for colors here.
// Doing so would add two magic behaviors:
// - if fg and bg are equal, it makes one of them white
// - if bg is not normal, it makes the foreground bold
// The first one seems fine but the second one not really.
outp.set_text_face(TextFace::new(Color::None, Color::None, style));
if let Some(fg) = fg {
if !outp.write_color(fg, true /* is_fg */) {