Skip to content
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

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

Open
sagittarius-a opened this issue Jul 26, 2021 · 3 comments
Open
Labels
bug Something isn't working plugin system Enhancement or fixes related to plugin system

Comments

@sagittarius-a
Copy link
Contributor

Context

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

  • have the status-bar at the top, with a single line only (with the overview of the current mode only, without the Tip section)
  • have the tab-bar at the bottom without further changes

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

  • Did I miss something in the status-bar plugin that directly solves the issue ?
  • Is the status-bar designed to be at the bottom of the screen only ?

Basic information

  • zellij version: commit f5734f2
  • lines: 21
  • cols: 115
  • alacritty version: alacritty 0.8.0 (a1b13e68) (in the screenshot. Bug reproduced in other terms as well)

Thanks

@sagittarius-a sagittarius-a added the bug Something isn't working label Jul 26, 2021
@TheLostLambda
Copy link
Member

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

@sagittarius-a
Copy link
Contributor Author

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
Copy link
Member

@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?

@a-kenji a-kenji added the plugin system Enhancement or fixes related to plugin system label Aug 2, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working plugin system Enhancement or fixes related to plugin system
Projects
None yet
Development

No branches or pull requests

3 participants