Commit Graph
4 Commits
Author SHA1 Message Date
f77cdec298 feat: add per-pane default foreground/background color support (#4737)
* feat: add per-pane default foreground/background color support

Add per-pane default foreground and background colors, configurable
through four surfaces:

- OSC 10/11 escape sequences (set/query) and OSC 110/111 (reset)
- CLI action: zellij action set-pane-color --pane-id <id> --fg/--bg
- Layout config: default_fg/default_bg properties on pane nodes
- Plugin API: set_pane_color() SDK function and PaneInfo read-side

Colors are applied at render time as a fallback when cells have no
explicit foreground/background, without mutating stored grid data.

Closes #4712

* refactor: address review feedback for pane color support

- Extract adjust_styles_for_custom_bg_fg in output/mod.rs
- Move color parsing (xparse_color) from tab into Grid
- Move color serialization (ansi_code_to_color_string) into Grid
- Pane trait now uses Option<String> for color getters/setters
- Add colors to session serialization (dump-layout)
- Add default_fg/default_bg to protobuf IPC schema to fix
  layout-in-session color loss
- Update example layout with tab-bar and status-bar

* fix stack overflow and ordering

* rustfmt

* update e2e snapshots

---------

Co-authored-by: Karl Bunch <karl@karlbunch.com>
Co-authored-by: Aram Drevekenin <aram@poor.dev>
2026-03-04 14:26:26 +01:00
Cale Flatley 2f0b4d048e chore(assets): update layout examples to .kdl from .yaml (#2250) 2023-03-15 18:18:29 +01:00
Jae-Heon Ji 2096cafe1d chore: update example layout (#926) 2021-12-09 18:38:18 +01:00
a-kenji cd0b0119a0 Split tab-layout into template & tabs section
* adjust example layouts and move them from `./example` to
  `./example/layouts`

* simplify the deserialization of the layout

* layouts are now constructed as follows:

```
---
template:
  direction: Horizontal
  parts:
    - direction: Vertical
      borderless: true
      split_size:
        Fixed: 1
      run:
        plugin: tab-bar
    - direction: Vertical
      body: true # <== The body section specifies the position of the
      # inserted tab
    - direction: Vertical
      borderless: true
      split_size:
        Fixed: 2
      run:
        plugin: status-bar
tabs:
  - direction: Vertical
  - direction: Vertical
```
2021-08-26 15:06:59 +02:00