|
| 1 | +--- |
| 2 | +author: "Aram Drevekenin" |
| 3 | +authorlink: "https://hachyderm.io/@imsnif" |
| 4 | +date: 2025-03-17 |
| 5 | +linktitle: "Zellij 0.42.0: Stacked Resize, Pinned Floating Panes, New Theme Spec" |
| 6 | +type: |
| 7 | +- post |
| 8 | +- posts |
| 9 | +title: "Zellij 0.42.0: Stacked Resize, Pinned Floating Panes, New Theme Spec" |
| 10 | +type: |
| 11 | +images: ["/img/version-42-social-preview-smiley.png"] |
| 12 | +description: "Stacked resize, pinned floating panes, new theme definition spec and new Rust plugin APIs" |
| 13 | +alttext: "A screenshot of Zellij demonstrating the stacked resize and pinned floating panes feature" |
| 14 | +weight: 10 |
| 15 | + |
| 16 | +--- |
| 17 | +Zellij 0.42.0 has just been released! [Check it out!](https://github.com/zellij-org/zellij/releases/tag/v0.42.0) |
| 18 | + |
| 19 | +Some highlights: |
| 20 | + |
| 21 | +- [Stacked Resize](#stacked-resize) |
| 22 | +- [Pinned Floating Panes](#pinned-floating-panes) |
| 23 | +- [New Theme Definition Spec](#new-theme-definition-spec) |
| 24 | +- [New (Rust) Plugin APIs](#new-rust-plugin-apis) |
| 25 | +- [Double/Triple Mouse Click Text Selection in Terminals](#doubletriple-mouse-click-text-selection-in-terminals) |
| 26 | +- [Release Notes and Tips on Startup](#release-notes-and-tips-on-startup) |
| 27 | +- [Do you like Zellij?](#do-you-like-zellij-) ❤️ |
| 28 | + |
| 29 | +Here's a short video demonstrating the highlights. Be sure to scroll down to read more! |
| 30 | + |
| 31 | +{{<video-left-aligned "/video/version-042-intro.mp4">}} |
| 32 | + |
| 33 | +## Stacked Resize |
| 34 | +{{<figure src="/img/stacked-resize-demo.gif" width="600px;" alt="A screen recording demonstrating stacked resize">}} |
| 35 | +This version of Zellij introduces an innovative new way of managing multiple panes. When resizing panes, Zellij will attempt to stack them with their neighbors - giving us more space on screen while still keeping the title of the other panes around so that we can easily navigate to them with the keyboard or mouse. |
| 36 | + |
| 37 | +If you want to learn more, check out the [Stacked Resizes and Pinned Floating Panes Screencast/Tutorial](/tutorials/stacked-resize). |
| 38 | + |
| 39 | +This behavior can be disabled through the [configuration](/documentation/options.html#stacked_resize). |
| 40 | + |
| 41 | +## Pinned Floating Panes |
| 42 | +{{<figure src="/img/pinned-floating-panes-demo.gif" width="600px;" alt="A screen recording demonstrating pinned floating panes">}} |
| 43 | +One of the most loved features of Zellij is its native integration of floating panes. This version adds the ability to "pin" any such pane so that it is always on top, even when not focused. Floating panes can be pinned with a mouse click or with a keyboard shortcut: `Ctrl p` + `i`. |
| 44 | + |
| 45 | +## New Theme Definition Spec |
| 46 | +{{<figure src="/img/theme-spec.png" width="800px" alt="A diagram of the new theme definition spec">}} |
| 47 | +This version introduces a new theme definition specification, allowing much greater flexibility when defining the Zellij UI appearance - extending to user plugins as well. This specification concentrates on the generic UI components used to make-up the Zellij UI rather than mapping colors. We look forward to seeing new themes created by the community with these capabilities. |
| 48 | + |
| 49 | +For more information, see [the theme documentation](/documentation/themes.html). |
| 50 | + |
| 51 | +Special thanks for [DeaconDesperado](https://github.com/DeaconDesperado) for implementing the specification. |
| 52 | + |
| 53 | +## New (Rust) Plugin APIs |
| 54 | +This version adds lots of new capabilities to plugins and exposes them in the built-in Rust SDK. Some highlights: |
| 55 | + |
| 56 | +### Change the `/host` folder |
| 57 | +```rust |
| 58 | +let new_host_folder = PathBuf::from("/different/path/on/machine"); |
| 59 | +change_host_folder(new_host_folder); |
| 60 | +``` |
| 61 | + |
| 62 | +Plugins can now change their mounted `/host` folder at runtime, so that they can access different parts of the user's machine - gated behind the new `FullHdAccess` plugin permission. This ability became possible due to our recent migration to `wasmtime` to manage our WebAssembly/WASI runtime for plugins. |
| 63 | + |
| 64 | +### Change floating pane coordinates |
| 65 | +```rust |
| 66 | +let coordinates = vec![ |
| 67 | + (PaneId::Terminal(1), FloatingPaneCoordinates { |
| 68 | + x: Some(10), |
| 69 | + y: Some(10), |
| 70 | + width: Some(20), |
| 71 | + height: Some(20), |
| 72 | + pinned: Some(true), |
| 73 | + }) |
| 74 | +]; |
| 75 | +change_floating_panes_coordinates(coordinates); |
| 76 | +``` |
| 77 | +Plugins can now change the floating pane coordinates of themselves and other panes. The coordinates include the x/y location, their width/height and whether they're pinned or not. Since these can be done in bulk by sending a vector, this opens lots of interesting possibilities for creating dashboard and control flow experiences. |
| 78 | + |
| 79 | +### Stack arbitrary panes |
| 80 | +```rust |
| 81 | +stack_panes(vec![PaneId::Terminal(1), PaneId::Plugin(1), PaneId::Terminal(2)]); |
| 82 | +``` |
| 83 | +Plugins can now combine existing panes into a stack using their pane ids. Combined with the new `stacked_resize` capabilities described above (also accessible to plugins through the normal resize methods), this can allow plugins to create multiple-select and grouping experiences. |
| 84 | + |
| 85 | +### Read mouse motions |
| 86 | +```rust |
| 87 | +fn update(event: Event) -> bool { |
| 88 | + match event { |
| 89 | + Event::Mouse(Mouse::Hover(x, y)) => { |
| 90 | + eprintln!("hovering over coordinates: {:?}, {:?}", x, y); |
| 91 | + }, |
| 92 | + // ... |
| 93 | + } |
| 94 | + // ... |
| 95 | +} |
| 96 | +``` |
| 97 | +Plugins can now read mouse motions when the user hovers over them. Combined with the built-in UI components, this allows creating very pleasant user experiences in the terminal (an example can be seen in the new built-in `about` plugin, accessible with `Ctrl o` + `a`). |
| 98 | + |
| 99 | +## Double/Triple Mouse Click Text Selection in Terminals |
| 100 | +{{<figure src="/img/click-boundaries-demo.gif" alt="A video demonstrating the mouse click boundary marking behavior">}} |
| 101 | +Since Zellij implements its own mouse selection and copying, many users have noted the lack of ability to double or triple click text in order to mark the word boundaries or canonical line respectively. This version implements this capability for terminal panes. Upcoming in the next version is the ability for plugins to opt-in to text marking with the keyboard/mouse on all or parts of their scrollback. |
| 102 | + |
| 103 | +## Release Notes and Tips on Startup |
| 104 | +{{<figure src="/img/zellij-tip-demo.png" alt="A demo of the Zellij tip on startup">}} |
| 105 | +Starting this version, on first run Zellij will display the release notes for the current version. On subsequent runs, Zellij will display a random useful usage tip on startup. It's possible to disable both of these behaviors through the config (and in the case of tips, also at runtime through the tips window as specified). More info [here](/documentation/options.html#show_release_nodes) and [here](/documentation/options.html#show_startup_tips). |
| 106 | + |
| 107 | +Both of these can be browsed through the new `about` plugin with `Ctrl o` + `a`. |
| 108 | + |
| 109 | +## Do you like Zellij? ❤️ |
| 110 | +Me too! So much so that I spend 100% of my time developing and maintaining it and have no other income. |
| 111 | + |
| 112 | +Zellij will always be free and open-source. Zellij will never contain ads or collect your data. |
| 113 | + |
| 114 | +So if the tool gives you value and you are able, please consider [a recurring monthly donation](https://github.com/sponsors/imsnif) of 5-10$ to help me pay my bills. There are Zellij stickers in it for you! |
0 commit comments