zellij-org / zellij

A terminal workspace with batteries included
https://zellij.dev
MIT License
21.19k stars 644 forks source link

[Plugin] Status bar plugin issue when the status bar is at the top #628

Open sagittarius-a opened 3 years ago

sagittarius-a commented 3 years ago

Context

I was trying to swap the position of the status-bar and the tab-bar. To be more explicit, I wanted to:

Changes on my side

To do so, I changed the zellij-utils/assets/layouts/default.yaml file with the following content:

---
direction: Horizontal
parts:
  - direction: Vertical
    split_size:
      Fixed: 1
    run:
      plugin: target/wasm32-wasi/debug/status-bar.wasm
  - direction: Vertical
  - direction: Vertical
    split_size:
      Fixed: 2
    run:
      plugin: tab-bar

I also updated the status-bar plugin applying the following changes in order to disable the Tip section:

--- a/default-plugins/status-bar/src/main.rs
+++ b/default-plugins/status-bar/src/main.rs
@@ -169,6 +169,6 @@ impl ZellijPlugin for State {
                 println!("{}\u{1b}[48;5;{}m\u{1b}[0K", first_line, color);
             }
         }
-        println!("\u{1b}[m{}\u{1b}[0K", second_line);
+        // println!("\u{1b}[m{}\u{1b}[0K", second_line);
     }
 }

Bug description

As a result, I have the status-bar at the top but there is a noticeable split, which was not present with the tab-bar plugin, and the prompt is not displayed until I redraw it by issuing a command.

image

Questions

Basic information

# Thanks

TheLostLambda commented 3 years ago

Hey @sagittarius-a ! Could you try swapping the 2 and 1 for the fixed split_sizes? That might resolve things?

sagittarius-a commented 3 years ago

Well it is a good start !

Now the prompt is ok and the split line is gone but there is still some visual glitch: image

TheLostLambda commented 3 years ago

@sagittarius-a Thanks for giving that a try! I suspect the remaining issue may come from a bit of plugin code (I'm working on fixing the fact that this number is duplicated).

You could probably change both this and the height in the layout to 1 if you want to have a 1-line status bar.

Soon that number should only need changing in one place, but that might fix your issue?