diff --git a/default-plugins/status-bar/src/main.rs b/default-plugins/status-bar/src/main.rs index 027425a3ae..9a110310af 100644 --- a/default-plugins/status-bar/src/main.rs +++ b/default-plugins/status-bar/src/main.rs @@ -248,10 +248,26 @@ impl ZellijPlugin for State { // [m is background reset, [0K is so that it clears the rest of the line match background { PaletteColor::Rgb((r, g, b)) => { - println!("{}\u{1b}[48;2;{};{};{}m\u{1b}[0K", first_line, r, g, b); + if rows > 1 { + println!("{}\u{1b}[48;2;{};{};{}m\u{1b}[0K", first_line, r, g, b); + } else { + if self.mode_info.mode == InputMode::Normal { + print!("{}\u{1b}[48;2;{};{};{}m\u{1b}[0K", first_line, r, g, b); + } else { + print!("\u{1b}[m{}\u{1b}[0K", second_line); + } + } }, PaletteColor::EightBit(color) => { - println!("{}\u{1b}[48;5;{}m\u{1b}[0K", first_line, color); + if rows > 1 { + println!("{}\u{1b}[48;5;{}m\u{1b}[0K", first_line, color); + } else { + if self.mode_info.mode == InputMode::Normal { + print!("{}\u{1b}[48;5;{}m\u{1b}[0K", first_line, color); + } else { + print!("\u{1b}[m{}\u{1b}[0K", second_line); + } + } }, }