Commit Graph

60 Commits

Author SHA1 Message Date
har7an
e19ba4e341
Makefile: Fix CI ordering/dependencies (#2004) 2022-12-09 11:06:11 +00:00
har7an
1e141aa7fe
HOTFIX: utils: Move plugins into new assets folder (#2003)
that is included in the utils to make builds pass.
2022-12-09 10:49:32 +00:00
har7an
11b0210de5
plugins: rework plugin loading (#1924)
* zellij: Move "populate_data_dir" to utils

and rewrite it to take a second, optional parameter. This allows
controlling whether only a specific asset should be installed. We do
this as preparation for being able to recover from a plugin version
mismatch error, where we will need to repopulate the data dir for
offending plugins.

* server/wasm_vm: Recover from PluginVersionMismatch

Adds a global plugin cache that stores, per plugin config, the wasmer
module associated with it. Make `start_plugin` take the pre-populated
module and create only the necessary modifications to the wasm env etc.

* utils: Fix formatting

* zellij: Delete non-existent module

* utils/shared: fix missing "set_permissions"

function when not on unix systems.

* server/wasm_vm: Don't populate cachedir

with serialized versions of the WASM plugins.

* utils/input/plugins: load wasm bytes from assets

for builtin plugin specifications. This foregoes any need to:

- Dump the plugin bytes to disk at all and
- subsequently read the plugin bytes from disk

* zellij: Disable default asset installation

which previously installed only the builtin plugins to disk. This is no
longer necessary because now we can load the builtin plugins directly
from the application binary.

* utils/input/plugins: Update docs

* utils/input/plugins: Add 'is_builtin' method

to `PluginConfig` that returns true if the plugin configuration refers
to a builtin plugin.

* wasm_vm: Remove plugin version mismatch handling

because a version mismatch in an internal plugin is now unfixable, with
the plugins being loaded from the running binary, and we have no control
over external plugins in the first place.

* cargo: Reintroduce feature flag

for `disable_automatic_asset_installation`

* utils/consts: Add `ASSET_MAP`

which currently contains the compiled WASM plugins.

* utils/shared: Fix clippy lint

* utils/errors: Add more `ZellijError` variants

* zellij: Make loading internal plugins optional

by reenabling the `disable_automatic_asset_installation` flag and
utilizing it for this purpose. Changes plugin search behavior to throw
better errors in case the builtin plugins cannot be found, depending on
the state of this feature.

* utils/errors: Apply rustfmt

* utils/setup: Allow dumping builtin plugins

to a specified folder on disk. This is meant to be an "escape hatch" for
users that have accidentally deleted the builtin plugins from disk (in
cases where the plugins aren't loaded from inside the zellij binary).

* utils/input/plugins: Update docs

* utils/setup: Add hint to `setup --check` output

when zellij was built without the `disable_automatic_asset_installation`
flag and will thus not read builtin plugins from the "PLUGIN DIR".

* utils/setup: Refine `setup --dump-plugins`

to dump to:

- The default "DATA DIR" when no option is provided with the argument,
  or
- The provided option, if existent

Also print a message to stdout with the destination folder that the
plugins are dumped to.

* server/wasm_vm: Ignore "NotFound" errors

when attempting to delete the non-existent plugin data directories. This
silences an error message that otherwise ends up in the logs when
quitting zellij.

* utils/errors: Extend "BuiltinPluginMissing" msg

to hint the user to the `zellij setup --dump-plugins` command to fix
their issues for them!

* utils/errors: Track caller in calls to `non_fatal`

which will hopefully, once closures can be annotated, allow us to
display the location of the call to `non_fatal` in log messages.

* utils/input/plugins: Fix plugin lookup

to prefer internal assets if available. It was previously broken because
sorting the paths vector before deduping it would bring the paths into a
wrong order, looking up in the plugin folder first.

Also print a log message when a plugin is being loaded from the internal
assets but exists on disk, too.

* Apply rustfmt

* make: build-e2e depends on wasm-opt-plugins

so it updates the assets when building the binary

* server/qwasm_vm: Remove var

* utils/consts: Add plugins from target folder

and include them in the asset map from there, too. Include plugins from
debug or release builds, depending on the build type.

* utils/consts: Take release plugins from assets

instead of the target/release folder. The latter will break
installations from crates.io, because we currently rely on including the
plugins we pre-compiled and distribute along with the binary.

* server/wasm_vm: Reintroduce .cache folder

to speedup subsequent application launches.

* cargo: Reorder workspace members

to improve behavior with `cargo make` with respect to compilation order.

* Makefile: restructure plugin tasks

* Makefile: Fix CI errors

* Makefile: More CI diagnosis

* github: Install wasm-opt in e2e test workflow

* Makefile: Build plugins for e2e-test target

* server/Wasm_vm: Reorder plugin folder creation

so no folders are created in the plugin cache when loading a plugin
fails due to not being present or similar.

* update plugins testcommit

* makefile: Change job order

* changelog: Add PR #1924
2022-11-22 20:06:02 +00:00
Aram Drevekenin
b1fef873fa hotfix: update yaml to kdl in the makefile 2022-10-25 08:46:26 +02:00
Aram Drevekenin
79bf6ab868
feat(config): switch to kdl (#1759)
* chore(config): default kdl keybindings config

* tests

* work

* refactor(config): move stuff around

* work

* tab merge layout

* work

* work

* layouts working

* work

* layout tests

* work

* work

* feat(parsing): kdl layouts without config

* refactor(kdl): move stuff around

* work

* tests(layout): add cases and fix bugs

* work

* fix(kdl): various bugs

* chore(layouts): move all layouts to kdl

* feat(kdl): shared keybidns

* fix(layout): do not count fixed panes toward percentile

* fix(keybinds): missing keybinds and actions

* fix(config): adjust default tips

* refactor(config): move stuff around

* fix(tests): make e2e tests pass

* fix(kdl): add verbose parsing errors

* fix(kdl): focused tab

* fix(layout): corret default_tab_template behavior

* style(code): fix compile warnings

* feat(cli): send actions through the cli

* fix(cli): exit only when action is done

* fix(cli): open embedded pane from floating pane

* fix(cli): send actions to other sessions

* feat(cli): command alias

* feat(converter): convert old config

* feat(converter): convert old layout and theme files

* feat(kdl): pretty errors

* feat(client): convert old YAML files on startup

* fix: various bugs and styling issues

* fix: e2e tests

* fix(screen): propagate errors after merge

* style(clippy): lower clippy level

* fix(tests): own session_name variable

* style(fmt): rustfmt

* fix(cli): various action fixes

* style(fmt): rustfmt

* fix(themes): loading of theme files

* style(fmt): rustfmt

* fix(tests): theme fixtures

* fix(layouts): better errors on unknown nodes

* fix(kdl): clarify valid node terminator error

* fix(e2e): adjust close tab test

* fix(e2e): adjust close tab test again

* style(code): cleanup some comments
2022-10-05 07:44:00 +02:00
har7an
f76b828209
fix(status-bar): reflect actual current keybindings (#1242)
* status-bar: first_line: Use more generic var names

Rename all `CtrlKey...` to the equivalent `Key...` to make the name less
specific. It implies that all key bindings use Ctrl as modifier key,
which needn't necessarily be the case.

* status-bar: first_line: Refactor `ctrl_keys`

Removes lots of code duplication by `Unselect`ing all keys by default
and only `Select`ing what is actually required for a given Input mode.

* utils: conditionally compile unix-specific code

In `zellij_utils`, the following modules each contained code that was
previously targeting only the unix platform:

- consts: Works with unix-specific filesystem attributes to set e.g.
  special file permissions. Also relies on having a UID.
- shared: Uses unix-specific filesystem attributes to set file
  permissions

These will never work when targeting wasm. Hence the concerning code
passages have been moved into private submodules that are only compiled
and re-exported when the target isn't `#[cfg(unix)]`. The re-export
makes sure that crates from the outside that use `zellij_utils` work as
before, since from their point of view nothing has changed.

* utils: Share more modules with wasm

that work on both wasm and unix natively. This requires factoring out
bits of code in the `setup` and `input` modules into a private submodule
that is re-exported when the compilation target is *not* "wasm". The
following modules are now available to the wasm target:

- cli
- consts
- data
- envs
- input (partial)
    - actions
    - command
    - configs
    - keybinds
    - layout
    - options
    - plugins
    - theme
- pane_size
- position
- setup (partial)
- shared

The remaining modules unavailable to wasm have dependencies on crates
that cannot compile against wasm, such as `async_std` or `termwiz`.

* utils/input/keybinds_test: Fix import

of the `CharOrArrow` struct which is now part of the `data` submodule.

* utils/layout: Use global serde crate

Previously the code was decorated with `#[serde(crate = "self::serde")]`
statements which cannot be shared with wasm. Use the regular serde
without specifying which serde is meant.

* utils/data: Implement `fmt::Display` for `Key`

so the Keybindings can be displayed via `format!` and friends in e.g.
the status bar.

* tile/prelude: Re-export `actions`

submodule of `zellij_utils` so the plugins can access the `ModeKeybinds`
struct with all of its members.

* utils/data: Fix `ModeInfo::keybinds` type

and transfer a vector of `(Key, Vec<Action>)` to the plugins so they can
parse it themselves, instead of passing strings around. Due to the
requirement of the `Eq` trait derive on `ModeInfo` this requires
deriving `Eq` on all the types included by `Key` and `Action` as well.

Note that `Action` includes the `layout::SplitSize` structure as a
member. We cannot derive `Eq` here since `SplitSize::Percent(f64)`
cannot satisfy `Eq` because `f64` doesn't implement this. So we add a
new type to hack around this limitation by storing the percentage as
`u64` internally, scaled by a factor of 10 000 and transforming it to
f64 when needed. Refer to the documentation of `layout::Percent` for
further information.

* utils/data: Make `Key` sortable

so the keybindings can be sorted after their keys.

* WIP: utils/input: Make keybinds accessible

when generating `ModeInfo` structs.

* utils/data: Handle unprintable chars in `Key`

when displaying via the `fmt::Display` trait. Handles `\t` and `\n` and
represents them as UTF-8 arrow glyphs.

* HACK: utils/layout: Use u64 for SplitSize::Percent

The previous workaround using a custom `Percent` type fails at the
absolute latest when confronted with user layouts, since these do not
know about the scaling factor and will thus break. It still breaks
currently because `Percent` now expects a u64 (i.e. `50`, not `50.0`)
but this is more easily explained and understood.

* status-bar: Add helper macros

that retrieve the key bound to execute a sequence of `Action` given a
specific Keybinding, and a shorthand that expands to
`Action::SwitchToMode(InputMode::Normal)` used for pattern matching with
the `matches!` macro.

* status-bar/first_line: Get shared superkey if any

from the `ModeKeybindings` in the current `ModeInfo` struct. If the
configured keybindings for switching the modes don't have a superkey in
common, do not print a common prefix.

* status-bar/first_line: Add key to KeyShortcut

which is the key that must be pressed in the current mode to execute the
given shortcut (i.e. switch to the given mode).

* status-bar/first_line: Dynamically set mode binds

Read the keybindings for switching the modes to print in the first line
from the actually configured keybindings for the current mode. Add some
logic to the code that:

- Prints only the "single letter" of the keybinding if all mode-switch
  shortcuts *share the same modifier key*,
- Or prints the whole keybinding (with modified) into each segment if
  there is no common modifier key.

* status-bar/second_line: Display configured binds

Instead of showing some hard-coded default values. For each mode, reads
the keybindings from the configured keybindings based on some sequence
of action. For example, the keybinding for `New` in the `Pane` menu is
now determined by looking into the configured keybindings and finding
what key is bound to the `Action::NewPane(None)` action.

If no keybinding is found for a given sequence of actions, it will not
show up in the segments either.

* WIP: utils/keybinds: Make key order deterministic

by using a BTreeMap which by default has all of its elements in sorted
order internally. As of currently this doesn't seem to impress the order
in which the keybindings are sent to the plugins, though.

* utils/data: Reorder `Key` variants

to have the Arrow keys sorted as "left", "down", "up", "right" in
accordance with the display in e.g. the status bar.

* status-bar/first_line: Fix inverted `matches!`

when trying to obtain the keybindings to switch between the input modes.
Its initial purpose was to filter out all ' ', '\n' and 'Esc'
keybindings for switching modes (As these are the default and not of
interest for the status bar display), but it was not negated and thus
only filtered out the aforementioned keys.

* status-bar: Don't get all modeswitch keybinds

but only those that are displayed in the status bar. This currently
excludes the keybindings for Entering the Pane/TabRename mode, Tmux mode
and Prompt mode. We must explicitly exclude these since they aren't
bound to the same Modifiers as the regular keys. Thus, if we e.g. enter
Pane or Tab mode, it will pick up the
`SwitchToMode(InputMode::TabRename)` action as being bound to `c`, hence
the `superkey` function cannot find a common modifier, etc. But we don't
display the `TabRename` input mode in the first line anyway, so we must
ignore it.

Therefore, we additionally add the keybinding to call the `Action::Quit`
action to terminate zellij to the vector we return. Also remove the
`(Key, InputMode)` tuple and convert the return type to a plain
`Vec<Key>`, since the never worked with the `InputMode` in the first
place.

* status-bar/first_line: Fix output for tight screen

Implement the "Squeezed" display variant where we do not display which
of the modes each keybinding switches to, but only the keybinding
itself.

* status-bar/second_line: Remove trailing " / "

* status-bar/second-line: Refactor key hints

Instead of determining the appropriate key hints for every case
separately (i.e. enough space to show all, show shortened, shot
best-effort), create a central function that returns for the current
`InputMode` a Vector with tuples of:

- A String to show in full-length mode
- A String to show in shortened/best-effort mode
- The vector of keys that goes with this key hint

This allows all functions that need the hints to iterate over the vector
and pick whatever hint suits them along with the Keys to display.

* status-bar/second-line: Implement shortened hints

* utils/data: Fix display for `Key::Alt`

which previously printed only the internal char but not the modifier.

* status-bar/first-line: Add hidden Tmux tile

that is only shown when in Tmux mode. Note that with the default config
this "breaks" the shared superkey display, because it correctly
identifies that one can switch to Scroll mode via `[`.

* status-bar: Print superkey as part of first line

Instead of first obtaining the superkey and then the rest of the first
line to display. This way we don't need to split up individual data
structures and carry a boolean flag around multiple functions.

It also has the advantage that when the available space is really tight,
the first line is entirely empty and doesn't display a stale superkey
without any other keybinding hints.

* status-bar: Rework keybinding theming

Previously there were individual functions to create the tiles in the
first line depending on whether:

- A tile was selected, unselected, unselected alternate (for theming) or disabled, and
- Tiles had full length or were displayed shortened

In the first case, the functions that previously handled the theming
only differed in what theme they apply to the otherwise identical
content. Since the theming information was drawn from a flat structure
that simulated hierarchy by giving hierarchical names to its theme
"members", this couldn't be handled in code. In the second case, some of
the theming information needed for the full-length shortcuts was
replicated for the shortened shortcuts.

Instead, rewrite the general Theming structure into a hierarchical one:
Adds a new structure `SegmentStyle` that contains the style for a single
segment depending on whether it is selected, unselected (alternate) or
disabled. Refactor the `first-line` module to use a single function to
generate either full-length or shortened tiles, that does functionally
the same but switches themes based on the selection status of the tile
it themes.

* status-bar/second-line: Return new `LinePart`s

from the `add_shortcut` function instead of modifying the input
parameters.

* status-bar/second-line: Implement adaptive behavior

and make the keyhints adapt when the screen runs out of space. The hints
first become shortened and when necessary partially disappear to display
a "..." hint instead.

* status-bar/second-line: Show float pane binding

based on the keycombination that's really bound to switching into the
"Pane" input mode.

* status-bar/get_keys_and_hints: Add more modes

for the keybindings in Tmux and the Pane/TabRename input modes.

* status-bar/second-line: Unify mode handling

and don't do extra shortcut handling for Tmux and the Pane/TabRename
modes any longer. Instead, assemble this like for all other modes from
the keybinding and hints vector.

* status-bar/first-line: Refactor common modifier

to a separate function so it can be used by other modules, too.

* status-bar/second-line: Display modifier in hints

when available. For example, for bindings to move between panes when in
PaneRename mode, now displays "Alt + <hjkl>" instead of
"<Alt+hAlt+j...>".

* utils/ipc: Remove `Copy` from `ClientAttributes`

 as preparation to add `Keybinds` as a member to the `ClientAttributes`
 struct. `Keybinds` contains a `HashMap`, for which the `std` doesn't
 derive `Copy` but only `Clone`.

* utils/input/keybinds: Fix import path

Import `Key` and `InputMode` directly from `data`.

* utils/ipc: Add `Keybinds` to `ClientAttributes`

so we can keep track, pre-client, of the configured key bindings and
pass them around further in the code.

* server/lib: Store `ClientAttributes` over `Style`

in `SessionMetadata` to be able to pass Keybindings to other places in
the code, too. Since `Style` is also a member of `ClientAttributes`,
this works with minimal modifications.

* utils/input: Change `get_mode_info` parameters

to take a `ClientAttributes` struct instead of merely the `Style`
information. This way we can get the `Style` from the
`ClientAttributes`, and also have access to the `keybinds` member that
stores the keybinding configuration.

* utils/ipc: Use `rmp` for serde of IPC messages

instead of `bincode`, which seemingly has issues (de)serializing
`HashMap`s and `BTreeMap`s since `deserialize_any` isn't implemented for
these types.

* fix(nix): remove `assets` from `gitignore`

Remove `assets` from the gitignore of the plugins themselves,
since every single plugin now depends on the asset being accessible
in its source directory.

* tests/e2e: Fix status bar in snapshots

to reflect the current state of the dynamic keybindings.

* status_bar/first_line: Don't show unbound modes

If switching to a specific mode isn't bound to a key, don't show a
tile/ribbon for it either. E.g. in `LOCKED` mode, this will only show
the tile for the `LOCK` mode and ignore all others.

* utils/data: Make 'Key::Char(' ') visible as "␣"

so the user doesn't only see a blank char but has an idea that the space
key is meant.

* status_bar/second_line: Remove extra hints

generated by the `hint_producing_function` that would tell the user in
every input mode how to get back to normal mode. Instead, add this as
keybinding to the general keybindings vector.

This removes some lines of duplicated code but most of all now applies
the correct theming to this keybinding. Additionally, previously the
`RenameTab` and `RenamePane` input modes would show the keybinding to
get back to normal mode twice and both of them were hardcoded. This
binding is now dynamically displayed based on what the user configured
as keybinding.

* utils/data: format unprintable chars as words

instead of unicode symbols. E.g. write "SPACE" instead of "␣".

* utils/data: Fix display for `Ctrl`/`Alt` keys

previously their "inner" chars would be displayed with a regular
`fmt::Display` for the `&str` type they are. This doesn't match what we
want to output. So instead we wrap the inner chars into `Key::Char`
before printing them.

* utils/data: Change order of `Key`s

so that e.g. for the default bindings in `Scroll` mode we prefer to show
`PgDn|PgUp` rather than the arrow keys these actions are bound to as
well.

* status_bar/first_line: Don't ignore default char

bindings by default. These include the '\n', ' ' and 'Esc' bindings that
by default lead back to `Normal` input mode from all the modes.
Previously we would unconditionally ignore them and consequently not
print the tile when in fact the user may have bound this particular
action to either of the keys.

Instead now we first ignore the keys mentioned and if we turn up with an
undefined binding, we consider these default keys as well so we get
*something* to display in any case.

* status_bar/first_line: Add space when no modifier

is shared between the keybindings. This way there isn't a stray arrow at
the very border of the screen, but it is spaced just like the tab-bar
and the second line is.

* status_bar/second_line: Print separators

between consecutive keys bound to specific actions. This allows the user
to visually differ between different keys.

* status_bar/main: Don't return modifier if empty

* status_bar/first_line: Don't suppress Disabled tiles

Disabled is a special state that the keybindings only assume in locked
mode. It turns the respective tiles grey to signal to the user that
these are currently inactive. With respect to users new to zellij, it
may appear confusing that when entering locked mode all the other tiles
disappear (which they do because they have no valid keybinding
assigned). Since we have no keybinding for them, we still display them
but without any associated key (i.e. as `<>` for the binding).

* status_bar/first_line: Don't print leading triangle

on first tile, when there is no shared superkey.

* status_bar/second_line: Add exceptions

for inter-key separators. Keeps groups of `hjkl` and arrow keys intact
(doesn't add separators between the keys) but separates all others.

* status_bar/main: Refactor `action_key`

to a regular function instead of a macro. It turns out that while being
able to match patterns is a nice feature, we completely rely on the keys
that drop out of the pattern found this way to be sorted in a sensible
way. Since we sort the key vectors in the necessary places after the
keys, and not the actions, this of course doesn't apply when the user
changes "hjkl" to "zjkl", which would then become "jklz". Now this is of
course wrong, because "z" still means "Move focus left", and not "Move
focus right".

With the function we now assume a slice of Actions that we match the
action vectors from the keybindings against to obtain the necessary
keys. In order to avoid ugly `into_iter().chain(...)` constructs we had
before we also add a new function `action_key_group` that takes a sliced
array of slices to get a whole group of keys to display.

* status_bar/first_line: Fix "triangle" for short tiles

since we do not want to display a colored triangle at the start of the
line when in sortened mode (just as we do for the long tiles now).
Also fix a bug that would make the triangle reappear when the first
keybinding to be displayed didn't have a key assigned and thus wouldn't
be displayed at all.

* status_bar/second_line: Fix typo

that would cause single `Ctrl+?` bindings for actions in the second line
to be displayed as `Ctrl + <Ctrl+?>`.

* status_bar/second_line: Fix char count

when displaying groups of keys in a binding with or without a separator.

* status_bar: Use new `action_key` fn

instead of the previous macro to obtain the keys to display in the
status bar in a fixed given order. Also fix the display "bug" where tab
switching would be shows as "ArrowLeft/ArrowDown" instead of
"ArrowLeft/ArrowRight".

* status_bar/second_line: Fix floating pane hint

that tells the user what keybinding to press to suppress the currently
active floating panes. This was previously hardcoded.

* utils: Send full keybinds in `ModeInfo`

instead of the currently active `ModeKeybinds` for the active input
mode. Some of the UI issues cannot be solved without having access to
*all* keybindings.

* utils: Refactor keybinds vec into type

to make clippy happy.

* status_bar/first_line: Remove needless borrows

* status_bar: Factor out printing keybindings

into a separate function that takes a vector of keys and a palette and
returns the painted key groups, with correct inter-character separation
where necessary and factoring out common modifier keys.

* status_bar/tip: Use real keybindings

instead of printing hard-coded messages to the user.

* status_bar: abort early when keyvector is empty

in `style_key_with_modifier`.

* status_bar/tip: Fix all keybindings

and make them dynamic given the keybindings really active in the current
session. Also display **UNBOUND** is some keybinding is missing from the
users config.

* status_bar: Go clippy!

* status_bar: Add documentation

and add a new exception group to `action_key_group` that ensures that
`hl` and `jk` won't be separated with `|`.

* status_bar/tip: Detect when key aren't bound

correctly and show "UNBOUND" as keyhint instead, then. Previously we
would only check the length of the whole keybinding segment, but that
isn't a good indicator since most of the bindings require changing modes
first, which already adds a variable number of letters to the segment.
However, there is not point in showing how to get to a certain mode, if
the binding needed in that mode doesn't exist.

* status_bar/first_line: Show bindings when locked

if the user has any configured.

* status_bar: Don't consider 'hl', 'jk' groups

that don't need a separator in between the letters.

* status_bar/second_line: Add "search" keybindings

for the new Search functionality.

* tests/e2e: Fix snapshots

with what the status bar now really displays.

* status_bar: Remove old comments

* status_bar/first_line: Rename 'long_tile'

to the more descriptive name 'mode_shortcut', which better describes
what this function does.

* status_bar/first_line: Fix spacing in simple UI

where the modifier would be shows as `Ctrl +`, without a trailing space.
This isn't an issue in regular mode, where we have the spacing from the
arrow gaps (`>>`) that "simulates" this effect.

* status_bar: Refactor  and rename `ctrl_keys`

so it doesn't rely on some "external" index for operation any more.

* status_bar: Add unit tests to shared functions

and fix a bug in the process where certain `Ctrl` keybindings would be
displayed wrong.

* status_bar/first_line: Rename functions

responsible for printing the long and short shortcut keyhint tiles. Also
add some documentation that explains their purpose and the arguments
they accept.

* status_bar/tips: Remove stray "/" in quicknav tip

* utils/layout: Remove old comments

introduced when rewriting `SplitSize::Percent` to not hold an `f64`
type.

* status_bar: Add "regex" as test dependency

We use regular expressions to strip all ANSI escape sequences in the
strings that are produced by the plugin functions during testing. We do
not test for the style information, but merely for the raw text.

* status_bar: Implement unit tests

* Makefile: Always run tests on host triple

This allows the unit tests for all plugins to be run on the host as well
(because their default compilation target is wasm32-wasi).

* tests/e2e: Add test for custom bindings

in the status bar. Makes sure that the modified bindings from a custom
configuration file are read and applied to the UI.

Co-authored-by: a-kenji <aks.kenji@protonmail.com>
2022-07-27 16:48:35 +02:00
a-kenji
3ccc1f3946
Add/ci enable clippy (#1509)
* fix(clippy): clippy fixes

* add(ci): enable clippy warnings

* chore(fmt): cargo fmt

* disable: failing clippy action

Add `cargo make clippy` in ci
2022-06-15 15:26:52 +02:00
a-kenji
edac2eb5a9
add(ci/makefile): run clippy on all features (#1479)
Run clippy on all exposed features, to minimize the possiblility
of breakage.
2022-06-10 12:21:01 +02:00
a-kenji
d62e6fb57e
add(plugin): compact-bar & compact layout (#1450)
* add(plugin): `compact-bar` & `compact` layout

* add(nix): `compact-bar` plugin

* add(config): `compact-bar` to the config

* add(workspace): `compact-bar` to workspace members

* add(assets): `compact-bar`

* chore(fmt): rustfmt

* add(nix): add `compact-bar`

* add: compact layout to dump command

* nix(build): fix destination of copy command

* add(makefile): add `compact-bar` to `plugin-build`

* add(layout): `compact-bar` to layout

* add: install `compact-bar` plugin

* fix(test): update input plugin test

* fix(plugin): default colors for compact-bar
2022-06-03 11:14:38 +02:00
Aram Drevekenin
3a2fee601a chore(package): patch version 2022-04-13 18:46:00 +02:00
a-kenji
fb1880e162
fix: release tagging (#1223)
Switch from "lightweight" tags to "annotated" tags for releases,
since "lightweight" tags are meant for private or temporary object
labels.

`man git tag`:

```
Tag objects (created with -a, -s, or -u) are called "annotated" tags; they contain a creation date, the
tagger name and e-mail, a tagging message, and an optional GnuPG signature. Whereas a "lightweight" tag is
simply a name for an object (usually a commit object).
Annotated tags are meant for release while lightweight tags are meant for private or temporary object
labels. For this reason, some git commands for naming objects (like git describe) will ignore lightweight
tags by default.
```
2022-03-16 11:10:33 +01:00
Thomas Linford
3765aa3483
fix(tests): ensure e2e tests use updated plugins (#1047)
* launch zellij with --data-dir flag in e2e tests, to avoid using prebuilt
  plugins from assets dir, and instead use the ones from the docker
  mount.
* make the tests use plugins built in release mode to avoid some test
  failures due to timing issues.
* format Makefile.toml.
* set uid 1001 to in e2e action (thanks to https://github.com/francisfuzz/actions-uid-gid)
2022-02-27 22:05:37 +01:00
Aram Drevekenin
477ad9e1a6 chore(build): fix publishing flow 2022-01-05 10:34:29 +01:00
danieleades
a62a23a1c7
fix(clippy): ensure clippy runs on all targets (#972)
* ensure clippy runs on all targets

* use 'AtomicBool' instead of 'Mutex<bool>'

* remove unused import

* remove 'mem::drop' no-ops

* remove loop that never loops
2021-12-29 09:16:54 +01:00
a-kenji
f74af9c7bf
fix(makefile): update update-default-config (#751)
- switch the `update-default-config` task to be prior to commiting
  changes
2021-09-30 09:30:59 +02:00
a-kenji
7ab0e39931
fix(makefile): build-plugins on building dev-dir (#750)
- add building plugins `build-plugins` as a dependency for the task
  `build-dev-data-dir`
2021-09-30 09:15:47 +02:00
Aram Drevekenin
5c54bf18c2
feat(sessions): mirrored sessions (#740)
* feat(sessions): mirrored sessions

* fix(tests): input units

* style(fmt): make rustfmt happy

* fix(tests): make mirrored sessions e2e test more robust

* refactor(sessions): remove force attach

* style(fmt): rustfmtify

* docs(changelog): update change

* fix(e2e): retry on all errors
2021-09-27 11:29:13 +02:00
a-kenji
8cf93d8e81
feature(release): Copy default config to the examples folder on release (#736)
fixes #733
2021-09-21 17:16:41 +02:00
Aram Drevekenin
e993a23a85 chore(release): v0.16.0 2021-08-31 10:00:26 +02:00
Brooks Rady
a51f500c17
fix(ui): change resize binding to Ctrl-n
* fix(ui): change resize binding to Ctrl-n

* Fix tests?

* Actually update the keybind in tests

* Cowardly refuse to fix the E2E testing issue
2021-08-30 18:02:14 +01:00
Brooks Rady
76a5bc8a05
feat(ui): overhauled resize and layout systems
* 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
2021-08-28 17:46:24 +01:00
Brooks J Rady
d097c521ac chore(release): v0.15.0 2021-07-19 20:27:58 +01:00
Aram Drevekenin
2e0e22cdb4 chore(release): v0.14.0 2021-07-05 10:13:46 +02:00
Aram Drevekenin
3313634fe9
Add e2e tests (#582)
* feature(tests): e2e tests

* chore(build): github action

* chore(build): fix workflow

* chore(build): fix workflow

* work

* work

* work

* work

* work

* work

* work

* work

* work

* work

* work

* work

* work

* work

* work

* work

* work

* work

* work

* work

* work

* work

* work

* work

* work

* work

* work

* work

* work

* work

* work

* work

* work

* work

* work

* work

* work

* work

* work

* work

* work

* work

* work

* work

* work

* work

* work

* work

* work

* work

* working

* working

* working

* bring back the proper errors

* make e2e flow run properly

* style(fmt): make rustfmt happy

* style(fmt): make rustfmt happy

* run on everything just to test the workflow

* bring back running behaviour on workflow
2021-06-21 10:45:18 +02:00
a-kenji
dc8487cb4f Fix missing layout-dir in makefile
The `layout-dir` got removed, but the
make action depended on the `dir`.
2021-06-17 16:45:04 +02:00
Brooks J Rady
65574eea5d fix(build): better tested publishing flow 2021-06-03 21:58:02 +01:00
Brooks J Rady
d6a8daba84 fix(build): allow crates.io to update between crate uploads 2021-06-03 20:43:20 +01:00
Aram Drevekenin
5b0ac7b3c4 chore(release): v0.12.0 2021-05-27 14:15:24 +02:00
Aram Drevekenin
1e5c688ed9 chore(build): update makefile 2021-05-27 09:35:58 +02:00
Kunal Mohan
6755b6a88d hotfix(build): Fix cargo make install 2021-05-24 18:44:48 +05:30
Kunal Mohan
1933310626 Allow passing arguments to test and build commands 2021-05-22 22:54:00 +05:30
Kunal Mohan
62d0901bbd Revert changes to Makefile.toml and build without --all-features 2021-05-16 22:03:44 +05:30
Kunal Mohan
2038947a14 Big refactor: separate crates for client, server and utilities 2021-05-16 21:41:56 +05:30
Brooks J Rady
f1bff237a4 feat(build): incorporate git committing and tagging into the publish process 2021-05-14 11:41:00 +01:00
Brooks J Rady
b835594bf2 fix(build): fix an unintuitive operator precedence breaking plugin updating 2021-05-14 11:07:45 +01:00
henil
23450a708c fix(build): Make sure assets/man folder exists before building
manpage.
2021-05-07 10:27:45 +05:30
a-kenji
bee1082b4a
Merge pull request #455 from Adhalianna/main
Add a manpage to Zellij
2021-05-05 22:22:10 +02:00
NKGoc
b504a5379e auto install mandown if it's not there (tested with Manjaro repositories) 2021-05-05 14:16:53 +02:00
NKGoc
67a0a8dc3b Merge branch 'main' of https://github.com/Adhalianna/zellij 2021-05-05 13:21:17 +02:00
NKGoc
0003f8268f new tasks to install mandown and generate manpage 2021-05-05 13:20:26 +02:00
NKGoc
b70d73a581 new tasks to install mandown and generate manpage 2021-05-05 13:16:58 +02:00
NKGoc
0ab7a51d04 simplifications 2021-05-05 12:05:05 +02:00
Brooks J Rady
6e5600efc8 chore(plugin): shuffle helper library names and versions 2021-05-04 23:31:30 +01:00
NKGoc
ba99c379cc typo fix 2021-05-04 21:06:48 +02:00
NKGoc
4ebf0c8c44 remove description added when making sense out of cargo make 2021-05-04 20:53:23 +02:00
NKGoc
00d064e349 add manpage to zellij 2021-05-04 20:50:27 +02:00
denis
56cf446275 chore: added zellij-tile-extra, moved macros from zellij-tile 2021-05-02 12:57:48 +03:00
Brooks J Rady
65f15457c1 fix(build): don't store binary assets in git 2021-04-29 15:53:10 +01:00
Brooks J Rady
afefa82f47 fix(ci): fix cross compiliation 2021-04-26 23:33:53 +01:00
Brooks J Rady
fee999ec40 fix(naming): made plugin terminology more consistent 2021-04-19 23:37:47 +01:00