Coder Social home page Coder Social logo

zjstatus's Introduction

zjstatus ๐Ÿ“ˆ๐ŸŽจ

A configurable and themable statusbar for zellij.

clippy check latest version GitHub Wiki



The goal of this statusbar is to provide a highly customizable and extensible statusbar for zellij. Single modules can be formatted separately. Due to the widget structure new modules can be created with ease.

Screenshot of the statusbar

Examples

tmux style tmux style bar
simple style simple style bar
slanted style slanted style bar
example for swapping layouts with zjstatus example for swapping layouts with zjstatus
compact style (thanks to @segaja) compact style bar
conky status (thanks to @benzwt) conky.conf conky status
Demo GIF Demo GIF of zellij with zjstatus

๐Ÿš€ Installation

Tip

For more detailed instructions, check out the wiki!

Download the latest binary in the github releases. Place it somewhere, zellij is able to access it. Then the plugin can be included by referencing it in a layout file, e.g. the default layout one.

You could also refer to the plugin guide from zellij, after downloading the binary: https://zellij.dev/documentation/plugin-loading

Please ensure, that the configuration is correct.

Important

In case you experience any crashes or issues, please in the first step try to clear the cache! ($HOME/.cache/zellij/ for Linux, $HOME/Library/Caches/org.Zellij-Contributors.Zellij/ on macOS)

Sometimes, especially when updating zjstatus, it might come to caching issues, which can be resolved by clearing it. Please keep in mind, that it will also clear the cache for running sessions and revokes granted permissions for plugins.

โ„๏ธ Installation with nix flake

Add this repository to your inputs and then with the following overlay to your packages. Then you are able to install and refer to it with pkgs.zjstatus. When templating the config file, you can use ${pkgs.zjstatus}/bin/zjstatus.wasm as the path.

  inputs = {
    # ...

    zjstatus = {
      url = "github:dj95/zjstatus";
    };
  };


  # define the outputs of this flake - especially the home configurations
  outputs = { self, nixpkgs, zjstatus, ... }@inputs:
  let
    inherit (inputs.nixpkgs.lib) attrValues;

    overlays = with inputs; [
      # ...
      (final: prev: {
        zjstatus = zjstatus.packages.${prev.system}.default;
      })
    ];

โš™๏ธ Configuration

For configuring zjstatus, please follow the documentation.

๐ŸŽ๏ธ Quick Start

Place the following configuration in your default layout file, e.g. ~/.config/zellij/layouts/default.kdl. Right after starting zellij, it will prompt for permissions, that needs to be granted in order for zjstatus to work. Simply navigate to the pane or click on it and press y. This must be repeated on updates. For more details on permissions, please visit the wiki.

Important

Using zjstatus involves creating new layouts and overriding the default one. This will lead to swap layouts not working, when they are not configured correctly. Please follow this documentation for getting swap layouts back to work, if you need them.

Important

If you want to hide borders, please remove the hide_frame_for_single_pane option or set it to false. Otherwise zjstatus will toggle frame borders even if the are hidden in zellijs config!

layout {
    default_tab_template {
        children
        pane size=1 borderless=true {
            plugin location="https://github.com/dj95/zjstatus/releases/latest/download/zjstatus.wasm" {
                format_left   "{mode} #[fg=#89B4FA,bold]{session}"
                format_center "{tabs}"
                format_right  "{command_git_branch} {datetime}"
                format_space  ""

                border_enabled  "false"
                border_char     "โ”€"
                border_format   "#[fg=#6C7086]{char}"
                border_position "top"

                hide_frame_for_single_pane "true"

                mode_normal  "#[bg=blue] "
                mode_tmux    "#[bg=#ffc387] "

                tab_normal   "#[fg=#6C7086] {name} "
                tab_active   "#[fg=#9399B2,bold,italic] {name} "

                command_git_branch_command     "git rev-parse --abbrev-ref HEAD"
                command_git_branch_format      "#[fg=blue] {stdout} "
                command_git_branch_interval    "10"
                command_git_branch_rendermode  "static"

                datetime        "#[fg=#6C7086,bold] {format} "
                datetime_format "%A, %d %b %Y %H:%M"
                datetime_timezone "Europe/Berlin"
            }
        }
    }
}

๐Ÿงฑ Widgets

The documentation for the widgets can be found in the wiki.

The following widgets are available:

๐Ÿšง Development

Make sure you have rust and the wasm32-wasi target installed. If using nix, you could utilize the nix-shell in this repo for obtaining cargo and rustup. Then you'll only need to add the target with rustup target add wasm32-wasi.

With the toolchain, simply build zjstatus with cargo build. Then you are able to run the example configuration with zellij -l plugin-dev-workspace.kdl from the root of the repository.

๐Ÿค Contributing

If you are missing features or find some annoying bugs please feel free to submit an issue or a bugfix within a pull request :)

๐Ÿ“ License

ยฉ 2024 Daniel Jankowski

This project is licensed under the MIT license.

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

zjstatus's People

Contributors

benzwt avatar dj95 avatar lpnh avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

zjstatus's Issues

Transparent Cell Color

Is there a way to set a blank color for background or foreground so it inherits the colors from the terminal color scheme?

I'm playing with transparency in my terminal and I'd like the gaps between tabs to be transparent.
image

doc/feat: contrasting the status bar from the rest of zellij

When I have pane frames disabled (getting me a few extra lines on my laptop display), the status bar sometimes melds too well with my actual session.

I would like to have zjstatus separated, somehow. I usually run my term emus with a BG slightly lighter than solid black, so I could set zjstatus to use #000000 as a bgcolor, and that might work.

Alternatively, or additionally, my panes are separated still with the normal separator and it feels like zjstatus should too. Is this something zjstatus can control? It feels like maybe it's a property of the layout, but all the same it would be nice if zjstatus documentation included a hint on how to add the separators in a layout including it.

As always, thank you, I love zellij and zjstatus only increases the good feelings.

vim-tpipeline support

Is your feature request related to a problem? Please describe.
I am currently working on nvim-zjstatus-pipeline. So far, it seems feasible. However, I cannot create a command like

command_left_command "cat /tmp/zjstatus-$(id -u)/$ZELLIJ_SESSION_NAME-$ZELLIJ_PANE_ID-vimbridge

Because the command handle neither evaluates $() commands nor environment variables.

Describe the solution you'd like
I request considering one of the following:

  1. add a file handle that listens on changes of a file and prints its contents to the status bar AND accepts at least env variables
  2. let command handles evaluate nested commands or at least env variables.

Additional context
Please don't hesitate to ask anything if I didnยดt express this clearly enough.

Add `format_center`

Is your feature request related to a problem? Please describe.
I would like to create something like tpipeline with zjstatus. Basically, it's all there. The only thing, I would love to see is having the mode and the tabs rendered in the center, so I can put nvims statusline parts to the left and right. Because, as of now, I need to "attach" the mode and tabs to the left - that makes it jump around a bit weirdly.

Describe the solution you'd like
A new configurable property format_center that renders its content to the center of zjstatus.

Enable issue.

Hi man!
I hope you are doing great!
Firstly, I would like to thank your efforts on this plugin!
So, I try to use, but unfortunately I didn't... Rsrsrsr.
As you can see on the image, I just couldn't reach the pane to enable the plugin access.
I try to navigate to the pane but no success at all.

Could you please give me some help?
I think I'm doing something wrong.
Have a nice day!
ZJSTATUS

alt <[]> keymap not working

when use default layout, PreviousSwapLayout, NextSwapLayout work well, but not working when layout is zjstatus

No *.wasm for the latest realease

Maybe it has been forgotten in the process ^^

If not, I tried to compile it, but I have hundreds of "cannot find xxx in this scope" errors. I suppose that it's because it uses Rust 1.72 while I'm on 1.75 and the wasm32-wasi is not added to the 1.72 version of rustc when cargo download what's necessary from the 1.75 version?

Sorry if the question is stupid, I'm not yet familiar with Rust and its ecosystem unfortunately :) Thanks!

ansicolor default

Is your feature request related to a problem? Please describe.
yep. i want background blur with alacritty and it only does that if the bg color is set to 49 (ansicolor default). i can use a separate magic 49 for any backgrounds but it feels meh.

Describe the solution you'd like
i want a "default" color alias which maps to AnsiColor::Default so i can use it both as a fg and bg (which map to the respective 39/49 values depending on fg or bg)

Additional context
alacritty

New session no loading plugin

Describe the bug
zjstatus isn't being loaded when creating a new session via session-manager

To Reproduce
Steps to reproduce the behavior:

  1. Active session-manager
  2. Create new session (ctrl + w)

Expected behavior
A new session created loading zjstatus

Actual behavior
A new session loading default plugin zellij:tab-bar

Desktop (please complete the following information):

  • OS: macos
  • Zellij version v0.39.2
  • Version v0.11.2

Layout

How does the layout look like? Please copy it into a code block.

// vi: ft=javascript

layout {
  pane
  pane size=1 borderless=true {
        // curl -L -o $HOME/.config/zellij/plugins/zjstatus.wasm https://github.com/dj95/zjstatus/releases/latest/download/zjstatus.wasm
    plugin location="file:$HOME/.config/zellij/plugins/zjstatus.wasm" {
      hide_frame_for_single_pane "false"

      format_left  "#[fg=0,bg=10] [{session}] {tabs}"
      format_space "#[bg=10]"
      format_right "#[fg=0,bg=10]{command_git_branch} {datetime}"

      tab_normal "{name}  "
      tab_active "{name}* "

      command_git_branch_command    "git rev-parse --abbrev-ref HEAD"
      command_git_branch_format     "{stdout} "
      command_git_branch_interval   "10"
      command_git_branch_rendermode "static"

      datetime                  " {format} "
      datetime_format     "%H:%M:%S"
      datetime_timezone "America/Denver"
    }
  }
}
session_name "0"
attach_to_session true

Additional context
This might be an issue with zellij proper and not this plugin ๐Ÿคท

need for more widgets

Thanks to the command widget, I'm able to run an arbitrary action on zjstatus.
For me, a single command widget is not enough; I run a conky to monitor my system, but I need to monitor the stock as well.

I have conceived two approaches

  • plugin based
    • users develop theirs own widgets and load into zjstatus
  • command widget with vector in mind
    • expanding the command widget with container such that it can hold multiple commands.


zjstatus-featureRequest drawio

How to log zjstatus info to a file

Description

In order to have a better understanding how the zjstatus works under the hook, I need a logging mechanism which able to log info to a file.
I have tried several logger crates but none of them worked. Please recommend a logger that works with zjstatus/wasi.

thanks!

Possible issue between auto-remove frame feature and floating panes

Describe the bug
When opening a floating pane in a single-pane tab, if it is hidden and you open another pane next to your current one, the simplified border look will automatically be applied regardless if it's enabled or not.

To Reproduce
Steps to reproduce the behavior:

  1. In a new Zellij session with zjstatus properly loaded, open a new floating pane.
  2. Hide the pane.
  3. Open a new side pane (next to or above/below the current one, shouldn't matter).
  4. The borders will have the simplified line-border look instead of having the more detailed bordered frame one.
  5. If you open the floating pane and exit it, the borders will automatically change the their detailed counterpart.

Expected behavior
The expected behavior is that the panes should look simplified if the steps have been followed. It is important to note that if you first open a pane next to your current one and then open a floating pane the issue will not happen, so it's important to first open up the floating one.

Screenshots

Before closing the floating pane
image
After closing the floating pane
image

Desktop (please complete the following information):

  • OS: NixOS
  • Zellij version: v0.39.2
  • zjstatus version: Latest available in Nix flakes.

Layout

How does the layout look like? Please copy it into a code block.

layout {
    pane size=1 borderless=true {
      plugin location="file:${inputs.zjstatus.packages.${pkgs.system}.default}/bin/zjstatus.wasm" {
        format_left  "{mode}"
  			format_center "{tabs}"
  			format_right "#[bg=${blue},fg=${black},bold] {session} "
        format_space "#[bg=${black}]"

        border_enabled  "false"
        border_char     "โ”€"
        border_format   "#[fg=${yellow}]{char}"
        border_position "top"

        hide_frame_for_single_pane "true"

  			mode_normal "#[bg=${blue},fg=${black},bold] {name} "
  			mode_locked "#[bg=${red},fg=${black},bold] {name} "
        mode_tab "#[bg=${green},fg=${black}] {name} "
  			mode_pane "#[bg=${purple},fg=${black}] {name} "
  			mode_session "#[bg=${orange},fg=${black}] {name} "
        mode_default_to_mode "normal"

        tab_normal   "#[bg=${black},fg=${light_purple}] {index} #[bg=${black},fg=${white}] {name} "
        tab_active   "#[bg=${purple},fg=${black}] {index} #[bg=${brightBlack},fg=${white},bold] {name} "
        tab_separator ""
      }
    }
  pane split_direction="vertical" {
        pane
    }
  }

Ability to add space between the tab items ๐Ÿ’…

Is your feature request related to a problem? Please describe.
Thank you for the plugin! This helped me migrating my visuals from tmux to zellij. I pretty much liked it and worked for me. It isn't something fancy.
image

However, in order to have separators I had to include an extra spacing with no formatting (nix code):

      tab_normal   "#[fg=${yellow}] {index} #[fg=${brightWhite}] {name} #[] "
      tab_active   "#[bg=${yellow},fg=${black}] {index} #[bg=${brightBlack},fg=${white}] {name} #[] "

Notice how it ends with $[] ".

Describe the solution you'd like
To make intent more clear, adding a tab_separator perhaps that defaults to empty String and allows, in my case, to set to .

Additional context
I have other enhancements that I will track separately.

Hide frames

In the Zellij settings there is the option of not showing frames, but even configured not to display the frames, ZJstatus render frames when using more than one panel.

Zjstatus could follow according to the configuration made in Zellij.

Ctrl + [ or ] doesn't work

If you start zellij with zellij or zellij --layout compact and make new pane with ctrl+p n new pane will show on right side and you can change layout from vertical to horizontal or vice versa with ctrl+] or ctrl+[. But if I start zellij --layout zjstatus and try to change pane layout with these shortcuts do nothing.

my ~/.config/zellij/layouts/zjstatus.kdl

layout {
    pane split_direction="vertical" {
        pane
    }

    pane size=1 borderless=true {
        plugin location="file:~/.config/zellij/plugins/zjstatus.wasm" {
            format_left  "{mode}{tabs}"
            format_right "#[fg=#b8bb26,bold]{session}"
            format_space ""

            first_start                "false"
            hide_frame_for_single_pane "false"

            mode_normal        "#[fg=#b8bb26,bold]{name}"
            mode_locked        "#[fg=#fb4934,bold]{name}"
            mode_resize        "#[fg=#fabd2f,bold]{name}"
            mode_pane          "#[fg=#d3869b,bold]{name}"
            mode_tab           "#[fg=#83a598,bold]{name}"
            mode_scroll        "#[fg=#8ec07c,bold]{name}"
            mode_session       "#[fg=#fe8019,bold]{name}"
            mode_move          "#[fg=#a89984,bold]{name}"

            tab_normal   "#[fg=#a89984,bold] {name}"
            tab_active   "#[fg=#83a598,bold] {name}"
        }
    }
}

my ~/.config/zellij/config.kdl

// If you'd like to override the default keybindings completely, be sure to change "keybinds" to "keybinds clear-defaults=true"
keybinds {
    normal {
        // uncomment this and adjust key if using copy_on_select=false
        // bind "Alt c" { Copy; }
    }
    locked {
        bind "Ctrl g" { SwitchToMode "Normal"; }
    }
    resize {
        bind "Ctrl n" { SwitchToMode "Normal"; }
        bind "h" "Left" { Resize "Increase Left"; }
        bind "j" "Down" { Resize "Increase Down"; }
        bind "k" "Up" { Resize "Increase Up"; }
        bind "l" "Right" { Resize "Increase Right"; }
        bind "H" { Resize "Decrease Left"; }
        bind "J" { Resize "Decrease Down"; }
        bind "K" { Resize "Decrease Up"; }
        bind "L" { Resize "Decrease Right"; }
        bind "=" "+" { Resize "Increase"; }
        bind "-" { Resize "Decrease"; }
    }
    pane {
        bind "Ctrl p" { SwitchToMode "Normal"; }
        bind "h" "Left" { MoveFocus "Left"; }
        bind "l" "Right" { MoveFocus "Right"; }
        bind "j" "Down" { MoveFocus "Down"; }
        bind "k" "Up" { MoveFocus "Up"; }
        bind "p" { SwitchFocus; }
        bind "n" { NewPane; SwitchToMode "Normal"; }
        bind "d" { NewPane "Down"; SwitchToMode "Normal"; }
        bind "r" { NewPane "Right"; SwitchToMode "Normal"; }
        bind "x" { CloseFocus; SwitchToMode "Normal"; }
        bind "f" { ToggleFocusFullscreen; SwitchToMode "Normal"; }
        bind "z" { TogglePaneFrames; SwitchToMode "Normal"; }
        bind "w" { ToggleFloatingPanes; SwitchToMode "Normal"; }
        bind "e" { TogglePaneEmbedOrFloating; SwitchToMode "Normal"; }
        bind "c" { SwitchToMode "RenamePane"; PaneNameInput 0;}
    }
    move {
        bind "Ctrl h" { SwitchToMode "Normal"; }
        bind "n" "Tab" { MovePane; }
        bind "p" { MovePaneBackwards; }
        bind "h" "Left" { MovePane "Left"; }
        bind "j" "Down" { MovePane "Down"; }
        bind "k" "Up" { MovePane "Up"; }
        bind "l" "Right" { MovePane "Right"; }
    }
    tab {
        bind "Ctrl t" { SwitchToMode "Normal"; }
        bind "r" { SwitchToMode "RenameTab"; TabNameInput 0; }
        bind "h" "Left" "Up" "k" { GoToPreviousTab; }
        bind "l" "Right" "Down" "j" { GoToNextTab; }
        bind "n" { NewTab; SwitchToMode "Normal"; }
        bind "x" { CloseTab; SwitchToMode "Normal"; }
        bind "s" { ToggleActiveSyncTab; SwitchToMode "Normal"; }
        bind "b" { BreakPane; SwitchToMode "Normal"; }
        bind "]" { BreakPaneRight; SwitchToMode "Normal"; }
        bind "[" { BreakPaneLeft; SwitchToMode "Normal"; }
        bind "1" { GoToTab 1; SwitchToMode "Normal"; }
        bind "2" { GoToTab 2; SwitchToMode "Normal"; }
        bind "3" { GoToTab 3; SwitchToMode "Normal"; }
        bind "4" { GoToTab 4; SwitchToMode "Normal"; }
        bind "5" { GoToTab 5; SwitchToMode "Normal"; }
        bind "6" { GoToTab 6; SwitchToMode "Normal"; }
        bind "7" { GoToTab 7; SwitchToMode "Normal"; }
        bind "8" { GoToTab 8; SwitchToMode "Normal"; }
        bind "9" { GoToTab 9; SwitchToMode "Normal"; }
        bind "Tab" { ToggleTab; }
    }
    scroll {
        bind "Ctrl s" { SwitchToMode "Normal"; }
        bind "e" { EditScrollback; SwitchToMode "Normal"; }
        bind "s" { SwitchToMode "EnterSearch"; SearchInput 0; }
        bind "Ctrl c" { ScrollToBottom; SwitchToMode "Normal"; }
        bind "j" "Down" { ScrollDown; }
        bind "k" "Up" { ScrollUp; }
        bind "Ctrl f" "PageDown" "Right" "l" { PageScrollDown; }
        bind "Ctrl b" "PageUp" "Left" "h" { PageScrollUp; }
        bind "d" { HalfPageScrollDown; }
        bind "u" { HalfPageScrollUp; }
        // uncomment this and adjust key if using copy_on_select=false
        // bind "Alt c" { Copy; }
    }
    search {
        bind "Ctrl s" { SwitchToMode "Normal"; }
        bind "Ctrl c" { ScrollToBottom; SwitchToMode "Normal"; }
        bind "j" "Down" { ScrollDown; }
        bind "k" "Up" { ScrollUp; }
        bind "Ctrl f" "PageDown" "Right" "l" { PageScrollDown; }
        bind "Ctrl b" "PageUp" "Left" "h" { PageScrollUp; }
        bind "d" { HalfPageScrollDown; }
        bind "u" { HalfPageScrollUp; }
        bind "n" { Search "down"; }
        bind "p" { Search "up"; }
        bind "c" { SearchToggleOption "CaseSensitivity"; }
        bind "w" { SearchToggleOption "Wrap"; }
        bind "o" { SearchToggleOption "WholeWord"; }
    }
    entersearch {
        bind "Ctrl c" "Esc" { SwitchToMode "Scroll"; }
        bind "Enter" { SwitchToMode "Search"; }
    }
    renametab {
        bind "Ctrl c" { SwitchToMode "Normal"; }
        bind "Esc" { UndoRenameTab; SwitchToMode "Tab"; }
    }
    renamepane {
        bind "Ctrl c" { SwitchToMode "Normal"; }
        bind "Esc" { UndoRenamePane; SwitchToMode "Pane"; }
    }
    session {
        bind "Ctrl o" { SwitchToMode "Normal"; }
        bind "Ctrl s" { SwitchToMode "Scroll"; }
        bind "d" { Detach; }
        bind "w" {
            LaunchOrFocusPlugin "zellij:session-manager" {
                floating true
                move_to_focused_tab true
            };
            SwitchToMode "Normal"
        }
    }
    tmux {
        bind "[" { SwitchToMode "Scroll"; }
        bind "Ctrl b" { Write 2; SwitchToMode "Normal"; }
        bind "\"" { NewPane "Down"; SwitchToMode "Normal"; }
        bind "%" { NewPane "Right"; SwitchToMode "Normal"; }
        bind "z" { ToggleFocusFullscreen; SwitchToMode "Normal"; }
        bind "c" { NewTab; SwitchToMode "Normal"; }
        bind "," { SwitchToMode "RenameTab"; }
        bind "p" { GoToPreviousTab; SwitchToMode "Normal"; }
        bind "n" { GoToNextTab; SwitchToMode "Normal"; }
        bind "Left" { MoveFocus "Left"; SwitchToMode "Normal"; }
        bind "Right" { MoveFocus "Right"; SwitchToMode "Normal"; }
        bind "Down" { MoveFocus "Down"; SwitchToMode "Normal"; }
        bind "Up" { MoveFocus "Up"; SwitchToMode "Normal"; }
        bind "h" { MoveFocus "Left"; SwitchToMode "Normal"; }
        bind "l" { MoveFocus "Right"; SwitchToMode "Normal"; }
        bind "j" { MoveFocus "Down"; SwitchToMode "Normal"; }
        bind "k" { MoveFocus "Up"; SwitchToMode "Normal"; }
        bind "o" { FocusNextPane; }
        bind "d" { Detach; }
        bind "Space" { NextSwapLayout; }
        bind "x" { CloseFocus; SwitchToMode "Normal"; }
    }
    shared_except "locked" {
        bind "Ctrl g" { SwitchToMode "Locked"; }
        bind "Ctrl q" { Quit; }
        bind "Alt n" { NewPane; }
        bind "Alt h" "Alt Left" { MoveFocusOrTab "Left"; }
        bind "Alt l" "Alt Right" { MoveFocusOrTab "Right"; }
        bind "Alt j" "Alt Down" { MoveFocus "Down"; }
        bind "Alt k" "Alt Up" { MoveFocus "Up"; }
        bind "Alt =" "Alt +" { Resize "Increase"; }
        bind "Alt -" { Resize "Decrease"; }
        bind "Alt [" { PreviousSwapLayout; }
        bind "Alt ]" { NextSwapLayout; }
    }
    shared_except "normal" "locked" {
        bind "Enter" "Esc" { SwitchToMode "Normal"; }
    }
    shared_except "pane" "locked" {
        bind "Ctrl p" { SwitchToMode "Pane"; }
    }
    shared_except "resize" "locked" {
        bind "Ctrl n" { SwitchToMode "Resize"; }
    }
    shared_except "scroll" "locked" {
        bind "Ctrl s" { SwitchToMode "Scroll"; }
    }
    shared_except "session" "locked" {
        bind "Ctrl o" { SwitchToMode "Session"; }
    }
    shared_except "tab" "locked" {
        bind "Ctrl t" { SwitchToMode "Tab"; }
    }
    shared_except "move" "locked" {
        bind "Ctrl h" { SwitchToMode "Move"; }
    }
    shared_except "tmux" "locked" {
        bind "Ctrl b" { SwitchToMode "Tmux"; }
    }
}

plugins {
    tab-bar { path "tab-bar"; }
    status-bar { path "status-bar"; }
    strider { path "strider"; }
    compact-bar { path "compact-bar"; }
    session-manager { path "session-manager"; }
}

// Choose what to do when zellij receives SIGTERM, SIGINT, SIGQUIT or SIGHUP
// eg. when terminal window with an active zellij session is closed
// Options:
//   - detach (Default)
//   - quit
//
// on_force_close "quit"

//  Send a request for a simplified ui (without arrow fonts) to plugins
//  Options:
//    - true
//    - false (Default)
//
// simplified_ui true

// Choose the path to the default shell that zellij will use for opening new panes
// Default: $SHELL
//
// default_shell "fish"

// Choose the path to override cwd that zellij will use for opening new panes
//
// default_cwd ""

// Toggle between having pane frames around the panes
// Options:
//   - true (default)
//   - false
//
pane_frames false

// Toggle between having Zellij lay out panes according to a predefined set of layouts whenever possible
// Options:
//   - true (default)
//   - false
//
// auto_layout true

// Define color themes for Zellij
// For more examples, see: https://github.com/zellij-org/zellij/tree/main/example/themes
// Once these themes are defined, one of them should to be selected in the "theme" section of this file
//
// themes {
//     dracula {
//         fg 248 248 242
//         bg 40 42 54
//         red 255 85 85
//         green 80 250 123
//         yellow 241 250 140
//         blue 98 114 164
//         magenta 255 121 198
//         orange 255 184 108
//         cyan 139 233 253
//         black 0 0 0
//         white 255 255 255
//     }
// }

// Choose the theme that is specified in the themes section.
// Default: default
//
theme "gruvbox-dark"

// The name of the default layout to load on startup
// Default: "default"
//
// default_layout "compact"

// Choose the mode that zellij uses when starting up.
// Default: normal
//
// default_mode "locked"

// Toggle enabling the mouse mode.
// On certain configurations, or terminals this could
// potentially interfere with copying text.
// Options:
//   - true (default)
//   - false
//
mouse_mode false

// Configure the scroll back buffer size
// This is the number of lines zellij stores for each pane in the scroll back
// buffer. Excess number of lines are discarded in a FIFO fashion.
// Valid values: positive integers
// Default value: 10000
//
scroll_buffer_size 1000000

// Provide a command to execute when copying text. The text will be piped to
// the stdin of the program to perform the copy. This can be used with
// terminal emulators which do not support the OSC 52 ANSI control sequence
// that will be used by default if this option is not set.
// Examples:
//
// copy_command "xclip -selection clipboard" // x11
// copy_command "wl-copy"                    // wayland
// copy_command "pbcopy"                     // osx

// Choose the destination for copied text
// Allows using the primary selection buffer (on x11/wayland) instead of the system clipboard.
// Does not apply when using copy_command.
// Options:
//   - system (default)
//   - primary
//
// copy_clipboard "primary"

// Enable or disable automatic copy (and clear) of selection when releasing mouse
// Default: true
//
// copy_on_select false

// Path to the default editor to use to edit pane scrollbuffer
// Default: $EDITOR or $VISUAL
//
// scrollback_editor "/usr/bin/vim"

// When attaching to an existing session with other users,
// should the session be mirrored (true)
// or should each user have their own cursor (false)
// Default: false
//
// mirror_session true

// The folder in which Zellij will look for layouts
//
// layout_dir "/path/to/my/layout_dir"

// The folder in which Zellij will look for themes
//
// theme_dir "/path/to/my/theme_dir"

// ui {
//     pane_frames {
//         hide_session_name true
//     }
// }

Have I set something wrong?

Plugin errors out after updating to zellij 0.41 and persists after a rollback to zellij 0.40

Describe the bug
In attempting to assist a zellij user reproduce a possible bug I cloned and built zellij 0.41 from source. Upon loading the plugin errors out using both automatic and manual installation methods (https: & file:)

To Reproduce
Steps to reproduce the behavior:

  1. Exit zellij, delete cache and do cargo uninstall zellij.
  2. clone zellij repo, build zellij 0.41 from source and install it with cargo
  3. load zellij with my configs layout that contains the tab template with my zjstatus configuration
  4. plugin errors out and tells me to check logs
    image
    I was unable to find any logs in /var/logs, ~/.config/zellij/plugins or its parent. Unsure where else I could look.

Expected behavior
Expect plugin to load in status bar

Screenshots
If applicable, add screenshots to help explain your problem.

Desktop (please complete the following information):

  • OS:
    image

  • Zellij version [e.g. v0.39.0]
    image
    Reproducible after rolling back to zellij 0.40 as well
    image

  • Version [e.g. v0.9.0]
    plugin location="https://github.com/dj95/zjstatus/releases/download/v0.14.1-rc1/zjstatus.wasm"
    I've also tried rolling this back to 0.14 stable with no luck
    Layout

How does the layout look like? Please copy it into a code block.

layout {
  default_tab_template {
    children
    pane size=1 borderless=true {
      plugin location="http://github.com/dj95/zjstatus/releases/download/v0.14./zjstatus.wasm" {
        format_left   "{mode} #[fg=#89b4fa,bold]{session}"
        format_center "{tabs}"
        format_right  "{command_git_branch} {datetime}{notifications}"
        format_space  ""

        border_enabled  "false"
        border_char     "โ”€"
        border_format   "#[fg=#6c7086]{char}"
        border_position "top"
        
        notification_format_unread           "#[fg=#89b4fa,bg=#181825,blink] ๎ฉซ #[fg=#89b4fa,bg=#181825] {message} "
        notification_format_no_notifications "#[fg=#89b4fa,bg=#181825,dim] ๎ฉซ  "
        notification_show_interval           "10"

        hide_frame_for_single_pane "true"

        mode_normal  "#[fg=#CF142B,bg=green] ๎ญด UNLOCKED "
        mode_locked "#[bg=#CF142B] ๎ฉต LOCKED "
        mode_session "#[fg=#333333,bg=green] ๐Ÿ–ณ {name} "
        mode_resize "#[fg=#333333,bg=#FF6700] ๎ฌข {name} "
        mode_pane "#[fg=#333333,bg=green] ๎ฏˆ {name} "
        mode_tab "#[fg=#333333,bg=green] โญพ {name} "
        mode_scroll "#[fg=#333333,bg=green] ๓ฐญœ {name} "
        mode_enter_search "#[fg=#333333,bg=green] ๎™„ {name} "
        mode_search "#[fg=#333333,bg=green] ๎™„ {name} "
        mode_rename_tab "#[fg=#333333,bg=#FF6700] โญพ {name} "
        mode_rename_pane "#[fg=#333333,bg=#FF6700] ๎ฏˆ {name} "
        mode_move "#[fg=#333333,bg=green] ๎ฌข {name} "
        mode_prompt "#[fg=#333333,bg=green] ๎ช… {name} "
        mode_default_to_mode "locked"

        tab_normal   "#[fg=#6C7086] {index}::{name} "
        tab_normal_fullscreen "#[fg=#6C7086] {index}::{name} ๎ญŒ "
        tab_normal_sync "#[fg=#6C7086] {index}::{name} ๎ฉท "

        tab_active   "#[fg=#89B4FA,bold,italic] {name} "
        tab_active_fullscreen "#[fg=#89B4FA,bold,italic] {name} ๎ญŒ "
        tab_active_sync "#[fg=#89B4FA,bold,italic] {name} ๎ฉท "

        tab_separator "#[fg=#89B4FA]โฏ"

        command_git_branch_command     "git rev-parse --abbrev-ref head"
        command_git_branch_format      "#[fg=blue] {stdout} "
        command_git_branch_interval    "10"
        command_git_branch_rendermode  "static"

        datetime        "#[fg=#89b4fa,bold] {format} "
        datetime_format "%A, %d %b %Y %H:%M"
        datetime_timezone "America/Chicago"
      }
    }
  }
  tab name="Overview" focus=true cwd="~/.config/" {
    pane split_direction="horizontal" {
      pane {
        size "75%"
        focus true
        borderless true
        command "nvim"
      }
      pane 
    }
  }
  tab name="Neovim" cwd="~/.config/nvim" {
    pane split_direction="horizontal" {
      pane {
        start_suspended true
        size "75%"
        focus true
        borderless true
        command "nvim"
        args "init.lua"
      }
      pane 
    }
  }
  tab name="Fish Shell" cwd="~/.config/fish" {
    pane split_direction="horizontal" {
      pane {
        start_suspended true
        size "75%"
        focus true
        borderless true
        command "nvim"
        args "config.fish"
      }
      pane 
    }
  }
  tab name="Hyprland" cwd="~/.config/hypr" {
    pane split_direction="horizontal" {
      pane {
        start_suspended true
        size "75%"
        focus true
        borderless true
        command "nvim"
        args "hyprland.conf"
      }
      pane 
    }
  }
  tab name="Kitty" cwd="~/.config/kitty" {
    pane split_direction="horizontal" {
      pane {
        start_suspended true
        size "75%"
        focus true
        borderless true
        command "nvim"
        args "kitty.conf"
      }
      pane 
    }
  }
  tab name="Starship" cwd="~/.config/starship" {
    pane split_direction="horizontal" {
      pane {
        start_suspended true
        size "75%"
        focus true
        borderless true
        command "nvim"
        args "starship.toml"
      }
      pane 
    }
  }
  tab name="Waybar" cwd="~/.config/waybar" {
    pane split_direction="horizontal" {
      pane {
        start_suspended true
        size "75%"
        focus true
        borderless true
        command "nvim"
        args "config"
      }
      pane 
    }
  }
  tab name="Yazi" cwd="~/.config/yazi" {
    pane split_direction="horizontal" {
      pane {
        start_suspended true
        size "75%"
        focus true
        borderless true
        command "nvim"
      }
      pane 
    }
  }
}

Additional context
Add any other context about the problem here.
Other plugins from the ecosystem continue to work and seem uneffected by the attempted upgrade and rollback. Plugins checked:
image

Flash of text when creating tabs

When creating new tabs (often, but not always) there will be a very quick flash of text behind the tabs that says something like:
Loading probablyfilepath/zjstatus.wasm

Is it a speed issue? I thought rust is fast. Or is it wasm's fault?

Cannot load the plugin

Hi.
First of all, thank you for the great job you've done!
Unfortunately, I cannot use the plugin.
In zellij log I get:

INFO   |zellij_server::plugins   | 2023-09-11 13:33:01.855 [wasm      ] [zellij-server/src/plugins/mod.rs:137]: Wasm main thread starts
WARN   |zellij_utils::ipc        | 2023-09-11 13:33:02.972 [router    ] [zellij-utils/src/ipc.rs:222]: Error in IpcReceiver.recv(): InvalidMarkerRead(Error { kind: UnexpectedEof, message: "failed to fill whole buffer" })
ERROR  |zellij_client            | 2023-09-11 13:33:02.972 [router    ] [zellij-client/src/lib.rs:348]: Received empty message from server

And nothing.
I used the default config in the document and even added first_start: "true", but didn't change anything.

OS Widget

Is your feature request related to a problem? Please describe.
No

Describe the solution you'd like

I'd like to have an OS Widget like I have in starship:

I'd like to have the same configuration (and be able to use NerdFont icons I chose instead of text)

Additional context
I might be able to craft and submit the change but I'm not a strong rust developper.

Starship implementation relies on os_info crate, would it be OK to add it as a dependency ?

By the way, Starship might be a good source of idea for possible widgets to add.

Inherit colors from the Zellij theme

Instead of configuring specific colors, users could pick from a pre-defined list of colors. zellij-tile has Palette which inherits colors from the Zellij theme.

Not a necessity but would be really nice!

Pipe doesn't work in command

Describe the bug
I'm trying pipe commands to get the last dir name at the top.

To Reproduce
Use the submitted layout / command.

Expected behavior
The {command_pwd} command writes the last directory name.

Screenshots
image

Desktop (please complete the following information):

  • OS: popos
  • Zellij version v0.39.0
  • Version v0.9.0

Layout

How does the layout look like? Please copy it into a code block.

layout {
    
    pane size=1 borderless=true {
        plugin location="file:zjstatus.wasm" {
            // format_left  "{mode}#[fg=black,bg=blue,bold]{session}  #[fg=blue,bg=#181825]๎‚ธ{tabs}"
            format_left  "#[fg=#6b7282,bg=#fb5262,bold]{mode}#[fg=#6b7282,bg=#4b5262,bold] wooo #[fg=#4b5262,bg=#3b4252]๎‚ธ{tabs}"
            format_right "#[bg=#3b4252]hello {command_pwd} {command_git_branch} #[fg=#3b4252,bg=#6b7292]๎‚ธ{datetime}"
            format_space "#[bg=#3b4252]"

            
            command_git_branch_command   "git rev-parse --abbrev-ref HEAD"
            command_git_branch_format    "#[fg=blue] {stdout} "
            command_git_branch_interval  "10"

            command_pwd_command   "pwd | rev | cut -f1 -d'/' - | rev"
            command_pwd_format    "#[fg=blue] {exit_code} {stdout} {stderr} "
            command_pwd_interval  "2"

            hide_frame_for_single_pane "true"

            mode_normal  "#[bg=#6b7282] "

            tab_normal              "#[fg=#3b4252,bg=#8A9CBD]๎‚ธ #[fg=#1b2232,bg=#8A9CBD]{index} ๎‚น {name} #[fg=#8A9CBD,bg=#3b4252]๎‚ธ"
            tab_normal_fullscreen   "#[fg=#6C7086,bg=#181825] {index} {name} [] "
            tab_normal_sync         "#[fg=#6C7086,bg=#181825] {index} {name} <> "
            tab_active              "#[fg=#3b4252,bg=#d8dee9,bold]๎‚ธ {index} ๎‚น {name} #[fg=#d8dee9,bg=#3b4252]๎‚ธ"
            tab_active_fullscreen   "#[fg=#9399B2,bg=#181825,bold] {index} {name} [] "
            tab_active_sync         "#[fg=#9399B2,bg=#181825,bold] {index} {name} <> "


            datetime          "#[fg=#3b4252,bg=#6b7292,bold] {format} "
            datetime_format   "%A, %d %b %Y %H:%M:%S"
            datetime_timezone "Europe/Berlin"
        }
    }

    pane split_direction="vertical" {
        pane
    }

    pane size=2 borderless=true {
      plugin location="zellij:status-bar"
    }
}

Additional context
Thanks for such a great plugin! It's really getting better and better all the time.

Plugin never asks for permission and permission is always denied.

    1  ERROR  |zellij_server::plugins::w| 2023-09-22 10:01:01.650 [async-std/runti] [
       /Users/ali/.cargo/registry/src/index.crates.io-6f17d22bba15001f/zellij-server-
       0.38.2/src/plugins/wasm_bridge.rs:850]: PluginId '0' permission '             
       ReadApplicationState' is not allowed - Event 'SessionUpdate' denied  

I have tested to set first-start to true but it does not ask for permission even then.

MacOS 13.4.1
KItty 0.30.0
Zellij: 0.38.2

battery status

is this possible

on my laptop it would be nice to have battery status

Plugin does not appear on session start. Only appears after `serialization-interval` time.

Describe the bug
After updating to Zellij 0.39.1, the status line is not initially displayed after a session is started. After some time, the statusbar displays as normal.

To Reproduce
Steps to reproduce the behavior:

  1. Update to Zellij 0.39.1
  2. Start a zellij session using this plugin

It appears that the amount of time it takes for the status bar to appear is the same as Zellij's session serialization frequency. Starting a session with just zellij, it will take 60 seconds for the status line to appear. 60 seconds is the new default session serialization frequency in 0.39.1. It was previously 1 second. Running zellij with zellij --serialization-interval 5, the statusline will appear after 5 seconds. With zellij --serialization-interval 20, it will appear after 20 seconds.

Expected behavior
Plugin should load immediately as it did on Zellij 0.39.0.

Screenshots
If applicable, add screenshots to help explain your problem.

Desktop (please complete the following information):

  • OS: 6.5.6-arch2-1
  • Zellij version: v0.39.1
  • Version: v0.9.0

Layout

How does the layout look like? Please copy it into a code block.

layout {
    pane split_direction="vertical" {
        pane
    }

    pane size=1 borderless=true {
        plugin location="file:/home/mike/.config/zellij/plugins/zjstatus.wasm" {
            format_left  "{mode}#[fg=#1a1c23,bg=#4fa6ed,bold]๎‚ผ{session}#[fg=#4fa6ed,bg=#1a1c23]๎‚ผ{tabs}"
            format_right "#[fg=#1a1c23,bg=#4fa6ed,bold]๎‚ผ{datetime}"
            format_space "#[bg=#1a1c23]"

            border_enabled  "false"

            hide_frame_for_single_pane "true"

            tab_normal              "#[fg=#000000,bg=#4C4C59]๎‚ผ {index} ๎‚ป {name} #[fg=#4C4C59,bg=#1a1c23]๎‚ผ"
            tab_normal_fullscreen   "#[fg=#000000,bg=#4C4C59]๎‚ผ {index} ๎‚ป {name} Z #[fg=#4C4C59,bg=#1a1c23]๎‚ผ"
            tab_normal_sync         "#[fg=#000000,bg=#4C4C59]๎‚ผ {index} ๎‚ป {name} S #[fg=#4C4C59,bg=#1a1c23]๎‚ผ"
            tab_active              "#[fg=#1a1c23,bg=#ffffff,bold]๎‚ผ {index} ๎‚ป {name} #[fg=#ffffff,bg=#1a1c23]๎‚ผ"
            tab_active_fullscreen   "#[fg=#1a1c23,bg=#ffffff,bold]๎‚ผ {index} ๎‚ป {name} Z #[fg=#ffffff,bg=#1a1c23]๎‚ผ"
            tab_active_sync         "#[fg=#1a1c23,bg=#ffffff,bold]๎‚ผ {index} ๎‚ป {name} S #[fg=#ffffff,bg=#1a1c23]๎‚ผ"

            datetime        "#[fg=#1a1c23,bg=#4fa6ed,bold] {format} "
            datetime_format "%A, %Y%m%d %H%M"
            datetime_timezone "America/Los_Angeles"

            mode_normal        "#[fg=#1a1c23,bg=#4fa6ed,bold]  NORMAL ๎‚บ"
            mode_locked        "#[fg=#1a1c23,bg=#e55561,bold]  LOCKED ๎‚บ"
            mode_resize        "#[fg=#1a1c23,bg=#e2b86b,bold]  RESIZE ๎‚บ"
            mode_pane          "#[fg=#1a1c23,bg=#e2b86b,bold]   PANE  ๎‚บ"
            mode_tab           "#[fg=#1a1c23,bg=#e2b86b,bold]   TAB   ๎‚บ"
            mode_scroll        "#[fg=#1a1c23,bg=#e2b86b,bold]  SCROLL ๎‚บ"
            mode_enter_search  "#[fg=#1a1c23,bg=#e2b86b,bold] ENTER SEARCH ๎‚บ"
            mode_search        "#[fg=#1a1c23,bg=#e2b86b,bold]  SEARCH ๎‚บ"
            mode_rename_tab    "#[fg=#1a1c23,bg=#e2b86b,bold] RENAME TAB ๎‚บ"
            mode_rename_pane   "#[fg=#1a1c23,bg=#e2b86b,bold] RENAME PANE ๎‚บ"
            mode_session       "#[fg=#1a1c23,bg=#e2b86b,bold] SESSION ๎‚บ"
            mode_move          "#[fg=#1a1c23,bg=#e2b86b,bold]   MOVE  ๎‚บ"
            mode_prompt        "#[fg=#1a1c23,bg=#e2b86b,bold]  PROMPT ๎‚บ"
            mode_tmux          "#[fg=#1a1c23,bg=#8ebd6b,bold]   TMUX  ๎‚บ"
        }
    }
}

Slant example and formatting

Not sure why it doesn't work when I try to run a multi format on a single line to change the color of ๎‚ธ. In your slanted example you have a couple examples where sending tab_active "#[fg=#181825,bg=#ffffff,bold,italic]๎‚ธ {index} ๎‚น {name} #[fg=#ffffff,bg=#181825]๎‚ธ" changes the ๎‚ธ to make the slant illusion work. However when I try to do the same thing with command_1_format "#[fg=#181825,bg=blue,bold]๎‚ธ{stdout} #[fg=blue,bold,bg=#181825]๎‚ธ" it just prints out the second one in text format instead of changing the colors again like you did on the previous ones. What could I be doing wrong?

colors: allow ansi terminal color names

Hi,

With my nixos and home-manager configuration, I have a hostColor set. This is then used for my nushell prompt. It gives me a quick at-a-glance indication of what machine I'm on or connected to.

Right now, this is specified as a ansi terminal color name like "cyan", "blue", etc. see: https://www.nushell.sh/commands/docs/ansi.html

The nice benefit of this is that it matches the specified terminal scheme, rather than being "fixed" to a hex value.

Does it make sense to support that here? I'm not sure if zjstatus is handling the format specifiers, or if that comes from zellij through the plugin API.

New pane mostly open under original pane

If you start zellij with zellij or zellij --layout compact and make new pane with ctrl+p n, new pane will show on right side. But if I use zjstatus ``zellij --layout zjstatus` then for 60-65% times it show under original pane. But then randomly sometimes if I start terminal and zellij with zjstatus second pane will show up on right side.

https://asciinema.org/a/7JxHT2AJKewmXEpDeZyJkXIXJ

my ~/.config/zellij/layouts/zjstatus.kdl

layout {
    pane split_direction="vertical" {
        pane
    }

    pane size=1 borderless=true {
        plugin location="file:~/.config/zellij/plugins/zjstatus.wasm" {
            format_left  "{mode}{tabs}"
            format_right "#[fg=#b8bb26,bold]{session}"
            format_space ""

            first_start                "false"
            hide_frame_for_single_pane "false"

            mode_normal        "#[fg=#b8bb26,bold]{name}"
            mode_locked        "#[fg=#fb4934,bold]{name}"
            mode_resize        "#[fg=#fabd2f,bold]{name}"
            mode_pane          "#[fg=#d3869b,bold]{name}"
            mode_tab           "#[fg=#83a598,bold]{name}"
            mode_scroll        "#[fg=#8ec07c,bold]{name}"
            mode_session       "#[fg=#fe8019,bold]{name}"
            mode_move          "#[fg=#a89984,bold]{name}"

            tab_normal   "#[fg=#a89984,bold] {name}"
            tab_active   "#[fg=#83a598,bold] {name}"
        }
    }
}

my ~/.config/zellij/config.kdl

// If you'd like to override the default keybindings completely, be sure to change "keybinds" to "keybinds clear-defaults=true"
keybinds {
    normal {
        // uncomment this and adjust key if using copy_on_select=false
        // bind "Alt c" { Copy; }
    }
    locked {
        bind "Ctrl g" { SwitchToMode "Normal"; }
    }
    resize {
        bind "Ctrl n" { SwitchToMode "Normal"; }
        bind "h" "Left" { Resize "Increase Left"; }
        bind "j" "Down" { Resize "Increase Down"; }
        bind "k" "Up" { Resize "Increase Up"; }
        bind "l" "Right" { Resize "Increase Right"; }
        bind "H" { Resize "Decrease Left"; }
        bind "J" { Resize "Decrease Down"; }
        bind "K" { Resize "Decrease Up"; }
        bind "L" { Resize "Decrease Right"; }
        bind "=" "+" { Resize "Increase"; }
        bind "-" { Resize "Decrease"; }
    }
    pane {
        bind "Ctrl p" { SwitchToMode "Normal"; }
        bind "h" "Left" { MoveFocus "Left"; }
        bind "l" "Right" { MoveFocus "Right"; }
        bind "j" "Down" { MoveFocus "Down"; }
        bind "k" "Up" { MoveFocus "Up"; }
        bind "p" { SwitchFocus; }
        bind "n" { NewPane; SwitchToMode "Normal"; }
        bind "d" { NewPane "Down"; SwitchToMode "Normal"; }
        bind "r" { NewPane "Right"; SwitchToMode "Normal"; }
        bind "x" { CloseFocus; SwitchToMode "Normal"; }
        bind "f" { ToggleFocusFullscreen; SwitchToMode "Normal"; }
        bind "z" { TogglePaneFrames; SwitchToMode "Normal"; }
        bind "w" { ToggleFloatingPanes; SwitchToMode "Normal"; }
        bind "e" { TogglePaneEmbedOrFloating; SwitchToMode "Normal"; }
        bind "c" { SwitchToMode "RenamePane"; PaneNameInput 0;}
    }
    move {
        bind "Ctrl h" { SwitchToMode "Normal"; }
        bind "n" "Tab" { MovePane; }
        bind "p" { MovePaneBackwards; }
        bind "h" "Left" { MovePane "Left"; }
        bind "j" "Down" { MovePane "Down"; }
        bind "k" "Up" { MovePane "Up"; }
        bind "l" "Right" { MovePane "Right"; }
    }
    tab {
        bind "Ctrl t" { SwitchToMode "Normal"; }
        bind "r" { SwitchToMode "RenameTab"; TabNameInput 0; }
        bind "h" "Left" "Up" "k" { GoToPreviousTab; }
        bind "l" "Right" "Down" "j" { GoToNextTab; }
        bind "n" { NewTab; SwitchToMode "Normal"; }
        bind "x" { CloseTab; SwitchToMode "Normal"; }
        bind "s" { ToggleActiveSyncTab; SwitchToMode "Normal"; }
        bind "b" { BreakPane; SwitchToMode "Normal"; }
        bind "]" { BreakPaneRight; SwitchToMode "Normal"; }
        bind "[" { BreakPaneLeft; SwitchToMode "Normal"; }
        bind "1" { GoToTab 1; SwitchToMode "Normal"; }
        bind "2" { GoToTab 2; SwitchToMode "Normal"; }
        bind "3" { GoToTab 3; SwitchToMode "Normal"; }
        bind "4" { GoToTab 4; SwitchToMode "Normal"; }
        bind "5" { GoToTab 5; SwitchToMode "Normal"; }
        bind "6" { GoToTab 6; SwitchToMode "Normal"; }
        bind "7" { GoToTab 7; SwitchToMode "Normal"; }
        bind "8" { GoToTab 8; SwitchToMode "Normal"; }
        bind "9" { GoToTab 9; SwitchToMode "Normal"; }
        bind "Tab" { ToggleTab; }
    }
    scroll {
        bind "Ctrl s" { SwitchToMode "Normal"; }
        bind "e" { EditScrollback; SwitchToMode "Normal"; }
        bind "s" { SwitchToMode "EnterSearch"; SearchInput 0; }
        bind "Ctrl c" { ScrollToBottom; SwitchToMode "Normal"; }
        bind "j" "Down" { ScrollDown; }
        bind "k" "Up" { ScrollUp; }
        bind "Ctrl f" "PageDown" "Right" "l" { PageScrollDown; }
        bind "Ctrl b" "PageUp" "Left" "h" { PageScrollUp; }
        bind "d" { HalfPageScrollDown; }
        bind "u" { HalfPageScrollUp; }
        // uncomment this and adjust key if using copy_on_select=false
        // bind "Alt c" { Copy; }
    }
    search {
        bind "Ctrl s" { SwitchToMode "Normal"; }
        bind "Ctrl c" { ScrollToBottom; SwitchToMode "Normal"; }
        bind "j" "Down" { ScrollDown; }
        bind "k" "Up" { ScrollUp; }
        bind "Ctrl f" "PageDown" "Right" "l" { PageScrollDown; }
        bind "Ctrl b" "PageUp" "Left" "h" { PageScrollUp; }
        bind "d" { HalfPageScrollDown; }
        bind "u" { HalfPageScrollUp; }
        bind "n" { Search "down"; }
        bind "p" { Search "up"; }
        bind "c" { SearchToggleOption "CaseSensitivity"; }
        bind "w" { SearchToggleOption "Wrap"; }
        bind "o" { SearchToggleOption "WholeWord"; }
    }
    entersearch {
        bind "Ctrl c" "Esc" { SwitchToMode "Scroll"; }
        bind "Enter" { SwitchToMode "Search"; }
    }
    renametab {
        bind "Ctrl c" { SwitchToMode "Normal"; }
        bind "Esc" { UndoRenameTab; SwitchToMode "Tab"; }
    }
    renamepane {
        bind "Ctrl c" { SwitchToMode "Normal"; }
        bind "Esc" { UndoRenamePane; SwitchToMode "Pane"; }
    }
    session {
        bind "Ctrl o" { SwitchToMode "Normal"; }
        bind "Ctrl s" { SwitchToMode "Scroll"; }
        bind "d" { Detach; }
        bind "w" {
            LaunchOrFocusPlugin "zellij:session-manager" {
                floating true
                move_to_focused_tab true
            };
            SwitchToMode "Normal"
        }
    }
    tmux {
        bind "[" { SwitchToMode "Scroll"; }
        bind "Ctrl b" { Write 2; SwitchToMode "Normal"; }
        bind "\"" { NewPane "Down"; SwitchToMode "Normal"; }
        bind "%" { NewPane "Right"; SwitchToMode "Normal"; }
        bind "z" { ToggleFocusFullscreen; SwitchToMode "Normal"; }
        bind "c" { NewTab; SwitchToMode "Normal"; }
        bind "," { SwitchToMode "RenameTab"; }
        bind "p" { GoToPreviousTab; SwitchToMode "Normal"; }
        bind "n" { GoToNextTab; SwitchToMode "Normal"; }
        bind "Left" { MoveFocus "Left"; SwitchToMode "Normal"; }
        bind "Right" { MoveFocus "Right"; SwitchToMode "Normal"; }
        bind "Down" { MoveFocus "Down"; SwitchToMode "Normal"; }
        bind "Up" { MoveFocus "Up"; SwitchToMode "Normal"; }
        bind "h" { MoveFocus "Left"; SwitchToMode "Normal"; }
        bind "l" { MoveFocus "Right"; SwitchToMode "Normal"; }
        bind "j" { MoveFocus "Down"; SwitchToMode "Normal"; }
        bind "k" { MoveFocus "Up"; SwitchToMode "Normal"; }
        bind "o" { FocusNextPane; }
        bind "d" { Detach; }
        bind "Space" { NextSwapLayout; }
        bind "x" { CloseFocus; SwitchToMode "Normal"; }
    }
    shared_except "locked" {
        bind "Ctrl g" { SwitchToMode "Locked"; }
        bind "Ctrl q" { Quit; }
        bind "Alt n" { NewPane; }
        bind "Alt h" "Alt Left" { MoveFocusOrTab "Left"; }
        bind "Alt l" "Alt Right" { MoveFocusOrTab "Right"; }
        bind "Alt j" "Alt Down" { MoveFocus "Down"; }
        bind "Alt k" "Alt Up" { MoveFocus "Up"; }
        bind "Alt =" "Alt +" { Resize "Increase"; }
        bind "Alt -" { Resize "Decrease"; }
        bind "Alt [" { PreviousSwapLayout; }
        bind "Alt ]" { NextSwapLayout; }
    }
    shared_except "normal" "locked" {
        bind "Enter" "Esc" { SwitchToMode "Normal"; }
    }
    shared_except "pane" "locked" {
        bind "Ctrl p" { SwitchToMode "Pane"; }
    }
    shared_except "resize" "locked" {
        bind "Ctrl n" { SwitchToMode "Resize"; }
    }
    shared_except "scroll" "locked" {
        bind "Ctrl s" { SwitchToMode "Scroll"; }
    }
    shared_except "session" "locked" {
        bind "Ctrl o" { SwitchToMode "Session"; }
    }
    shared_except "tab" "locked" {
        bind "Ctrl t" { SwitchToMode "Tab"; }
    }
    shared_except "move" "locked" {
        bind "Ctrl h" { SwitchToMode "Move"; }
    }
    shared_except "tmux" "locked" {
        bind "Ctrl b" { SwitchToMode "Tmux"; }
    }
}

plugins {
    tab-bar { path "tab-bar"; }
    status-bar { path "status-bar"; }
    strider { path "strider"; }
    compact-bar { path "compact-bar"; }
    session-manager { path "session-manager"; }
}

// Choose what to do when zellij receives SIGTERM, SIGINT, SIGQUIT or SIGHUP
// eg. when terminal window with an active zellij session is closed
// Options:
//   - detach (Default)
//   - quit
//
// on_force_close "quit"

//  Send a request for a simplified ui (without arrow fonts) to plugins
//  Options:
//    - true
//    - false (Default)
//
// simplified_ui true

// Choose the path to the default shell that zellij will use for opening new panes
// Default: $SHELL
//
// default_shell "fish"

// Choose the path to override cwd that zellij will use for opening new panes
//
// default_cwd ""

// Toggle between having pane frames around the panes
// Options:
//   - true (default)
//   - false
//
pane_frames false

// Toggle between having Zellij lay out panes according to a predefined set of layouts whenever possible
// Options:
//   - true (default)
//   - false
//
// auto_layout true

// Define color themes for Zellij
// For more examples, see: https://github.com/zellij-org/zellij/tree/main/example/themes
// Once these themes are defined, one of them should to be selected in the "theme" section of this file
//
// themes {
//     dracula {
//         fg 248 248 242
//         bg 40 42 54
//         red 255 85 85
//         green 80 250 123
//         yellow 241 250 140
//         blue 98 114 164
//         magenta 255 121 198
//         orange 255 184 108
//         cyan 139 233 253
//         black 0 0 0
//         white 255 255 255
//     }
// }

// Choose the theme that is specified in the themes section.
// Default: default
//
theme "gruvbox-dark"

// The name of the default layout to load on startup
// Default: "default"
//
// default_layout "compact"

// Choose the mode that zellij uses when starting up.
// Default: normal
//
// default_mode "locked"

// Toggle enabling the mouse mode.
// On certain configurations, or terminals this could
// potentially interfere with copying text.
// Options:
//   - true (default)
//   - false
//
mouse_mode false

// Configure the scroll back buffer size
// This is the number of lines zellij stores for each pane in the scroll back
// buffer. Excess number of lines are discarded in a FIFO fashion.
// Valid values: positive integers
// Default value: 10000
//
scroll_buffer_size 1000000

// Provide a command to execute when copying text. The text will be piped to
// the stdin of the program to perform the copy. This can be used with
// terminal emulators which do not support the OSC 52 ANSI control sequence
// that will be used by default if this option is not set.
// Examples:
//
// copy_command "xclip -selection clipboard" // x11
// copy_command "wl-copy"                    // wayland
// copy_command "pbcopy"                     // osx

// Choose the destination for copied text
// Allows using the primary selection buffer (on x11/wayland) instead of the system clipboard.
// Does not apply when using copy_command.
// Options:
//   - system (default)
//   - primary
//
// copy_clipboard "primary"

// Enable or disable automatic copy (and clear) of selection when releasing mouse
// Default: true
//
// copy_on_select false

// Path to the default editor to use to edit pane scrollbuffer
// Default: $EDITOR or $VISUAL
//
// scrollback_editor "/usr/bin/vim"

// When attaching to an existing session with other users,
// should the session be mirrored (true)
// or should each user have their own cursor (false)
// Default: false
//
// mirror_session true

// The folder in which Zellij will look for layouts
//
// layout_dir "/path/to/my/layout_dir"

// The folder in which Zellij will look for themes
//
// theme_dir "/path/to/my/theme_dir"

// ui {
//     pane_frames {
//         hide_session_name true
//     }
// }

Have I set something wrong?

Status bar goes out of bounds when displaying CJK characters or emojis

Describe the bug
The status bar seems to render incorrectly when it displays emojis or Japanese,Chinese and Korean characters.

This only seems to happen with these languages as I tried Arabic,Hindi,Vietnamese and other languages that use the Cyrillic script and they all display correctly.

I thought this might be an issue with my terminal, so i tried Kitty,Alacritty & Foot but the issue persisted.

Expected behavior
Here's what it's supposed to look like:
1
Here's what it looks like with Russian:
5
As i said before, these languages display correctly.

Now, The issue is when it displays any CJK character.

Here's what it looks like with Japanese:
2
Here's what it looks like with Korean:
3
Here's what it looks like with an emoji:
4

I think this might be an issue with how UTF-8 encodes characters.
Here's a screenshot of the UTF-8 Wikipedia Page
I Highlighted the important part
231218_03h38m33s_screenshot

This mostly lines up with the problem, except for one thing. When I tried displaying these mathematical symbols:
โˆš โ‰œ EโŠ–

they display correctly:
6

So now I am not so sure.

At first i thought it just wasn't rendering these characters for some reason but quickly discovered that it was rendering them, it was just out of bounds.

If i resize the window to a small enough size, you can see the characters:
7

Hence the "out of bounds"

Desktop (please complete the following information):

  • OS: Linux EndeavourOS
  • Zellij version: zellij 0.39.2
  • Version: v0.11.2

Layout

How does the layout look like? Please copy it into a code block.

layout {
    pane size=1 borderless=true {
        plugin location="file:/home/aether/.config/zellij/Plugins/zjstatus.wasm" {
            format_left  "#[bg=transparent,fg=yellow]๎‚ถ#[bg=yellow]{mode}#[bg=yellow,fg=black,bold]๎ฉฑ {session} ๏’‰ #[bg=transparent,fg=yellow]๎‚ฐ   {tabs}  #[bg=transparent,fg=magenta]๎‚ถ{command_ncmpcpp}#[bg=transparent,fg=magenta]๎‚ด"
            format_right "#[bg=transparent,fg=black]๎‚ฒ{command_git_branch} #[bg=black,fg=blue]๎‚ฒ{command_tomato}#[bg=blue,fg=green]๎‚ฒ{command_date_day}{command_date}#[bg=green,fg=magenta]๎‚ฒ#[bg=magenta,fg=black,bold]{datetime}#[bg=transparent,fg=magenta]๎‚ด"
            format_space ""

            border_enabled  "true"
            border_char     "โ”€"
            border_format   "#[fg=yellow]{char}"
            border_position "top"

            hide_frame_for_single_pane "true"

            mode_normal  "#[bg=yellow] "
            mode_tmux    "#[bg=#ffc387] "

            tab_normal   "#[bg=transparent,fg=black]๎‚ถ#[bg=black] #[bg=black,fg=white]{name}#[bg=black] #[bg=transparent,fg=black]๎‚ด"
            tab_active   "#[bg=transparent,fg=blue]๎‚ถ#[bg=blue,fg=black] #[bg=blue,fg=black,bold,italic]{name}#[bg=blue] #[bg=transparent,fg=blue]๎‚ด"

            command_git_branch_command     "git rev-parse --abbrev-ref HEAD"
            command_git_branch_format      "#[fg=green,bg=black] ๏˜ {stdout}"
            command_git_branch_interval    "10"
            command_git_branch_rendermode  "static"

            command_tomato_command "tomato -t"
            command_tomato_format   "#[fg=black,bg=blue,bold] {stdout}"
            command_tomato_interval "0"
            command_tomato_rendermode "static"

            command_ncmpcpp_command "playerctl metadata title"
            command_ncmpcpp_format   "#[fg=black,bg=magenta,bold]๓ฐš {stdout}"
            command_ncmpcpp_interval "1"
            command_ncmpcpp_rendermode "static"

            command_date_command  "date +%d-%m-%Y"
            command_date_format   "#[fg=black,bg=green,bold] {stdout}"
            command_date_interval "43200"
            command_date_rendermode "static"

            command_date_day_command  "date +%a"
            command_date_day_format   "#[fg=black,bg=green,bold] {stdout}"
            command_date_day_interval "43200"
            command_date_day_rendermode "static"

            datetime        "{format}"
            datetime_format " ๏บ %I:%M ๎ฉฑ "
            datetime_timezone "America/Mexico_City"
        }
    }
    pane
}

I was trying to make zjstatus display the currently playing song and i realized it would just break if i was listening to touhou music. I quickly realized it was because of the Japanese characters in the song name.

I often listen to a lot of Japanese music and that's kind of how i found about this.

Mode at startup is not correct

Describe the bug
The current mode at startup is not correct.

To Reproduce
Steps to reproduce the behavior:

  1. Set default_mode "locked" in your configuration
  2. Run zellij with your configuration
  3. Check the mode in the statusbar

Expected behavior
The mode in the status bar must be LCK

Screenshots
CleanShot 2024-05-06 at 17 57 28

Desktop (please complete the following information):

  • OS: Mac Sonoma 14.4.1
  • Zellij version v0.40.0
  • Version v0.14.0

Layout

How does the layout look like? Please copy it into a code block.

layout {
    tab name="editor" focus=true hide_floating_panes=true {
        pane name="editor" borderless=true {
            command "hx"
        }
    }

    default_tab_template {
        children
        floating_panes {
            pane { 
                // plugin location="zjpane"
            }
        }
        pane size=1 borderless=true {
            plugin location="zjstatus"
        }
        pane size=1 borderless=true {
            plugin location="status-bar"
        }
    }
}
// config.kdl
plugins {
	zjstatus location="file:~/.config/zellij/plugins/zjstatus.wasm" {
        format_left  "{mode}{tabs}"
        format_right "#[fg=#b8bb26,bold]{swap_layout} #[fg=#83a598,bold]{command_git_branch}"

        hide_frame_for_single_pane "true"

        mode_normal  "#[fg=#292C33,bg=blue,bold] NOR "
        mode_locked  "#[fg=#292C33,bg=green,bold] LCK "
        mode_resize  "#[fg=#292C33,bg=red,bold] RSZ "
        mode_pane    "#[fg=#292C33,bg=magenta,bold] PNE "
        mode_tab     "#[fg=#292C33,bg=magenta,bold] TAB "
        mode_scroll  "#[fg=#292C33,bg=yellow,bold] SCR "
        mode_session "#[fg=#292C33,bg=yellow,bold] SSN "
        mode_move    "#[fg=#292C33,bg=red,bold] MOV "
        mode_tmux    "#[fg=#292C33,bg=green,bold] TMX "

        tab_normal "#[fg=blue] {name}"
        tab_active "#[fg=blue,bold] {name}*"

        command_git_branch_command    "git rev-parse --abbrev-ref HEAD"
        command_git_branch_format     "#[fg=blue] {stdout} "
        command_git_branch_interval   "10"
        command_git_branch_rendermode "static"

        datetime          " {format} "
        datetime_format   "%H:%M %d-%b-%y"
        datetime_timezone "Europe/Berlin"
    }
}

default_mode "locked"

Additional context
Add any other context about the problem here.

Second format string in {mode} handler not recognized

Describe the bug
If a second format string is used when defining a {mode} handler, it is rendered as text

To Reproduce
Steps to reproduce the behavior:
Define mode_* fields as such:

mode_normal        "#[fg=#1a1c23,bg=#4fa6ed,bold] NORMAL  #[fg=#4fa6ed,bg=#4fa6ed]๎‚ธ"
mode_locked        "#[fg=#1a1c23,bg=#8ebd6b,bold] LOCKED  #[fg=#8ebd6b,bg=#4fa6ed]๎‚ธ"
...

(The missing character there is the slant character from the "slanted style" example)

A new zellij session renders the mode widget with the second format string as text.

Expected behavior
The second format string should be rendered.

Screenshots
image

Desktop (please complete the following information):

  • OS: 6.5.6-arch2-1
  • Zellij version: 0.39.0
  • Version: 0.9.0

Layout

How does the layout look like? Please copy it into a code block.

layout {
    pane split_direction="vertical" {
        pane
    }

    pane size=1 borderless=true {
        plugin location="file:/home/mike/.config/zellij/plugins/zjstatus.wasm" {
            format_left  "{mode}#[fg=#1a1c23,bg=#4fa6ed,bold]{session}  #[fg=#4fa6ed,bg=#1a1c23]๎‚ธ{tabs}"
            format_right "#[fg=#1a1c23,bg=#4fa6ed,bold]๎‚ธ{datetime}"
            format_space "#[bg=#1a1c23]"

            border_enabled  "false"

            hide_frame_for_single_pane "true"

            tab_normal              "#[fg=#1a1c23,bg=#4C4C59]๎‚ธ #[fg=#000000,bg=#4C4C59]{index} ๎‚น {name} #[fg=#4C4C59,bg=#1a1c23]๎‚ธ"
            tab_normal_fullscreen   "#[fg=#1a1c23,bg=#4C4C59]๎‚ธ #[fg=#000000,bg=#4C4C59]{index} ๎‚น {name} Z #[fg=#4C4C59,bg=#1a1c23]๎‚ธ"
            tab_normal_fullscreen   "#[fg=#1a1c23,bg=#4C4C59]๎‚ธ #[fg=#000000,bg=#4C4C59]{index} ๎‚น {name} S #[fg=#4C4C59,bg=#1a1c23]๎‚ธ"
            tab_active              "#[fg=#1a1c23,bg=#ffffff,bold]๎‚ธ {index} ๎‚น {name} #[fg=#ffffff,bg=#1a1c23]๎‚ธ"
            tab_active_fullscreen   "#[fg=#1a1c23,bg=#ffffff,bold]๎‚ธ {index} ๎‚น {name} Z #[fg=#ffffff,bg=#1a1c23]๎‚ธ"
            tab_active_fullscreen   "#[fg=#1a1c23,bg=#ffffff,bold]๎‚ธ {index} ๎‚น {name} S #[fg=#ffffff,bg=#1a1c23]๎‚ธ"

            datetime        "#[fg=#1a1c23,bg=#4fa6ed,bold] {format} "
            datetime_format "%A, %d %b %Y %H:%M"
            datetime_timezone "America/Los_Angeles"

            mode_normal        "#[fg=#1a1c23,bg=#4fa6ed,bold] NORMAL  #[fg=#4fa6ed,bg=#4fa6ed]๎‚ธ"
            mode_locked        "#[fg=#1a1c23,bg=#8ebd6b,bold] LOCKED  #[fg=#8ebd6b,bg=#4fa6ed]๎‚ธ"
            mode_resize        "#[fg=#1a1c23,bg=#8ebd6b,bold] RESIZE  #[fg=#8ebd6b,bg=#4fa6ed]๎‚ธ"
            mode_pane          "#[fg=#1a1c23,bg=#8ebd6b,bold] PANE    #[fg=#8ebd6b,bg=#4fa6ed]๎‚ธ"
            mode_tab           "#[fg=#1a1c23,bg=#8ebd6b,bold] TAB     #[fg=#8ebd6b,bg=#4fa6ed]๎‚ธ"
            mode_scroll        "#[fg=#1a1c23,bg=#8ebd6b,bold] SCROLL  #[fg=#8ebd6b,bg=#4fa6ed]๎‚ธ"
            mode_enter_search  "#[fg=#1a1c23,bg=#8ebd6b,bold] ENTER SEARCH #[fg=#8ebd6b,bg=#4fa6ed]๎‚ธ"
            mode_search        "#[fg=#1a1c23,bg=#8ebd6b,bold] SEARCH  #[fg=#8ebd6b,bg=#4fa6ed]๎‚ธ"
            mode_rename_tab    "#[fg=#1a1c23,bg=#8ebd6b,bold] RENAME TAB #[fg=#8ebd6b,bg=#4fa6ed]๎‚ธ"
            mode_rename_pane   "#[fg=#1a1c23,bg=#8ebd6b,bold] RENAME PANE #[fg=#8ebd6b,bg=#4fa6ed]๎‚ธ"
            mode_session       "#[fg=#1a1c23,bg=#8ebd6b,bold] SESSION #[fg=#8ebd6b,bg=#4fa6ed]๎‚ธ"
            mode_move          "#[fg=#1a1c23,bg=#8ebd6b,bold] MOVE    #[fg=#8ebd6b,bg=#4fa6ed]๎‚ธ"
            mode_prompt        "#[fg=#1a1c23,bg=#8ebd6b,bold] PROMPT  #[fg=#8ebd6b,bg=#4fa6ed]๎‚ธ"
            mode_tmux          "#[fg=#1a1c23,bg=#8ebd6b,bold] TMUX    #[fg=#8ebd6b,bg=#4fa6ed]๎‚ธ"
        }
    }
}

First format specifier in {tabs} handler not applied

Describe the bug
When multiple format specifiers are added to a {tabs} handler, the first format is not applied.

To Reproduce
Steps to reproduce the behavior:

  1. Add formatting for tab handlers in plugin configuration.
tab_normal  " [fg=#FFFFFF,bg=#181825] {name} "
tab_active  " [fg=#181825,bg=#FFFFFF] {name} "
  1. Launch Zellij

Expected behavior
Both formatting should be applied; however foreground color is not applied.

Desktop (please complete the following information):

  • OS: NixOS
  • Zellij version: 0.39.2
  • Version: 0.13

Layout

layout {
    default_tab_template {
        pane size=1 borderless=true {
            plugin location="file:plugins/zjstatus.wasm" {
                hide_frame_for_single_pane "true"

                format_left  "#[fg=#181825,bg=#A1BDCE,bold] {session} "
                format_center "{tabs}"
                format_space "#[bg=#181825]"

                tab_normal  " [fg=#FFFFFF,bg=#181825] {name} "
                tab_active  " [fg=#181825,bg=#FFFFFF] {name} "
            }
        }
        children
    }
    tab name="dev" focus=true {
        pane name="dev"
    }
    tab name="test" {
        pane name="test"
    }
}

Additional context
Currently adding an additional format specifier at the start of the list as a workaround so the plugin can pick up on the foreground color.

tab_normal  " [bold,fg=#FFFFFF,bg=#181825] {name} "
tab_active  " [bold,fg=#181825,bg=#FFFFFF] {name} "

status bar goes out of bound if the tab passed the center of the window

Describe the bug
The status bar will goes out of bound if the tab passed the center of the window (v0.13.0). Things work fine in v0.12.0(without format_center).

To Reproduce
I reproduced the error using the slanted.kdl from the repos.

Expected behavior
The status bar shouldn't go out bound, in any circumstances.

Screenshots
output

Desktop (please complete the following information):

  • OS: ubuntu
  • Zellij version: v0.39.2

Layout

layout {
    pane split_direction="vertical" {
        pane
    }

    pane size=1 borderless=true {
        plugin location="file:target/wasm32-wasi/debug/zjstatus.wasm" {
            format_left  "{mode}#[fg=black,bg=blue,bold]{session}  #[fg=blue,bg=#181825]๎‚ธ{tabs}"
            format_right "#[fg=#181825,bg=#b1bbfa]๎‚ธ{datetime}"
            format_space "#[bg=#181825]"

            hide_frame_for_single_pane "true"

            mode_normal  "#[bg=blue] "

            tab_normal              "#[fg=#181825,bg=#4C4C59]๎‚ธ #[fg=#000000,bg=#4C4C59]{index} ๎‚น {name} #[fg=#4C4C59,bg=#181825]๎‚ธ"
            tab_normal_fullscreen   "#[fg=#6C7086,bg=#181825] {index} {name} [] "
            tab_normal_sync         "#[fg=#6C7086,bg=#181825] {index} {name} <> "
            tab_active              "#[fg=#181825,bg=#ffffff,bold,italic]๎‚ธ {index} ๎‚น {name} #[fg=#ffffff,bg=#181825]๎‚ธ"
            tab_active_fullscreen   "#[fg=#9399B2,bg=#181825,bold,italic] {index} {name} [] "
            tab_active_sync         "#[fg=#9399B2,bg=#181825,bold,italic] {index} {name} <> "


            datetime          "#[fg=#6C7086,bg=#b1bbfa,bold] {format} "
            datetime_format   "%A, %d %b %Y %H:%M"
            datetime_timezone "Europe/Berlin"
        }
    }
}

๐Ÿ’… Improve non normal mode configuration

Is your feature request related to a problem? Please describe.
For me, I do not need a visual indicator when I am in normal mode but I do want in other modes. However, to do that, I need to actually setup each mode as it defaults to mode_normal. This leads to some duplication in the config and perhaps a bit brittle if more modes appear. It is not a huge problem for me because I generate using nix but could be cleaner:

let 
  ...
  # https://zellij.dev/documentation/keybindings-modes.html
  nonNormalModes = ["locked" "resize" "pane" "move" "tab" "scroll" "search" "entersearch" "renametab" "renamepane" "session" "tmux"];
in
''
...
     pane size=1 borderless=true {
        plugin location="file:${pkgs.zjstatus}/bin/zjstatus.wasm" {
             ${lib.concatMapStringsSep "\n" (mode: ''mode_${mode} "#[bg=${green},fg=${black}] {name} "'') nonNormalModes}
        }
     }
...
''

Which lets me create the following visual:
Normal:
image

Non-Norma:
image

Describe the solution you'd like
Not sure as I do not know the code-base. More intuitive (perhaps not for others), would be to have a mode_non_normal. The behaviour would be:

  • mode_{mode} would default to mode_non_normal if set.
  • mode_{mode} would default to mode_normal if mode_non_normal is not set.

Additional context
N/A

using pane borderless=true results in zellij crash

When I use the following layout using kitty terminal, it seems like zellij is trying to add borders, but then the next render it removes it, and this locks up the zellij server and I get the error below

layout {
  pane borderless=true
  pane size=1 borderless=true {
    plugin location="file:~/.local/share/zellij/zjstatus.wasm" {
            format_left  "{mode} #[fg=#89B4FA,bold]{session} {tabs}"
            format_right "{datetime}"
            format_space ""

            border_enabled  "true"
            border_char     "โ”€"
            border_format   "#[fg=#6C7086]{char}"
            border_position "top"

            hide_frame_for_single_pane "true"

            mode_normal  "#[bg=blue] "
            mode_tmux    "#[bg=#ffc387] "

            tab_normal   "#[fg=#6C7086] {name} "
            tab_active   "#[fg=#9399B2,bold,italic] {name} "

            datetime        "#[fg=#6C7086,bold] {format} "
            datetime_format "%A, %d %b %Y %H:%M"
            datetime_timezone "Europe/Berlin"
        }
    }
}
Your zellij client lost connection to the zellij server.

As a safety measure, you have been disconnected from the current zellij session.
However, the session should still exist and none of your data should be lost.

This usually means that your terminal didn't process server messages quick
enough. Maybe your system is currently under high load, or your terminal
isn't performant enough.

There are a few things you can try now:
    - Reattach to your previous session and see if it works out better this
      time: `zellij attach lucky-piano`
    - Try using a faster (maybe GPU-accelerated) terminal emulator

Not sure if this is a zjstatus bug, or a zellij bug. I will submit to both repos.
zellij-org/zellij#2901

Datetime only supports one theme formatting hint

Describe the bug
A clear and concise description of what the bug is.
The field datetime in the config appears to only support one theming hint. So if I add a fancy special character with inverted color to match the style, the date doesn't get rendered correctly and instead the #[bg=#...,fg=#...] is rendered in the status bar.

To Reproduce
Steps to reproduce the behavior:

  1. use multiple #[] theme hints to the datetime field
  2. start zellij with zjstatus and the from 1. resulting config

Expected behavior
I would have expected that the date is formatted with my desired colors.

Screenshots
If applicable, add screenshots to help explain your problem.
image

Desktop (please complete the following information):

  • OS: Arch Linux
  • Zellij version: v0.39.2
  • version: 0.12.0

Layout

datetime "#[fg=#98971a,bg=#161616]๎‚ถ #[bg=#98971a,fg=#161616]{format} "

it renders as

๎‚ถ #[bg=#98971a,fg=#161616] Monday ...

Can't still stick the bottom of `Alacritty` when drag the `Alacritty` to scale

Can'tstill stick the bottom of Alacritty when dragging the Alacritty to scaling

To Reproduce
Steps to reproduce the behavior:

  1. dragging the Alacritty to scaling
  2. zjstatus can't still stick the bottom of Alacritty

Expected behavior
when dragging the Alacritty to scaling, zjstatus can't still stick the bottom of Alacritty

Screenshots
as the screenshot shown below:
image

Desktop (please complete the following information):

  • OS: Sonoma 14.2.1 (23C71)
  • Zellij version v0.39.2
  • Version latest version

Use specific version number instead of latest in the URL

Is your feature request related to a problem? Please describe.
When using the plugin with the URL method pointing to "latest" release https://github.com/dj95/zjstatus/wiki/1-%E2%80%90-Installation#automated-installation users need to clean the cache before an update because Zellij caches the plugin as specified here zellij-org/zellij#967 (comment)

Describe the solution you'd like
Use specific version number instead of โ€œlatestโ€, in order to update flawlessly.
Like https://github.com/dj95/zjstatus/releases/download/v0.14.1/zjstatus.wasm

Thank you!

Allow formatting using command output

Is your feature request related to a problem? Please describe.
I'd like to be able to run a command which outputs formatting commands like #[fg=#FFFFFF] and have them be evaluated properly
The current behaviour is escaping the command output completely (see example). My use case is getting vim-tpipeline working with Zellij. Another use case might be color formatting based on git status.

Describe the solution you'd like
I think by default command output should be evaluated before parsing the formatting

Additional context
Here is an example of current behaviour:

.config/zellij/layout/default.kdl
...
            format_left  "{mode} #[fg=#89B4FA,bold]{session} {tabs}"
            format_right "{command_test}" 
            format_space ""
            command_test_command   "echo blue#[fg=red]red"
            command_test_format    "#[fg=blue] {stdout} "
            command_test_interval  "10"
...

What happens at the moment
image

What I'd expect
image

feature: add a hostname widget

Hi,

It would be nice to have the hostname in the zellij status pane. I tend to open a new term emu and running zellij remotely when operating with a remote host.

I'm torn on this request, since I can just interpolate the hostname in using Nix, and I have the concept of a "hostname color" of sorts that doesn't really make sense as a widget, and I would be interpolating into the config with Nix anyway.

Curious if you have thoughts, or maybe other non-Nix users would like this?

slow rendering of CommandWidge while adding tabs

Describe the bug
While adding tabs, the render of CommandWidge is laggy.

To Reproduce
Steps to reproduce the behavior:

  1. add a CommandWidget to zjstatus kdl
            command_hostname_command  "hostname"
            command_hostname_format   "{stdout}"
            command_hostname_interval "1"
            command_hostname_rendermode "raw"
  1. start zellij
  2. new tabs

Expected behavior
CommandWidget should show no lag.

video
laggy_commandWidget.webm
laggy_commandWidget

Desktop (please complete the following information):

  • OS: ubuntu-22.04
  • Zellij version [e.g. v0.39.0]
  • zjstatus version v.0.11.1

Layout

layout {
    pane split_direction="vertical" {
        pane
    }

    pane size=1 borderless=true {
        plugin location="file:/home/benzene/.config/zellij/plugins/zjstatus.wasm" {
            //format_left  "{mode}#[fg=black,bg=blue,bold]{session}  #[fg=blue,bg=#181825]๎‚ธ{tabs}"
            format_left  "{mode}#[fg=blue,bg=#181825]๎‚ธ{tabs}"
            //format_right "#[fg=#181825,bg=#b1bbfa]๎‚ธ {command_test} {datetime}"
            format_right "{command_hostname}#[fg=#9c86bf,bg=#DCD7BA]๎‚ธ{datetime}"
            format_space "#[bg=#181825]"

            hide_frame_for_single_pane "true"

            mode_normal        "#[fg=#cccccc,bg=blue,bold] normal "
            mode_locked        "#[fg=#cccccc,bg=#red,bold] locked "
            mode_resize        "#[fg=#cccccc,bg=blue,bold] resize "
            mode_pane          "#[fg=#cccccc,bg=blue,bold] panel  "
            mode_tab           "#[fg=#cccccc,bg=blue,bold] tab    "
            mode_scroll        "#[fg=#cccccc,bg=blue,bold] scroll "
            mode_enter_search  "#[fg=#cccccc,bg=blue,bold] ent_s  "
            mode_search        "#[fg=#cccccc,bg=blue,bold] search "
            mode_rename_tab    "#[fg=#cccccc,bg=blue,bold] rena_t "
            mode_rename_pane   "#[fg=#cccccc,bg=blue,bold] rena_p "
            mode_session       "#[fg=#cccccc,bg=blue,bold] sess   "
            mode_move          "#[fg=#cccccc,bg=blue,bold] move   "
            mode_prompt        "#[fg=#cccccc,bg=blue,bold] prompt "
            mode_tmux          "#[fg=#cccccc,bg=#red,bold] tmux   "

            //tab_normal              "#[fg=#181825,bg=#4C4C59]๎‚ธ #[fg=#000000,bg=#4C4C59]{index} ๎‚น {name} #[fg=#4C4C59,bg=#181825]๎‚ธ"
            tab_normal              "#[fg=#181825,bg=#4C4C59]๎‚ธ #[fg=#000000,bg=#4C4C59]{index} {name} #[fg=#4C4C59,bg=#181825]๎‚ธ"
            //tab_normal              "#[fg=#181825,bg=#4C4C59]๎‚ธ {index} #[fg=#4C4C59,bg=#181825]๎‚ธ"
            tab_normal_fullscreen   "#[fg=#6C7086,bg=#181825] {index} {name} [] "
            tab_normal_sync         "#[fg=#6C7086,bg=#181825] {index} {name} <> "
            tab_active              "#[fg=#181825,bg=#ffffff,bold,italic]๎‚ธ{index} {name} #[fg=#ffffff,bg=#181825]๎‚ธ"
            //tab_active              "#[fg=#181825,bg=#ffffff,bold,italic]๎‚ธ {index} ๎‚น {name} #[fg=#ffffff,bg=#181825]๎‚ธ"
            tab_active_fullscreen   "#[fg=#9399B2,bg=#181825,bold,italic] {index} {name} [] "
            tab_active_sync         "#[fg=#9399B2,bg=#181825,bold,italic] {index} {name} <> "
            command_hostname_command  "hostname"
            command_hostname_format   "{stdout}"
            command_hostname_interval "1"
            command_hostname_rendermode "raw"

            datetime          "#[fg=#000000,bg=#DCD7BA,nobold]{format}"
            //datetime_format   "%A,%d/%m %H:%M"
            datetime_format   "%d/%m %H:%M"
            datetime_timezone "Asia/Taipei"
        }
    }
}

Additional context
Add any other context about the problem here.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.