Skip to content

Mode widget colors reset at widget boundary — no way to style other widgets per mode #219

Description

@Diaoul

Description

Colors set in mode_* format strings are reset at the {mode} widget boundary. This means subsequent content in format_left / format_right / format_center does not inherit the colors from the mode widget, making it impossible to dynamically style other widgets (like {session}) based on the current mode.

Steps to Reproduce

plugin location="..." {
    format_left   "{mode}{session} {tabs}"

    mode_locked "#[bg=#31748f,fg=#191724,bold]  LOCKED "
    mode_tmux   "#[bg=#eb6f92,fg=#191724,bold]  COMMAND "
}

Expected: {session} renders on the #31748f (or #eb6f92) background set by the mode widget, since no color reset is specified between {mode} and {session}.

Actual: Colors reset to terminal defaults after {mode}. The session name renders with default terminal colors (white on black), not the mode's background.

I also tested with plain text between {mode} and {session} — same result: terminal default colors.

Image

Use Case

I'd like the entire left block (icon + session name) to change background color when switching modes (e.g., pine background in locked mode, red in tmux/command mode). Currently only the content inside {mode} can change color per mode.

Possible Solutions

  1. Preserve colors across widget boundaries — don't reset colors after rendering {mode}, let them carry into the rest of the format string
  2. Mode-aware color variables — expose something like {mode_bg} / {mode_fg} that can be used in format_left / format_right (e.g., "#[bg={mode_bg}]{session}")
  3. Allow widget placeholders inside mode_* — expanding {session} inside mode format strings would let users compose mode-dependent blocks

Environment

  • zjstatus: latest (downloaded from GitHub releases)
  • zellij: 0.41.2
  • OS: macOS

Thanks for the great plugin!

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions