Commit Graph

2069 Commits

Author SHA1 Message Date
Aram Drevekenin
a13aacf583
fix(layouts): error on mixed nodes (#1791)
* fix(layouts): error on mixed nodes

* style(fmt): rustfmt

* style(clippy): make clippy happy
2022-10-12 13:03:21 +02:00
Thomas Linford
694afd2239
fix(tab): frameless pane size wrong after closing other panes (#1776)
always recompute pane frames after closing a pane
2022-10-12 11:29:17 +02:00
Aram Drevekenin
46dd8d4473
docs(changelog): escapes when converting configs 2022-10-12 10:50:14 +02:00
Aram Drevekenin
60ffd58b1e
fix(converter): escape quotes (#1790) 2022-10-12 10:49:12 +02:00
Aram Drevekenin
f6fa521313
docs(changelog): command pane 2022-10-11 16:46:55 +02:00
Aram Drevekenin
c64bf5207a
feat(ux): rerun command pane (#1787)
* 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-11 16:45:46 +02:00
har7an
cb926119bc
changelog: Add PR 1775
which improves error formatting in `server/thread_bus` and removes calls to `unwrap`, too.
2022-10-07 10:00:08 +00:00
Bohdan Ivashko
39f33a9a9a
zellij-server: improve thread_bus error handling (#1775)
* 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-07 09:04:08 +00:00
har7an
bc04983f06
changelog: Add pull 1748
which removes calls to `unwrap` in `zellij_server::tab`.
2022-10-06 06:54:47 +00:00
har7an
6715f4629c
Server: Remove panics in tab module (#1748)
* 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-06 06:46:18 +00:00
Aram Drevekenin
46edc590ec
docs(changelog): switch config/layout/theme language to KDL 2022-10-05 07:45:43 +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
a-kenji
917e9b2ff0 docs(changelog): add darwin dependencies 2022-10-04 12:24:17 +02:00
Mayeul d'Avezac
55cd26b278
fix(nix) missing frameworks on darwin (#1724) 2022-10-04 12:23:04 +02:00
har7an
9135eceac1
changelog: mention PR 1770
to improve error handling in screen thread private functions
2022-10-04 09:45:36 +00:00
Bohdan Ivashko
5fede55fbd
zellij-server/src/screen: improve error handling (#1770)
* zellij-server/src/screen: improve error handling

* cleanup context vs with_context usage

* update error handling docs

* zellij-server/src/screen.rs: fix formatting
2022-10-04 09:09:32 +00:00
a-kenji
716f606b44 update: update-rust-toolchain v1 -> v1.1 2022-10-01 13:50:35 +02:00
a-kenji
9823d1fe88
flake.lock: Update (#1761)
Flake lock file updates:

• Updated input 'crate2nix':
    'github:kolloch/crate2nix/198de9f237cb97ad32e0da7fb914b8e8d9fd87b7' (2022-08-29)
  → 'github:kolloch/crate2nix/17e34c0cf12baaa61abcd00dfecdbde96cef252f' (2022-09-28)
• Updated input 'nixpkgs':
    'github:nixos/nixpkgs/97747d3209efde533f7b1b28f1be11619f556a06' (2022-08-31)
  → 'github:nixos/nixpkgs/854fdc68881791812eddd33b2fed94b954979a8e' (2022-09-28)
• Updated input 'rust-overlay':
    'github:oxalica/rust-overlay/790cf08a011248a881a516cadf125bbc47f1a420' (2022-08-31)
  → 'github:oxalica/rust-overlay/fa6d41ac91f44ce9a90ca08e7a3ff5abf88e77a1' (2022-09-30)

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2022-10-01 11:15:50 +02:00
dependabot[bot]
f5efb0d731
build(deps): bump DeterminateSystems/update-flake-lock from 13 to 14 (#1762)
Bumps [DeterminateSystems/update-flake-lock](https://github.com/DeterminateSystems/update-flake-lock) from 13 to 14.
- [Release notes](https://github.com/DeterminateSystems/update-flake-lock/releases)
- [Commits](https://github.com/DeterminateSystems/update-flake-lock/compare/v13...v14)

---
updated-dependencies:
- dependency-name: DeterminateSystems/update-flake-lock
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-10-01 10:05:25 +02:00
har7an
e7bce6a106
Add docs about error handling (#1745)
* 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-27 07:28:09 +00:00
har7an
77f05f0f12
Fix: issue 1734 (#1749)
* server/tab: Check suppressed panes

when writing to a pane by ID. Previously only the tiled and floating
panes would be searched for a pane of a given ID.

Fixes: #1734

* server/tab/unit: Test writing to suppressed panes

* docs: fix server panics when writing to suppressed panes
2022-09-23 05:28:35 +00:00
Thomas Linford
480086e3d4
test: simplify tab integration tests (#1728)
* wip

* refactor existing tests

* rename methods
2022-09-15 20:35:36 +02:00
raphCode
65d12c4b9b
Don't send the server an exit signal when client panics (#1731)
* Don't send the server an exit signal when client crashes

* Update changelog
2022-09-14 17:33:46 +02:00
har7an
31d741263c
docs(changelog): error handling in screen 2022-09-09 13:40:41 +00:00
har7an
99e2bef8c6
Feature: Better error handling/reporting (#1670)
* 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-09 13:21:03 +00:00
Aram Drevekenin
3f43a057cb chore(version): bump development version 2022-09-09 13:38:22 +02:00
Aram Drevekenin
a28d905d84 chore(release): v0.31.4 2022-09-09 13:00:24 +02:00
Aram Drevekenin
41b27d011b
docs(changelog): multiple users ui-cursor fix 2022-09-09 12:32:14 +02:00
Aram Drevekenin
d5764fb225
fix(ui): sort multiple ui cursors (#1719)
* fix(ui): stable-sort multiple ui cursors

* style(clippy): make clippy happy
2022-09-09 12:30:58 +02:00
Aram Drevekenin
4d1ecabdbf
docs(changelog): tab-bar mouseclick fix 2022-09-09 09:49:35 +02:00
Paulo Coelho
b9e57cfdad
fix(tab-bar): mouse-click in simplified-ui (#1658)
* fix(tab-bar): fix tab bar click when tabs are collapsed

* fix(tab-bar): calculate tab length correctly for any separator

* fix(tab-bar): fix clippy
2022-09-09 09:48:02 +02:00
Thomas Linford
ebbd46ea3b
feat(compatibility): mouse wheel faux scrolling in alternate screen (#1678)
* implement faux scrolling

* update changelog

* fix tests

* cursor keys mode handling

* add integration test

* undo changelog reformatting
2022-09-04 16:26:15 +02:00
a-kenji
84e14d1479
flake.lock: Update (#1703)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2022-09-03 23:09:45 +02:00
Thomas Linford
a58a5ca769
fix osc params 1024 byte limit (#1711)
* 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-03 20:11:56 +02:00
Aram Drevekenin
28a002929a
docs(template): mention stty size in bug recreation 2022-09-02 16:23:53 +02:00
Aram Drevekenin
ccf9201d5f
docs(changelog): fix empty bullet 2022-09-02 15:33:24 +02:00
Aram Drevekenin
857fc93c50
docs(changelog): client crash recovery 2022-09-02 15:32:36 +02:00
Aram Drevekenin
d68d407d26
fix(router): gracefully handle client crashes (#1710)
* fix(router): gracefully handle client crashes

* style(comments): remove unused
2022-09-02 15:30:43 +02:00
Aram Drevekenin
93f0f783b8
docs(changelog): startup router race 2022-09-02 10:22:22 +02:00
Aram Drevekenin
b17f73bf08
fix(router): startup race (#1706)
* fix(router): retry messages when server is not ready for all startup signals

* style(fmt): rustfmt
2022-09-02 10:21:09 +02:00
Thomas Linford
533a19c26b
docs(changelog): bracketed paste fix 2022-08-24 20:07:15 +02:00
Thomas Linford
553a9bbe4f
fix: bracketed paste input not getting adjusted properly (#1689)
* fix bracketed paste input not getting adjusted properly

* add regression test

* readd deleted comment
2022-08-24 20:05:59 +02:00
dependabot[bot]
c71e16916f
build(deps): bump DeterminateSystems/update-flake-lock from 12 to 13 (#1683)
Bumps [DeterminateSystems/update-flake-lock](https://github.com/DeterminateSystems/update-flake-lock) from 12 to 13.
- [Release notes](https://github.com/DeterminateSystems/update-flake-lock/releases)
- [Commits](https://github.com/DeterminateSystems/update-flake-lock/compare/v12...v13)

---
updated-dependencies:
- dependency-name: DeterminateSystems/update-flake-lock
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-08-23 08:26:31 +02:00
Aram Drevekenin
54602e0308
chore(ci): change dependabot frequency 2022-08-22 09:16:00 +02:00
Aram Drevekenin
b5a781351f
docs(changelog): improve vttest compliance 2022-08-19 14:01:38 +02:00
Autumn
a316577d1e
fix(compatibility): improve vttest (#1671)
* Improve 'vttest' scenarios:

1. Report terminal as VT220 with sixel rather than VT400 family with
   sixel. This fixes a hang when launching vttest as it is waiting for
   a response to DECRQSS.

2. Test 6.2: Support NewLine mode (CR --> CRLF).

3. Test 6.3: Fix DSR cursor position report to honor scrolling region.

4. Test 6.7: Parse and respond to DECREQTPARM (Request Terminal
   Parameters - CSI x).  This is a VT100 sequence that xterm used to
   respond to always, but more recently only responds to when
   explicitly set to VT100 level.

* cargo fmt

* Fix failing unit test snapshot

* fix clippy error

* VT100 UK character set
2022-08-19 14:00:26 +02:00
Aram Drevekenin
639de16c5e chore(version): bump development version 2022-08-18 09:30:12 +02:00
Aram Drevekenin
588167f38e chore(release): v0.31.3 2022-08-18 08:55:21 +02:00
Aram Drevekenin
94669fc930 HOTFIX: report up arrow correctly 2022-08-18 00:58:29 +02:00
Aram Drevekenin
ac8a9d4b28 chore(version): bump development version 2022-08-17 11:46:46 +02:00