aboutsummaryrefslogtreecommitdiffstats
path: root/zellij-utils/src (follow)
Commit message (Collapse)AuthorAge
...
* feat(plugin): add manifest to allow for plugin configuration (#660)spacemaison2021-09-22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * feat(plugins-manifest): Add a plugins manifest to allow for more configuration of plugins * refactor(plugins-manifest): Better storage of plugin metadata in wasm_vm * fix(plugins-manifest): Inherit permissions from run configuration * refactor(plugins-manifest): Rename things for more clarity - The Plugins/Plugin structs had "Config" appended to them to clarify that they're metadata about plugins, and not the plugins themselves. - The PluginType::OncePerPane variant was renamed to be just PluginType::Pane, and the documentation clarified to explain what it is. - The "service" nomenclature was completely removed in favor of "headless". * refactor(plugins-manifest): Move security warning into start plugin * refactor(plugins-manifest): Remove hack in favor of standard method * refactor(plugins-manifest): Change display of plugin location The only time that a plugin location is displayed in Zellij is the border of the pane. Having `zellij:strider` display instead of just `strider` was a little annoying, so we're stripping out the scheme information from a locations display. * refactor(plugins-manifest): Add a little more documentation * fix(plugins-manifest): Formatting Co-authored-by: Jesse Tuchsen <not@disclosing>
* feat(layout): specify only tab name in `tabs` section (#722)a-kenji2021-09-21
| | | | | | | | | | | | | | | | | | | Allow specifying only the tab name in the `tabs` section - For example this is now possible: ``` tabs: - name: first parts: - direction: Vertical - direction: Vertical - name: second - name: third ``` For that the tab section defaults the direction to `direction::Horizontal` - Adds an error upon specifying a tab name inside the `parts` section of the tab-layout
* Implement `attach --create` subcommand flag to create session if one does ↵GPery2021-09-19
| | | | | | | | | | | | | not exist (#731) * Implement attach --create * fixup! Implement attach --create * fixup! Implement attach --create * fixup! Implement attach --create * fixup! Implement attach --create
* Add `options` subcommand to `attach` (#718)a-kenji2021-09-13
| | | | | | | | | | | | | | | | | | | fixes #688 - the `options` subcommand of `attach` functions the same, as the `options` subcommand of creating the normal session, but not every option will have an effect on reattaching, for example the `default_mode` setting would make no sense to switch. In the future it would make sense to be able to hot swap some of the options on reattach, but we are not able to do that yet, for example the `default_shell` one. Eg: ``` zellij attach <session-name> options --theme <theme> ```
* Improve handling of empty valid `yaml` files (#716)a-kenji2021-09-13
| | | | | | | | | | | Improves the way empty valid `yaml` files are handled. When deserializing a `config` or `layout` file, that is an empty valid `yaml` file, eg: ``` --- ``` We now assume the default configuration is desired.
* feat(screen): support specifying tab's name in layout (#715)Tw2021-09-13
| | | Signed-off-by: Tw <tw19881113@gmail.com>
* Calculate width with unicode-width in tab-bar and utils (#709)Paulo Coelho2021-09-12
| | | | | * fix(tab-bar): calculate string width using unicode-width * fix(utils): calculate ansi_len using unicode-width
* feat(cwd-pane): Keeping the cwd when opening new panes (#691)spacemaison2021-09-10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * feat(cwd-pane): Add a new trait to get the cwd of a given pid Co-authored-by: Quentin Rasmont <qrasmont@gmail.com> * feat(cwd-pane): Allow for setting the cwd when spawning a new terminal Co-authored-by: Quentin Rasmont <qrasmont@gmail.com> * feat(cwd-pane): Add an active_pane field to the Pty struct Co-authored-by: Quentin Rasmont <qrasmont@gmail.com> * feat(cwd-pane): Update Pty with Tab's active pane id Co-authored-by: Quentin Rasmont <qrasmont@gmail.com> * feat(cwd-pane): Refactor spawn_terminal to use cwd by default Co-authored-by: Quentin Rasmont <qrasmont@gmail.com> * feat(cwd-pane): Fix tests and lints Co-authored-by: Quentin Rasmont <qrasmont@gmail.com> * feat(cwd-pane): Fix formatting * feat(cwd-pane): Refactor child pid fetching to handle errors better Instead of panicking when transfering the process id of the forked child command we just return an empty process id. * feat(cwd-pane): Add non Linux/MacOS targets for the get_cwd method. This will allow Zellij to compile on non Linux/MacOS targets without having an inherited cwd. * feat(cwd-pane): Refactor spawn_terminal method to use ChildId struct. The spawn_terminal methods been refactored to use the ChildId struct in order to clarify what the Pid's returned by it are. The documentation for the ChildId struct was improved as well. * feat(cwd-pane): Fix tests/lints Co-authored-by: Jesse Tuchsen <not@disclosing> Co-authored-by: Quentin Rasmont <qrasmont@gmail.com>
* feat(plugin): add exec_cmd helper for executing command in hostTw2021-09-09
| | | | Signed-off-by: Tw <wei.tan@intel.com> Signed-off-by: Tw <tw19881113@gmail.com>
* style(clippy): various fixes (#704)Paulo Coelho2021-09-09
| | | | | | | | * test: fix clippy unused_io_amount * chore(clippy): various clippy fixes needless_borrow, let_and_return, vec_init_then_push, unit_arg, useless_format, field_reassign_with_default, redundant_clone
* feat(ui): overhauled resize and layout systemsBrooks Rady2021-08-28
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * refactor(panes): move to parametric pane sizes * Fixed the simpler errors by casting to usize * The least I can do is pass the formatting check... * Move to stable toolchain * Well, it compiles? * And now it doesn't! ;) * Baseline functionality with the new Dimension type * Working POC for percent-based resizing * REVERT THIS COMMIT – DELETES TESTS * Perfected the discrete resize algorithm * Fixed fixed-size panes * Basic bidirectional resize * feat(resize): finalised parametric resize algorithm * Reduce the logging level a bit * Fixed nested layouts using percents * Bug squishing for implicit sizing * Here is a funky (read: rubbish) rounding approach * And now it's gone again! * Improve discretisation algorithm to fix rounding errors * Fix the last layout bug (maybe?) * Mixed explicit and implied percents work now * Let's pretend that didn't happen... * Make things a bit less crashy * Crash slightly more for now (to find bugs) * Manaually splitting of panes works now * Start moving to percent-based resizes * Everything but fullscreen seems to be working * Fix compilatation errors * Culled a massive amount of border code * Why not pause to please rustfmt? * Turns out I was still missing a few tests... * Bringing back even more tests! * Fix tests and pane boarders * Fix the resize system without gaps * Fix content offset * Fixed a bug with pane closing * Add a hack to fix setting of the viewport * Fix toggling between shared borders and frames * fix(tests): make e2e properly use PaneGeom * style(fmt): make rustfmt happy * Revert unintentional rounding of borders * Purge some old borderless stuff * Fix busted tab-bar shrinking * Update E2E tests * Finish implementing fullscreen! * Don't crash anymore? * Fix (almost) all tests * Fix a lack of tab-stops * All tests passing * I really can't be bothered to debug a CI issue * Tie up loose ends * Knock out some lingering FIXMEs * Continue to clean things up * Change some naming and address FIXMEs * Cull more code + FIXMEs * Refactor of the resize system + polish * Only draw frames when absolutely necessary * Fix the tab-bar crash * Fix rendering of boarders on reattach * Fix resizing at small pane sizes * Deduplicate code in the layout system * Update tab-bar WASM * Fixed the pinching of panes during resize * Unexpose needlessly public type * Add back a lost test * Re-add tab tests and get them to compile * All tabs need layouts * Start fixing tests + bug in main * Stabilize the resize algorithm rounding * All tests from main are now passing * Cull more dead code
* Split tab-layout into `template` & `tabs` sectiona-kenji2021-08-26
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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 ```
* test(layout): add borderlessAram Drevekenin2021-08-24
|
* Merge branch 'tab-layout' of https://github.com/a-kenji/zellij into ↵Aram Drevekenin2021-08-24
|\ | | | | | | a-kenji-tab-layout
| * Add `template` section in `layout` filea-kenji2021-08-21
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | It works as follows: ``` --- template: direction: Horizontal parts: - direction: Vertical split_size: Fixed: 1 run: plugin: tab-bar - direction: Vertical body: true - direction: Vertical split_size: Fixed: 2 run: plugin: status-bar tabs: - direction: Vertical ``` The tabs are created in the body section of the template.
| * Change layout panics to errorsa-kenji2021-08-02
| | | | | | | | * Adjust and add tests for the change
| * Merge branch 'main' of https://github.com/zellij-org/zellij into tab-layouta-kenji2021-08-01
| |\
| * | !fixup cargo fmta-kenji2021-07-23
| | |
| * | Merge branch 'main' of https://github.com/zellij-org/zellij into tab-layouta-kenji2021-07-23
| |\ \
| * | | Add `tabs` to `layouts`a-kenji2021-07-23
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | fixes #603, fixes #349 * The layout has now a unique `tabs` section, that can be used, like the `parts` section, everything that is not inside the tabs section is assumed to be present on every single tab that is opened. This is a BREAKING CHANGE for people that use custom `layouts` already, since the `tabs` section is not optional - for clarity and intentionality reasons. The functionality to specify multiple tabs is already there, but is still gated behind a panic, until #621 is fixed. So for now one tab can be specified to load on startup. * The `NewTab` action can optionally be bound to open a layout that is assumed to be in the new `tabs` section This is a BREAKING CHANGE for people that have the `NewTab` action already bound in the config file: ``` - action: [NewTab, ] key: [F: 5,] ``` must now be specified as: ``` - action: [NewTab: ,] key: [F: 5,] ``` Optionally a layout that should be opened on the new tab can be specified: ``` - action: [NewTab: { direction: Vertical, parts: [ {direction: Horizontal, split_size: {Percent: 50}}, {direction: Horizontal, run: {command: {cmd: "htop"}}},], key: [F: 6,] ``` or: ``` - action: [NewTab: {direction: Vertical, run: {command: {cmd: "htop"} }},] key: [F: 7,] ``` or ``` - action: [NewTab: { direction: Vertical, parts: [ {direction: Vertical, split_size: {Percent: 25},run: {plugin: "strider" }}, {direction: Horizontal}],}, MoveFocus: Left,] key: [F: 8,] ```
* | | | Merge pull request #622 from sagittarius-a/feature/go-to-last-taba-kenji2021-08-23
|\ \ \ \ | | | | | | | | | | feat(tab): add keybind to go to last tab visited
| * | | | fix: rename action to ToggleTabSagittarius-a2021-08-03
| | | | |
| * | | | fix: fix toggle to previous tab when deleting tabsSagittarius-a2021-08-03
| | | | |
| * | | | fix: rename variable as stated in pull requestSagittarius-a2021-08-03
| | | | |
| * | | | feat(tab): add keybind to go to last tab visitedSagittarius-a2021-08-03
| | |_|/ | |/| | | | | | | | | | | | | | | | | | Fixes #398. Tab key is used as default for the `GoToLastTab` action.
* / | | feat(ui): pane frames (new pane UI) (#643)Aram Drevekenin2021-08-12
|/ / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * work * resize working * move focus working * close pane working * selection and fullscreen working * pane title line * titles and conditional scroll title * whole tab resize working * plugin frames working * plugin splitting working * truncate pane frame titles * cleanup * panes always draw their own borders - also fix gap * toggle pane frames * move toggle to screen and fix some bugs * fix plugin frame toggle * fix terminal window resize * fix scrolling and fullscreen bugs * unit tests passing * e2e tests passing and new test for new frames added * refactor: TerminalPane and PluginPane * refactor: Tab * refactor: moar Tab * refactor: Boundaries * only render and calculate boundaries when there are no pane frames * refactor: Layout * fix(grid): properly resize when coming back from alternative viewport * style: remove commented code * style: fmt * style: fmt * style: fmt + clippy * docs(changelog): update change
* | | Simplify deserialization for layouts, configa-kenji2021-07-28
| | | | | | | | | | | | | | | | | | | | | Simplify deserialzation for layouts, config and config options. Move the logic responsible to `Setup::from_options()` in order to be able to parse `main.rs` as well as adding new command easier.
* | | feat(scroll): Restore scroll position on SIGINTSagittarius-a2021-07-24
| |/ |/| | | | | | | | | Fixes #606 Currently scroll down to bottom then exits scroll mode.
* | Merge pull request #623 from a-kenji/feature/dump-layouta-kenji2021-07-22
|\ \ | | | | | | Add cmd to dump `layout` to stdout
| * | Add cmd to dump layout to stdouta-kenji2021-07-22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Adds the ability to dump the default layouts to stdout, similar to the `zellij setup --dump-config`, but now it needs the name of a currently existing layout: - default - strider - disable-status `zellij setup --dump-layout [LAYOUT]`
* | | Merge branch 'main' into display-session-namea-kenji2021-07-22
|\| |
| * | Merge branch 'main' into unified-loggingqepasa2021-07-20
| |\|
| | * Merge pull request #612 from a-kenji/improve-optionsa-kenji2021-07-09
| | |\ | | | | | | | | Improve options
| | | * Add serde-alias for on_force_closea-kenji2021-07-09
| | | | | | | | | | | | | | | | | | | | | | | | | | | | * It doesn't deserialize from the configuration otherwise, if specified in lower-case. Alternative: use a rename.
| | | * Simplify merging of optionsa-kenji2021-07-09
| | | |
| | | * Add doc-comment for mouse-modea-kenji2021-07-09
| | | |
| | | * Improve clarity of precedence in optionsa-kenji2021-07-09
| | | |
| | * | Merge pull request #600 from a-kenji/layout-commanda-kenji2021-07-09
| | |\ \ | | | |/ | | |/| Add commands to layout
| | | * Add commands to layouta-kenji2021-07-09
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add the ability to run commands on loading a layout: ``` - direction: Horizontal split_size: Percent: 50 run: command: {cmd: htop} ``` or respectively: ``` - direction: Horizontal split_size: Percent: 50 run: command: {cmd: htop, args: ["-C"]} ``` In order to specify the difference of commands and plugins now the plugins need to be under the `run` section: ``` - direction: Vertical split_size: Fixed: 2 run: plugin: status-bar ``` This also means that this is a breaking change for people that already have a custom layout. Example layouts: ``` --- direction: Vertical parts: - direction: Horizontal split_size: Percent: 50 parts: - direction: Vertical split_size: Percent: 50 - direction: Vertical split_size: Percent: 50 run: command: {cmd: htop} - direction: Horizontal split_size: Percent: 50 run: command: {cmd: htop} ``` and: ``` --- direction: Horizontal parts: - direction: Vertical split_size: Fixed: 1 run: plugin: tab-bar - direction: Vertical parts: - direction: Vertical parts: - direction: Vertical split_size: Percent: 50 run: command: {cmd: htop} - direction: Vertical split_size: Percent: 50 run: command: {cmd: htop, args: ["-C"]} - direction: Vertical split_size: Fixed: 5 - direction: Vertical split_size: Fixed: 2 run: plugin: status-bar ``` closes #551, closes #284
| | * | Add doc comment for the on_force_close optionKunal Mohan2021-07-09
| | | |
| | * | Add on_force_close config optionKunal Mohan2021-07-09
| | | |
| * | | Minor fixesPaweł Palenica2021-07-17
| | | |
| * | | Apply code review suggestions. Rename decorating_pipe to logging_pipe. Add ↵Paweł Palenica2021-07-13
| | | | | | | | | | | | | | | | plugin_id to plugin log. Move logger init from file to in-code initialization and change logging file to zellij directory. Change format of timestamp.
| * | | Merge branch 'main' into unified-loggingqepasa2021-07-08
| |\| |
| * | | CleanupPaweł Palenica2021-07-08
| | | |
| * | | feat: Add logger to ZellijPaweł Palenica2021-06-29
| | | | | | | | | | | | | | | | | | | | | | | | We add log4rs create for logging across Zellij. Additionally, we capture `stderr` output from plugins and log it the same log file as other Zellij logs.
* | | | Move `ModeInfo::new()` back to `get_mode_info()`Lovecraftian Horror2021-07-09
| | | |
* | | | Display session name within sessionLovecraftian Horror2021-07-08
| |/ / |/| |
* | | Change name of `Run` binding for actionsa-kenji2021-07-06
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Change ``` Run: {command: <path>, args: [ARGS], direction:<direction> } ``` into ``` Run: {cmd: <path>, args: [ARGS], direction:<direction> } ```
* | | Add custom function for unit test in zellij-utilsKunal Mohan2021-07-06
| | |