summaryrefslogtreecommitdiffstats
path: root/zellij-server/src/panes
AgeCommit message (Collapse)Author
2023-08-26fix(plugins): various ui fixes (#2731)Aram Drevekenin
2023-08-25fix(plugins): make sure configuration is also part of the plugin keys (#2727)Aram Drevekenin
* fix(plugins): make sure configuration is also part of the plugin keys * no thanks clippy
2023-08-24feat(sessions): add a session manager to switch between sessions, tabs and ↵Aram Drevekenin
panes and create new ones (#2721) * write/read session metadata to disk for all sessions * switch session client side * fix tests * various adjustments * fix full screen focus bug in tiled panes * fix tests * fix permission sorting issue * cleanups * add session manager * fix tests * various cleanups * style(fmt): rustfmt * clear screen before switching sessions * I hate you clippy * truncate controls line to width * version session cache * attempt to fix plugin tests * style(fmt): rustfmt * another attempt to fix the tests in the ci
2023-08-12feat: add plugin permission system (#2624)Jae-Heon Ji
* WIP: add exaple of permission ui * feat: add request permission ui * feat: add caching permission in memory * feat: add permission check * feat: add file caching * fix: changes request * feat(ui): new status bar mode (#2619) * supermode prototype * fix integration tests * fix tests * style(fmt): rustfmt * docs(changelog): status-bar supermode * fix(rendering): occasional glitches while resizing (#2621) * docs(changelog): resize glitches fix * chore(version): bump development version * Fix colored pane frames in mirrored sessions (#2625) * server/panes/tiled: Fix colored frames in mirrored sessions. Colored frames were previously ignored because they were treated like floating panes when rendering tiled panes. * CHANGELOG: Add PR #2625 * server/tab/unit: Fix unit tests for server. * fix(sessions): use custom lists of adjectives and nouns for generating session names (#2122) * Create custom lists of adjectives and nouns for generating session names * move word lists to const slices * add logic to retry name generation * refactor - reuse the name generator - iterator instead of for loop --------- Co-authored-by: Thomas Linford <linford.t@gmail.com> * docs(changelog): generate session names with custom words list * feat(plugins): make plugins configurable (#2646) * work * make every plugin entry point configurable * make integration tests pass * make e2e tests pass * add test for plugin configuration * add test snapshot * add plugin config parsing test * cleanups * style(fmt): rustfmt * style(comment): remove commented code * docs(changelog): configurable plugins * style(fmt): rustfmt * touch up ui * fix: don't save permission data in memory * feat: load cached permission * test: add example test (WIP) * fix: issue event are always denied * test: update snapshot * apply formatting * refactor: update default cache function * test: add more new test * apply formatting * Revert "apply formatting" This reverts commit a4e93703fbfdb6865131daa1c8b90fc5c36ab25e. * apply format * fix: update cache path * apply format * fix: cache path * fix: update log level * test for github workflow * Revert "test for github workflow" This reverts commit 01eff3bc5d1627a4e60bc6dac8ebe5500bc5b56e. * refactor: permission cache * fix(test): permission grant/deny race condition * style(fmt): rustfmt * style(fmt): rustfmt * configure permissions * permission denied test * snapshot * add ui for small plugins * style(fmt): rustfmt * some cleanups --------- Co-authored-by: Aram Drevekenin <aram@poor.dev> Co-authored-by: har7an <99636919+har7an@users.noreply.github.com> Co-authored-by: Kyle Sutherland-Cash <kyle.sutherlandcash@gmail.com> Co-authored-by: Thomas Linford <linford.t@gmail.com> Co-authored-by: Thomas Linford <tlinford@users.noreply.github.com>
2023-08-04fix(performance): plug memory leak (#2675)Aram Drevekenin
2023-08-02feat(ui): break pane to new tab and move panes between tabs (#2664)Aram Drevekenin
* prototype * some tests * break out floating pane * break out plugin panes * add keybind and fix some minor issues * remove cli * move pane to left/right tab * update ui * adjust ui * style(fmt): rustfmt * style(comment): remove commented code * update snapshots
2023-07-27fix(terminal): properly handle resizes in alternate screen (#2654)Aram Drevekenin
2023-07-16Fix colored pane frames in mirrored sessions (#2625)har7an
* server/panes/tiled: Fix colored frames in mirrored sessions. Colored frames were previously ignored because they were treated like floating panes when rendering tiled panes. * CHANGELOG: Add PR #2625 * server/tab/unit: Fix unit tests for server.
2023-06-19fix(plugins): swap layouts and invoked_with (#2564)Aram Drevekenin
2023-06-17feat(plugins): more plugin api methods (#2550)Aram Drevekenin
* feat(plugins): close, focus, rename pane, rename tab and show_self api methods * style(fmt): rustfmt
2023-06-15feat(plugins): plugin pane state events (#2545)Aram Drevekenin
* feat(plugins): report pane state to plugins * refactor(plugins): rename some stuff * tests(plugins): adjust for new behavior * style(fmt): rustfmt
2023-06-13fix(logs): suppress debug logs when not debugging (#2532)Aram Drevekenin
* fix(logs): suppress debug logs when not debugging * fix(tests): add debug flag to constructor
2023-06-07feat(wasm-plugin-system): major overhaul and some goodies (#2510)Aram Drevekenin
* strider resiliency * worker channel prototype * finalized ui * show hide plugin * fs events to plugins * tests for events and new screen instructions * various refactoringz * report plugin errors instead of crashing zellij * fix plugin loading with workers * refactor: move watch filesystem * some fixes and refactoring * refactor(panes): combine pane insertion logic * refactor(screen): launch or focus * refactor(pty): consolidate default shell fetching * refactor: various cleanups * initial refactoring * more initial refactoring * refactor(strider): search * style(fmt): rustfmt * style(pty): cleanup * style(clippy): ok clippy * style(fmt): rustfmt
2023-04-19feat(plugins): reload plugin at runtime (#2372)Aram Drevekenin
* fix(plugins): proper error when wasm file does not exist * reload working * race condition handling * refactor(plugins): start plugin * refactor(plugins): plugin-loader * refactor(plugins): load/reload plugin * refactor(plugins): apply cached events * fix(plugins): gittery loading * chore(plugins): rename reload-plugin to start-or-reload-plugin * chore(styling): small cleanups * style(fmt): rustfmt * style(fmt): cleanups * style(fmt): cleanups * test(e2e): update snapshots * test(e2e): update snapshots * chore(repo): comment plugin optimization because it doubles the CI time
2023-04-18feat: Add layout configuration to exclude panes from tab sync (#2314)Theo Salzmann
2023-04-03fix(layout): pane focus in stack (#2344)Aram Drevekenin
2023-04-03feat(panes): allow defining an expanded stacked pane (#2343)Aram Drevekenin
* feat(panes): allow defining an expanded stacked pane * style(fmt): rustfmt
2023-03-29feat(terminal): cli and bindable action to clear all buffers for a specific ↵Oleks Gnatovskyi
pane (#2239) * fix typo * Add clear screen action * add proper test * added bindable action; remove pointless default impl * add default binding * use imsnif's variant * remove commented example config * remove log line --------- Co-authored-by: Aram Drevekenin <aram@poor.dev>
2023-03-27feat(plugins): async plugin loading (#2327)Aram Drevekenin
* work * refactor(plugins): break down start plugin async function * work * loading messages * nice ui * floating panes and error handling * cleanups and conflicting plugin/direction * find exact pane when relayouting * fix plugin pane titles * kill loading tasks on exit * refactor: move stuff around * style(fmt): rustfmt * various fixes and refactors
2023-03-16fix(panes): adding panes to lone stack (#2298)Aram Drevekenin
2023-03-15fix(screen): focus pane on screen edge when moving pane focus offtab (#2293)Aram Drevekenin
* fix(screen): focus pane on proper edge when switching tabs through pane switch * style(fmt): rustfmt
2023-03-09fix(ansi): pad line end when erasing characters (#2259)Aram Drevekenin
2023-03-01fix(sixel): report pixel size in winsize change ioctl (#2212)Aram Drevekenin
* fix(sixel): report pixel size in winsize change ioctl * style(fmt): rustfmt
2023-02-28fix(grid): only use background pending styling when deleting characters (#2204)Aram Drevekenin
2023-02-27fix(layouts): do not relayout twice on auto_layout (#2202)Aram Drevekenin
* fix(layouts): do not relayout twice on auto_layout * style(fmt): rustfmt
2023-02-25fix(layout): various parser and ui fixes (#2191)Aram Drevekenin
* fix(layout): error on nodes outside layout node * fix(layout): move stacked property to pane * fix(layout): various stack exceptions * fix(ui): non-flexible stacked pane titles now take up their full length * fix(ui): stack titles with no-pane-frames take up their proper length * style(fmt): rustfmt
2023-02-20fix(grid): glitchy resizes (#2182)Aram Drevekenin
* fix(grid): glitchy resizes * style(fmt): rustfmt
2023-02-20fix(ux): fullscreen navigation (#2117)Yves Biener
* fix(pane): fullscreen navigation in all four directions * fix(pane): use previous method in previous context
2023-02-17feat(ui): swap layouts and stacked panes (#2167)Aram Drevekenin
* relayout working with hard coded layout * work * refactor(layout): PaneLayout => TiledPaneLayout * tests passing * tests passing * tests passing * stacked panes and passing tests * tests for stacked panes * refactor(panes): stacked panes * fix: focusing into stacked panes from the left/right * fix(layouts): handle stacked layouts in the middle of the screen * fix(pane-stack): focus correctly when coming to stack from above/below * fix(stacked-panes): resize stack * fix(stacked-panes): focus with mouse * fix(stacked-panes): focus next pane * fix(layout-applier): sane focus order * fix(stacked-panes): better titles for one-liners * fix(stacked-panes): handle moving pane location in stack * fix(relayout): properly calculate display area * fix(relayout): properly calculate rounding errors * fix(stacked-panes): properly handle closing a pane near a stack * fix(swap-layouts): adjust swap layout sort order * feat(swap-layouts): ui + ux * fix(swap-layouts): include base layout * refactor(layout): remove unused method * fix(swap-layouts): respect pane contents and focus * work * fix(swap-layouts): load swap layouts from external file * fix(swap-layouts): properly truncate layout children * fix(stacked-panes): allow stacked panes to become fullscreen * fix(swap-layouts): work with multiple tabs * fix(swap-layouts): embed/eject panes properly with auto-layout * fix(stacked-panes): close last pane in stack * fix(stacked-panes): move focus for all clients in stack * fix(floating-panes): set layout damaged when moving panes * fix(relayout): move out of unfitting layout when resizing whole tab * fix(ui): background color for swap layout indicator * fix(keybinds): add switch next layout in tmux * fix(ui): swap layout indication in compact layout * fix(compact): correct swap constraint * fix(tests): tmux swap config shortcut * fix(resizes): cache resizes so as not to confuse panes (eg. vim) with multiple resizes that it debounces weirdly * feat(cli): dump swap layouts * fix(ui): stacked panes without pane frames * fix(ux): move pane forward/backwards also with floating panes * refactor(lint): remove unused stuff * refactor(tab): move swap layouts to separate file * style(fmt): rustfmt * style(fmt): rustfmt * refactor(panes): various cleanups * chore(deps): upgrade termwiz to get alt left-bracket * fix(assets): merge conflicts of binary files * style(fmt): rustfmt * style(clippy): no thank you! * chore(repo): remove garbage file
2023-01-13fix: wide-char drop on resize to 1 and invalid session names (#2082)朱李
* fix: deny invalid session name * fix: `zellij attach --create SESSION_NAME` check session name * fix: drain_until(1) discard widechar * style(grid): add comment explaining the change Co-authored-by: Aram Drevekenin <aram@poor.dev>
2022-12-24Floating panes in layouts (#2047)Aram Drevekenin
* work * tests passing * tests: floating panes in layouts * panes(plugins): floating plugins working * refactor(tab): layout applier * style(comment): remove outdated * style(fmt): rustfmt
2022-12-19fix(panes): show visual error when failing to resize panes (#2036)Aram Drevekenin
* fix(panes): show visual error when failing to resize pane vertically/horizontally * fix(resize): retry pane resize on rounding errors * fix(resize): proper error when resizing other panes into fixed panes * style(fmt): rustfmt
2022-12-14fix(panes): show visual error when unable to split panes ↵Aram Drevekenin
vertically/horizontally (#2025) * fix(panes): show visual error when failing to split pane vertically/horizontally * fix: lockfile
2022-12-13Hotfix: Resize with plugin panes (#2019)har7an
* server/panes/tiled/grid: Fix area calculation for debug assertions. Now also considers fixed-size panes correctly. * server/panes/tiled/grid: Refactor function to make it more readable and remove some implicitly handled "special" cases. * server/panes/tiled/grid: Handle plugins panes like any other pane type and only check whether they are fixed-size panes, too. * changelog: Add PR #2019
2022-12-08Reimplement resize code (#1990)har7an
* server/floating_panes: Start removing `unwrap`s * server/panes: Remove more `unwrap`s in floating panes code. * utils/data: Unify `Direction` type which was previously present in multiple locations. Also start working on a new Resize Method (type `ResizeStrategy`), to remove code duplication in the resize code. * server: Implement new resize handling with the `ResizeStrategy` type. Add a new action with the ability to invoke it from the CLI. Take care to maintain backwards-compatibility in terms of configuring the new resize mode. * utils/layout: Add conversion for SplitDirection from `data::Direction`. * utils/data: Add impl for `Direction` * server/panes: Rework tiled pane resizing but it's currently still broken in a few regards and misses ability to perform "regular" increase/decrease. * server/panes/tiled_panes: Add debug assertion to catch if the total area of all panes (in percent) is different from 100.0 at some point. * server/panes/tiled/grid: Fix resize bug caused by the fact that neighboring plugin panes previously weren't filtered from resize operations, even though they cannot be resized at all. * utils/data: Add `invert` for `Resize` * utils/data: Add member to `ResizeStrategy` that controls whether we invert resize behavior when increasing size towards a bounadry. This maintains current behavior. * server/screen: Handle new attribute in `ResizeStrategy` * server/panes/resizer: Return `anyhow::Error` * server/panes/tiled: Implement resize increase/decrease without specifying a direction (towards all possible directions). Currently broken in some cases. * server/pane/tiled/grid: Don't return early to preserve resize debug assertions. * server/pane/tiled/grid: Fix resize bug caused by checking for the wrong alignments in some cases. Also refactor the code for looking up aligned panes. * server/panes/tiled/grid: Cleanup code and remove log statements and unused functions. * server/panes/float/grid: Invert resize if the floating pane is hitting a boundary already. * plugins/status-bar: Add hints for new resize * server: Use new resize method * server: Fix tests with new functions and result types. * apply rustfmt * utils: Apply rustfmt * server/panes/floating: Fix resize increase behavior which would previously, upon hitting a boundary, cause the pane to invert the resize operation, which is wrong. Instead, it now does not resize floating panes on an undirected resize "increase" in directions where it hits boundaries. * server/panes/tiled: Use correct resize increments The values for the resize increments were previously wrong, causing many of the tests to fail. * server/panes/tiled: Fix resize checks to correctly consider fixed-size panes. * utils/assets/config: Update default config with new keybindings for resize mode. * server/panes/tiled: Fix resize check * server/panes/tiled: Use shortener for `Direction` type in `change_pane_size` function. * server/panes/tiled: Restore resize behavior for undirected resizes, to the way it was before this PR. * server/panes/floating: Fix resize increment for undirected resizes * utils/data: Fix doctest * utils: Fix test snapshots for tests working with the default config * changelog: Add PR #1990
2022-12-06refactor(messaging): reduce extraneous cross-thread messaging (#1996)Aram Drevekenin
* refactor(messaging): reduce extraneous cross-thread messaging * style(fmt): rustfmt
2022-12-06refactor(plugins): fix plugin loading data flow (#1995)Aram Drevekenin
2022-11-23fix(panes): focus change when closing and between tabs (#1966)Aram Drevekenin
* fix(panes): do not forget pane focus when switching tabs or closing panes * style(fmt): rustfmt * fix(tests): e2e snapshots
2022-11-21performance(rendering): improve rendering performance (#1960)Aram Drevekenin
* refactor(plugins): plugins now need to explicitly ask to be rendered * performance(render): remove various needless renders * performance(render): cache boundaries * performance(render): adjust tests and cache cursor location/shape * style(comment): remove outdated * style(fmt): rustfmt
2022-11-15refactor(plugins): change the data flow (#1934)Aram Drevekenin
* refactor(plugins): do not block render loop * refactor(plugins): cleanup * style(fmt): rustfmt * fix(plugins): various rendering pipeline fixes
2022-11-08errors: Remove `log::error` in server (#1881)har7an
* server/wasm_vm: Replace `log::error!` with better error logging by means of `non_fatal`. This preserves the original error and allows adding context information on top. Also makes error formatting more uniform across the application. * server/tab: Replace `log::error!` with better error logging by means of `non_fatal`. This preserves the original error and allows adding context information on top. Also makes error formatting more uniform across the application. * server/route: Replace `log::error!` and propagate the error to the caller instead. * server/pty: Replace `log::error!` with better error logging by means of `non_fatal`. This preserves the original error and allows adding context information on top. Also makes error formatting more uniform across the application. Also add per-instruction error context to make it clear what we tried to accomplish when an error occured. * server/panes/tiled_panes: Merge dependencies and sort them into a better order. * server/panes/tiled_panes: Replace `log::error!` with better error logging by means of `non_fatal`. This preserves the original error and allows adding context information on top. Also makes error formatting more uniform across the application. * server/os_input_output: Merge depndencies and sort them into a better order. * server/logging_pipe: Replace `log::error!` with better error logging by means of `non_fatal`. This preserves the original error and allows adding context information on top. Also makes error formatting more uniform across the application. * server/os_io: Remove uses of `log::error` * changelog: Add PR #1881 * server/os_io: Gracefully handle failing resize for terminals IDs that don't exist, instead of propagating the error to the user. * server/lib: Remove leftover log message * server/pty: Log error cause rather than providing a hard-coded error reason which is plain wrong in this context. * server/screen: Remove calls to `log::error!` and change `get_active_tab(_mut)?` to return a `Result` instead of an `Option`. This already makes many places in the code obsolete where previously "failed to get active tab..." was logged manually. Rather than logging, use the `anyhow::Error`s we have, along with all their context information, and log these instead.
2022-11-05fix(panes): moving and toggling embed/float with frames (#1909)Aram Drevekenin
* fix(ui): frame broken or missing when embedding/floating without pane frames * fix(panes): offset properly without pane frames
2022-11-04feat(terminals): send focus in/out events to terminal panes (#1908)Aram Drevekenin
* feat(terminals): send focus in/out events to terminal panes * style(fmt): rustfmt * style(fmt): rustfmt
2022-11-02fix(terminal): Reset dim SGR independently from bold (#1803)Pedro Fedricci
2022-11-02errors: Don't unwrap in `server::os_input_output` (#1895)har7an
* server/os_io: Redefine `ServerOsApi` result types to use `anyhow::Result` instead. This mostly makes the need of custom `SpawnTerminalError` obsolete (tbd in subsequent commits) and unifies error handling across the application. * utils/errors: Implement new `ZellijError` type to replace any previously defined, isolated custom error types throughout the application. Currently implements all error variants found in `SpawnTerminalError`. In the long term, this will allow zellij to fall back to a single error type for all application-specific errors, instead of having different error types per module. * server/unit/screen: Impl new `ServerOsApi` with updated `Result`-types. * server/tab/unit: Impl new `ServerOsApi` with updated `Result`-types. * server/os_io: Impl new `ServerOsApi` with updated `Result`-types. * utils/ipc: Return `anyhow::Error` in `send` rather than a `&'static str`, which isn't compatible with `anyhow::Context`. * server/tab: Handle `Result` in `resize_pty!` which is returned due to the changed return types in `ServerOsApi`. * server/tab: Handle new `Result`s originating in the change to the `ServerOsApi` trait definition. * server/screen: Handle new `Result`s originating in the change to the `ServerOsApi` trait definition. * server/panes/tiled: Handle new `Result`s originating in the change to the `ServerOsApi` trait definition. * server/panes/floating: Handle new `Result`s originating in the change to the `ServerOsApi` trait definition. * server/lib: Unwrap on new `Result`s originating in the change to the `ServerOsApi` trait definition. The functions here don't return a `Result` yet, this is better left to a follow-up PR. * server: Remove `SpawnTerminalError` and make use of the new `ZellijError` instead. Make use of `anyhow`s downcast capabilities to restore the underlying original errors where necessary, as was done previously. This gives us the flexibility to attach context information to all errors while still allowing us to handle specific errors in greater detail. * server/pty: Fix vars broken in rebase * server/os_io: Remove last `SpawnTerminalError` * changelog: Add PR #1895
2022-11-01feat(command-panes): allow to start suspended (#1887)Aram Drevekenin
* feat(command-panes): allow panes to start suspended * style(fmt): remove unused code * style(fmt): rustfmt
2022-10-30errors: Don't unwrap in `zellij_server::output` (#1878)har7an
* server/output: Don't unwrap and return `Result` types where appropriate instead. * server: Handle new `Result`s from `output` * server/tab/unit: Unwrap new `Result`s * changelog: Add PR #1878 Don't unwrap in `zellij_server::output`.
2022-10-28improve error handling in ui module (#1870)哇呜哇呜呀咦耶
* improve error handling in ui module * resolve problems in the review
2022-10-23plugins: Improve error handling on plugin version mismatch (#1838)har7an
* server/tab: Don't panic in `Pane::render` and do not crash the application on failure to receive a render update from plugins any longer. Instead, will print a simple string with a hint to check the application logs, where a more thorough error indication can be found. * utils/errors: re-export `anyhow::Error` to create ad-hoc errors with custom error types, without having to wrap them into a `context()` before to turn the into anyhow errors. * plugins: Check plugin version on startup and terminate execution with a descriptive error message in case the plugin version is incompatible with the version of zellij being run. * server/wasm_vm: Add plugin path in version error so the user knows which plugin to look at in case they're using custom plugins. * server/wasm_vm: Check plugin version for equality Previously we would accept cases where the plugin version was newer than the zellij version, which doesn't make a lot of sense. * server/wasm_vm: Prettier error handling in call to `wasmer::Function::call` in case a plugin version mismatch can occur. * tile: Install custom panic handler that will print the panic message to a plugins stdout and then call a panic handler on the host that turns it into a real application-level panic. * tile: Catch errors in event deserialization and turn them into proper panics. These errors are symptomatic of an uncaught plugin version mismatch, for example when developing from main and compiling zellij/the plugins from source. Normal users should never get to see this error. * utils/errors: Improve output in `to_stdout` for anyhow errors. The default anyhow error formatting of `{:?}` is already very good, and we just made it worse by trying to invent our own formatting. * tile: Reword plugin mismatch error message * zellij: Apply rustfmt * changelog: Add PR #1838 Improve error handling on plugin version mismatch. * server/wasm_vm: Rephrase error in passive voice
2022-10-20server/panes/grid: Fix whitespace errorhar7an