summaryrefslogtreecommitdiffstats
path: root/zellij-utils
AgeCommit message (Collapse)Author
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-31feat(mouse): allow toggling mouse mode at runtime (#1883)Thomas Linford
2022-10-31fix: resolve setup --clean panic (#1882)Thomas Linford
Do not use Config::default() default() has empty plugins config and that does not work with the default layout. Use Config::try_from() instead, since it already handles the clean flag. Also, do not check the clean flag twice, it is already handled in Config::try_from.
2022-10-28feat: support multiple themes in one file (#1855)Jae-Heon Ji
* feat: support multiple themes in a one file * chore: update example of multiple themes to gruvbox
2022-10-28feat(command-panes): optionally allow panes to be closed on exit (#1869)Aram Drevekenin
* feat(cli): allow option to close command pane on exit * feat(layouts): allow option to close command panes on exit * style(fmt): rustfmt
2022-10-25chore(version): bump development versionAram Drevekenin
2022-10-24fix(various): minor fixes before 32 (#1841)Aram Drevekenin
* fix(layouts): point to layout documentation * adjust shell completions * comment about clear-defaults in the config
2022-10-24chore: add help to cli options (#1839)Jae-Heon Ji
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-20fix(layouts): various bugs and better errors (#1831)Aram Drevekenin
* fix(layout): error on percent size 0 * fix(command): better error on invalid commands * fix(layouts): better error on unknown pane nodes * fix(layouts): disallow certain template names * style(fmt): rustfmt
2022-10-20errors: Don't panic in `wasm_vm` (#1827)har7an
* server/wasm_vm: Compact module imports * utils/errors: Impl `to_anyhow` for PoisonError which is returned by calls to `lock` on various types of locks from `std`. In our case, some of the locks we try to acquire in `wasm_vm` can contain an `mpsc::Sender`, which is `!Send` and hence doesn't work with `anyhow`. Turn the `PoisonError` into an error string instead and returns that as `anyhow::Err`. * wasm_vm: Remove calls to `unwrap` in the WASM VM codes server API. Note that this doesn't include the Plugin APIs. Mark the error as `fatal` in `server/lib`, where the wasm thread is created. This will cause zellij to report a proper error (and log it) when any of the plugin-related functions fails. Unfortunately, this closes the channel to the WASM thread. Hence, when loading the plugins upon startup fails, the error reported in the terminal (visible to the user) hints towards a call in `plugin_pane` being the culprit. However, the real error will be contained in the logs. Also add an error message and print it to the user in case that the plugin failure was caused by a plugin version mismatch. * server/wasm_vm: Restore panic on failure to load plugins. * server/wasm_vm: Add fix to plugin mismatch error * server/panes/plugin_pane: Hint to logs when failing to receive a message from the plugins for rendering pane contents.
2022-10-20fix(command): better error when command not found (#1829)Aram Drevekenin
* fix(command): better error when command not found * fix(cli): open edit file from current cwd * style(fmt): rustfmt?
2022-10-20feat(layouts): allow defining a tab cwd (#1828)Aram Drevekenin
2022-10-19allow dump_screen() to only dump the viewport (#1794)Dan Näsman
* allow dump_screen() to only dump the viewport * add additional implementations * set full default as false
2022-10-19chore(deps): upgrade log4rs (#1814)Aram Drevekenin
2022-10-17feat(cli): zellij run improvements (#1804)Aram Drevekenin
* feat(cli): move command to the end of the cli arguments * feat(cli): allow naming panes from the command line * fix(cli): adjust actions after pane rename * feat(cli): zellij run completions for fish * feat(cli): zellij run completions for bash and zsh * style(fmt): rustfmt * fix(e2e): fix run test and snapshot * style(fmt): rustfmt
2022-10-17Log `thread_bus` IPC messages only in debug mode (#1800)har7an
* zellij: Add global `DEBUG_MODE` variable that tells us whether zellij was started with the `--debug` CLI flag. * utils/errors: Only log thread_bus message in debug mode, and discard the message otherwise. * utils/logging: Increase logsize to 16 MiB per logfile, totaling 32 MiB of logs at most (in two files). * zellij: Set global `DEBUG` variable in server thread and make sure the value of the `--debug` CLI flag is propagated to the server, too. This means that to enable debug mode, the server must be started with the `--debug` flag. This happens when the first client that starts the zellij session has the `--debug` flag set, because it will be forwarded to the server. Subsequent clients attaching to the same session with the `--debug` flag specified **do not** override the value of the `DEBUG` variable. Hence, if the server wasn't started in debug mode, this cannot be changed.
2022-10-14feat(layouts): edit panes (#1799)Aram Drevekenin
* feat(layouts): edit panes * style(fmt): rustfmt
2022-10-14feat(layouts): global cwd (#1798)Aram Drevekenin
* feat(layouts): allow defining a global cwd * feat(layouts): allow passing global cwd from cli * style(fmt): rustfmt * fix(layouts): error on mixed cwd and pane children
2022-10-13fix(layouts): various kdl layout issues and features (#1797)Aram Drevekenin
* fix(layouts): error on non-bare children node * refactor(layout): consolidate split direction parsing * refactor(layout): remove unused import * fix(layouts): log error when there is no room for layout * fix(layout): error on size 0 * feat(layouts): allow pane templates to override template command attributes * style(fmt): rustfmt
2022-10-12fix(cli): use provided session-name (#1793)Aram Drevekenin
2022-10-12fix(layouts): duplicate layout definition error (#1792)Aram Drevekenin
* fix(layouts): error on duplicate definitions * style(fmt): rustfmt
2022-10-12fix(layouts): error on mixed nodes (#1791)Aram Drevekenin
* fix(layouts): error on mixed nodes * style(fmt): rustfmt * style(clippy): make clippy happy
2022-10-11feat(ux): rerun command pane (#1787)Aram Drevekenin
* 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 * get command panes not to exit on command exit * separate terminal pane_ids from raw_fds * render frame according to exit status * re-run command on enter and close pane on ctrl-c * proper error when command is not found * make ui nicer * initial pane title for command panes * fix pane override bug * reap terminal_ids from os_input_output on pane close * bool floating flag * some ui tweaks * fix tests * make rustfmt happy * e2e test for command pane * fix various concurrency issues * rename command to run in the cli * rustfmt * style(fmt): rustfmt * fix(e2e): command => run * fix(e2e): command => run in snapshot too!
2022-10-07zellij-server: improve thread_bus error handling (#1775)Bohdan Ivashko
* zellij-server: improve thread_bus error handling * zellij-server/thread_bus: get rid of option.unwrap * zellij-utils/errors.rs: generic error in to_anyhow
2022-10-06Server: Remove `panic`s in `tab` module (#1748)har7an
* utils/errors: Add `ToAnyhow` trait for converting `Result` types that don't satisfy `anyhow`s trait constraints (`Display + Send + Sync + 'static`) conveniently. An example of such a Result is the `SendError` returned from `send_to_plugins`, which sends `PluginInstruction`s as message type. One of the enum variants can contain a `mpsc::Sender`, which is `!Sync` and hence makes the whole `SendError` be `!Sync` in this case. Add an implementation for this case that takes the message and converts it into an error containing the message formatted as string, with the additional `ErrorContext` as anyhow context. * server/tab: Remove calls to `unwrap()` and apply error reporting via `anyhow` instead. Make all relevant functions return `Result`s where previously a panic could occur and attach error context. * server/screen: Modify `update_tab!` to accept an optional 4th parameter, a literal "?". If present, this will append a `?` to the given closure verbatim to handle/propagate errors from within the generated macro code. * server/screen: Handle new `Result`s from `Tab` and apply appropriate error context and propagate errors further up. * server/tab/unit: `unwrap` on new `Result`s * server/unit: Unwrap `Results` in screen tests * server/tab: Better message for ad-hoc errors created with `anyhow!`. Since these errors don't have an underlying cause, we describe the cause in the macro instead and then attach the error context as usual before `?`ing the error back up. * utils/cargo: Activate `anyhow`s "backtrace" feature to capture error backtraces at the error origins (i.e. where we first receive an error and convert it to a `anyhow::Error`). Since we propagate error back up the call stack now, the place where we `unwrap` on errors doesn't match the place where the error originated. Hence, the callstack, too, is quite misleading since it contains barely any references of the functions that triggered the error. As a consequence, we have 2 backtraces now when zellij crashes: One from `anyhow` (that is implicitly attached to anyhows error reports), and one from the custom panic handler (which is displayed through `miette`). * utils/errors: Separate stack traces in the output of miette. Since we record backtraces with `anyhow` now, we end up having two backtraces in the output: One from the `anyhow` error and one from the actual call to `panic`. Adds a comment explaining the situation and another "section" to the error output of miette: We print the backtrace from anyhow as "Stack backtrace", and the output from the panic handler as "Panic backtrace". We keep both for the (hopefully unlikely) case that the anyhow backtrace isn't existent, so we still have at least something to work with. * server/screen: Remove calls to `fatal` and leave the `panic`ing to the calling function instead. * server/screen: Remove needless macro which extended `active_tab!` by passing the client IDs to the closure. However, this isn't necessary because closures capture their environment already, and the client_id needn't be mutable. * server/screen: Handle unused result * server/screen: Reintroduce arcane macro that defaults to some default client_id if it isn't valid (e.g. when the ScreenInstruction is sent via CLI). * server/tab/unit: Unwrap new results
2022-10-05feat(config): switch to kdl (#1759)Aram Drevekenin
* 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-09-27Add docs about error handling (#1745)har7an
* docs: Add ERROR_HANDLING that explains how we plan to change error handling in zellij and invites new contributors to join the fun. Details the currently existent error handling capabilities and gives a bunch of examples taken from #1670. * utils/errors: Shorten docblock by moving previous content under "Help Wanted" to the new `docs/ERROR_HANDLING` document and link to the document instead.
2022-09-09Feature: Better error handling/reporting (#1670)har7an
* utils: re-export "anyhow" unconditionally even for wasm targets. * utils/errors: Share wasm-compatible code and move everything that can't run in wasm into a separate submodule. * utils: Share "errors" module unconditionally The module is now structured such that all code incompatible with wasm targets lives in its own submodule that isn't included when compiling for wasm targets. * utils/errors: Add "Help wanted" doc section that informs the reader about the endeavour to improve error handling throughout the zellij code base. * plugins: Handle errors returned by `zellij_tile` now that the panic calls have been removed. * utils/errors: Extend `anyhow::Result` with traits that allow for easy/concise logging of `anyhow::Result` types and panicking the application when they are fatal or non-fatal. * utils/errors: Fix doctest * utils/errors: Add prelude that applications can import to conveniently access the error handling functionality part of the module. Re-exports some parts and macros from anyhow and the `LoggableError` and `FatalError` traits. * server/screen: Adopt error handling and make all fallible functions from the public API return a `Result`. Append error contexts in all functions that can come across error types to allow tracing where an error originates and what lead there. * server/lib: Catch errors from `screen` and make them `fatal`. This will log the errors first, before unwrapping on the error type and panicking the application. * server/unit/screen: Fix unit tests and unwrap on the `Result` types introduced from the new error handling. * utils/errors: Track error source in calls to `fatal`, so we keep track of the location where the panic really originates. Otherwise, any call to `fatal` will show the code in `errors` as source, which of course isn't true. Also change the error formatting and do not call `to_log` for fatal errors anymore, because the panic is already logged and contains much more information. * utils/errors: Update `FatalError` docs * plugins: Undo accidental modifications * utils/errors: Improve module docs explain some error handling facilities and the motivation behind using them. * server/screen: Remove `Result` from Infallible functions that are part of the public API.
2022-09-09chore(version): bump development versionAram Drevekenin
2022-09-09chore(release): v0.31.4v0.31.4Aram Drevekenin
2022-09-03fix osc params 1024 byte limit (#1711)Thomas Linford
* update vte to v0.11.0, and turn off it's default-features * vte's default includes no_std, and in that case the osc params buffer is capped at 1024 bytes * add changelog entry
2022-09-02fix(router): gracefully handle client crashes (#1710)Aram Drevekenin
* fix(router): gracefully handle client crashes * style(comments): remove unused
2022-08-18chore(version): bump development versionAram Drevekenin
2022-08-18chore(release): v0.31.3v0.31.3Aram Drevekenin
2022-08-17chore(version): bump development versionAram Drevekenin
2022-08-17chore(release): v0.31.2v0.31.2Aram Drevekenin
2022-08-17fix(terminal): SGR/UTF8 mouse reporting in terminal panes (#1664)Aram Drevekenin
* work * work * fix: selection mishandling * style(fmt): rustfmt * style(comments): remove outdated * style(clippy): make clippy happy * fix(mouse): off by one sgr/utf8 reporting * style(fmt): rustfmt * fix(mouse): correctly report drag event code * fix(input): support mouse middle click * style(fmt): rustfmt
2022-08-02chore(version): bump development versionAram Drevekenin
2022-08-02chore(release): v0.31.1v0.31.1Aram Drevekenin
2022-08-02fix: theme not loading without config (#1631)Jae-Heon Ji
2022-07-28chore(version): bump development versionAram Drevekenin
2022-07-27fix(status-bar): reflect actual current keybindings (#1242)har7an
* 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. * ut