* docs: Improve error handling docs
and add more TL;DRs and new sections about handling specific errors, and
logging errors.
* contributing: Add more coding tips
* cargo: Don't strip release binary
because the lack of debug symbols makes the panic backtrace completely
useless. It will show a long list of unknown locations then.
Except for a minor space saving of 3-4 MB, debug symbols don't have any
negative side-effects for our application that we're aware of.
* changelog: Add PR #1916
Don't strip debug symbols from release binaries so the backtraces
contain the function names involved.
* cargo: Explicitly keep debug symbols
and add a comment explaining why.
* utils/input/plugins: Return `Result` when loading
a plugin and failing to find it. Since we look up the plugin in multiple
locations, make sure we preserve each of these lookup failures and
report them to the user. This way the user can see what locations were
actually checked.
In addition, before performing the lookup, deduplicate the array of
locations to check. This prevents errors where we look up the same
plugin multiple times in the exact same locations, which can leave a bad
impression on anyone reading it who isn't familiar with the code.
* server/wasm_vm: Remove obsolete context
which was previouly required because the function it is attached to
returned only an `Option` instead of a `Result`.
- Alt-hjkl for pane movements everywhere
- faster pane creation in pane mode with hjkl
- add space to exit mode, if it does not break workflow
- dense: only 127 LOC keybindings, 7 LOC general config
- comment-heavy (for potential useful things): 61 LOC comments
* Fix bat syntax colors when using mosh
Original reason for this line according to Aram:
I set this variable as part of the Sixel support to get notcurses to
work properly. I tried communicating with the notcurses maintainers
about a workaround for this, but to no avail.
* Changelog
* Improve changelog message
* Remove empty function
* 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.
* Fixing YAML => KDL conversion with backslash hotkey.
Previously if the hotkey of backslash was used the yaml => kdl
conversion would create a KDL statement like so: `bind "\" {...}`.
That is incorrect kdl syntax since the backslash escapes the following
quote character. A way to get proper KDL is `bind r"\" {...}`. This
commit changes if the old HotKey is a backslash a properly creates KDL
syntax to address the backslash character.
* rustfmt
* 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
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.