Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 0 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,6 @@ default_tab_template {
shortcut_prefix "⌘"
active_width "24"
align "center" // "center" slides to keep the active tab centered; "left" anchors the row (all-fit only)
reorder "false" // drag a tab to reorder; "true" also needs RunActionsAsUser
close_button "true" // stamps a clickable close button on each tab; "false" to hide
close_button_color "theme" // glyph color: "theme" (alert red) / "fg" (white) / "red" / "#rrggbb"
tab_gap "2" // cleared columns between tab blocks; "0" packs them flush
Expand Down Expand Up @@ -121,8 +120,6 @@ Contributors hacking on the plugin [build from source](#build-from-source) and p
>
> **`perspective` — lift the active tab with depth.** When `true` (default) **and** the bar is at least **4 rows tall**, every inactive tab recedes by one row — a half-row of terminal background inset at its top and bottom — while the active tab fills the full height, so the selected tab appears to float forward. The height comes from the layout's `pane size=N`, which the plugin can only read, not set: bump the tab-bar pane to `size=4` (or more) to see the effect. Below 4 rows the option is a no-op (every tab fills the bar), and `false` always renders every tab at full height. Pairs naturally with `inactive_dim` — color recede plus depth recede. The bar renders nothing if it is given fewer than 3 rows (the minimap needs that floor to stay legible).
>
> **Enabling `reorder`** requests a third permission, `RunActionsAsUser` (for the `MoveTabByTabId` action a tab drag performs). Granting is all-or-nothing for tab-template plugins, so when you set `reorder "true"` you must **re-run step 2** (the grant prompt then lists all three permissions) and restart — otherwise the bar freezes with no prompt. Left at the default (`false`), the plugin requests only the two permissions above, so an existing install keeps working unchanged across updates.
>
> **`close_button` — click to close a tab.** When `true` (the default), a tab stamps a small close glyph (the Nerd Font *close-circle*, or a plain `×` where your terminal runs zellij's simplified UI without a Nerd Font) in its **top-right corner**; left-clicking exactly that cell closes the tab (via `close_tab_with_index`, which falls under the existing `ChangeApplicationState` grant — no re-grant needed). The glyph appears on the **active tab** — and, when the `perspective` depth cue is off, on **every** tab; under perspective the inactive tabs recede, where a corner glyph reads unbalanced, so they carry none. It only appears on blocks wide enough to draw a per-pane minimap, and never on the **last** remaining tab, so you can't close the bar out of existence. A click anywhere else on the block keeps its usual behavior (switch tab / focus the clicked pane), since the close target is that single cell, not the whole column. Set `false` to hide the glyph for keyboard-driven users.
>
> **`close_button_color` — close glyph color.** The color of the `close_button` glyph (default `theme`). `theme` uses zellij's own alert red — your theme's `exit_code_error` color, falling back to a built-in red when the theme leaves it unset. Some themes derive that alert color from a near-black or near-white `red` (e.g. sobrio's `red "#121212"`), which renders the `theme` glyph almost invisible; override it with `fg` (the active label's white — always legible on a colored tab), `red` (the plugin's built-in alert red, independent of the theme), or any `#rrggbb` hex (e.g. `"#ff5555"`). Affects only the close glyph and is ignored when `close_button "false"`.
Expand Down
2 changes: 0 additions & 2 deletions cliff.toml
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,6 @@ If you pin to a version URL, paste this block into your zellij `permissions.kdl`
}
```

If `reorder "true"` is set, also add `RunActionsAsUser` to that block.

> Using `releases/latest/download/` in your layout? The permission is keyed to that URL and was granted once — no action needed.
"""
trim = true
Expand Down
24 changes: 1 addition & 23 deletions src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,6 @@ pub struct Config {
pub tab_gap: usize,
/// Whether to draw a 1px dark separator between adjacent panes.
pub gutter: bool,
/// Whether drag-to-reorder is enabled. Off by default: the plugin then
/// requests only the v0.1.0 permission set (`ReadApplicationState` +
/// `ChangeApplicationState`), so existing users do not hit a
/// `RunActionsAsUser` cache miss on auto-update (zellij#4982). On → the
/// third permission is requested and a tab drag reorders.
pub reorder: bool,
/// Gradient sweep applied to each pane block's fill. Defaults to `sheen`
/// — the polished out-of-the-box look; `off` restores the flat
/// v0.1.0-style fills. See [`GradientMode`].
Expand Down Expand Up @@ -106,16 +100,14 @@ impl Config {
pub const DEFAULT_ACTIVE_WIDTH: usize = 24;
/// Default alignment — centered, preserving the v0.1.0 sliding behavior so
/// existing layouts render identically on auto-update (opt into `left` to
/// anchor the row). Same default-preserve rationale as [`Self::DEFAULT_REORDER`].
/// anchor the row).
pub const DEFAULT_ALIGN: Alignment = Alignment::Center;
/// Default gap between tab blocks — `2` cleared columns, so adjacent
/// screens read as separate blocks out of the box. Set `0` to pack the
/// blocks flush (the original v0.1.0 look).
pub const DEFAULT_TAB_GAP: usize = 2;
/// Default gutter state — no separator.
pub const DEFAULT_GUTTER: bool = false;
/// Default reorder state — off, preserving the v0.1.0 permission posture.
pub const DEFAULT_REORDER: bool = false;
/// Default gradient mode — `Sheen`, the polished out-of-the-box look.
/// Set `off` to restore the flat v0.1.0-style fills.
pub const DEFAULT_GRADIENT: GradientMode = GradientMode::Sheen;
Expand Down Expand Up @@ -173,10 +165,6 @@ impl Config {
.get("gutter")
.and_then(|raw| raw.parse().ok())
.unwrap_or(Self::DEFAULT_GUTTER),
reorder: configuration
.get("reorder")
.and_then(|raw| raw.parse().ok())
.unwrap_or(Self::DEFAULT_REORDER),
gradient: configuration
.get("gradient")
.and_then(|raw| raw.parse().ok())
Expand Down Expand Up @@ -322,7 +310,6 @@ mod tests {
assert_eq!(config.align, Alignment::Center);
assert_eq!(config.tab_gap, 2);
assert!(!config.gutter);
assert!(!config.reorder);
assert_eq!(config.gradient, GradientMode::Sheen);
assert_eq!(config.gradient_shape, GradientShape::Linear);
assert_eq!(config.gradient_angle, 0);
Expand All @@ -341,15 +328,13 @@ mod tests {
("align", "left"),
("tab_gap", "1"),
("gutter", "true"),
("reorder", "true"),
("gradient", "sheen"),
]);
assert_eq!(config.shortcut_prefix, "C-");
assert_eq!(config.active_width, 30);
assert_eq!(config.align, Alignment::Left);
assert_eq!(config.tab_gap, 1);
assert!(config.gutter);
assert!(config.reorder);
assert_eq!(config.gradient, GradientMode::Sheen);
}

Expand Down Expand Up @@ -488,12 +473,6 @@ mod tests {
assert!(!config_from(&[("gutter", "maybe")]).gutter);
}

#[test]
fn malformed_reorder_falls_back() {
assert!(!config_from(&[("reorder", "yes")]).reorder);
assert!(!config_from(&[("reorder", "")]).reorder);
}

#[test]
fn malformed_tab_gap_falls_back() {
assert_eq!(config_from(&[("tab_gap", "wide")]).tab_gap, 2);
Expand Down Expand Up @@ -632,6 +611,5 @@ mod tests {
assert_eq!(config.align, Alignment::Center);
assert_eq!(config.tab_gap, 2);
assert!(!config.gutter);
assert!(!config.reorder);
}
}
Loading
Loading