Commit graph

2690 commits

Author SHA1 Message Date
Aidan Hobson Sayers
96b70e688e
fix(terminal): some real/saved cursor bugs during resize (#3032)
* refactor: Simplify transfer_rows_from_viewport_to_lines_above

next_lines is always consolidated to a single Row, which immediately
gets removed - we can remove some dead code as a result

* perf: Batch remove rows from the viewport for performance

Given a 1MB line catted into the terminal, a toggle-fullscreen +
toggle-fullscreen + close-pane + `run true` goes from ~9s to ~3s

* perf: Optimize Row::drain_until by splitting chars in one step

Given a 10MB line catted into the terminal, a toggle-fullscreen +
toggle-fullscreen + close-pane + `run true` goes from ~23s to ~20s

* refactor: Simplify `if let` into a `.map`

* refactor: There are only new saved coordinates when there were old ones

* refactor: Unify viewport transfer: use common variable names

* fix: Use same saved cursor logic in height resize as width

See #2182 for original introduction that only added it in one branch,
this fixes an issue where the saved cursor was incorrectly reset when
the real cursor was

* fix: Correct saved+real cursor calculations when reflowing long lines

* fix: Don't create canonical lines if cursor ends on EOL after resize

Previously if a 20 character line were split into two 10 character
lines, the cursor would be placed on the line after the two lines.
New characters would then be treated as a new canonical line. This
commit fixes this by biasing cursors to the end of the previous line.

* fix: for cursor index calculation in lines that are already wrapped

* chore: test for real/saved cursor position being handled separately

* chore: Apply cargo format

* chore(repo): update issue templates

* Bump rust version to 1.75.0 (#3039)

* rust-toolchain: Bump toolchain version to 1.69.0

which, compared to the previous 1.67.0, has the following impacts on
`zellij`:

- [Turn off debuginfo for build deps][2]: Increases build time (on my
  machine) from ~230 s in 1.67.0 to ~250 s now, *which is unexpected*

This version also changes [handling of the `default-features` flag][3]
when specifying dependencies in `Cargo.toml`. If a dependent crate
requires `default-features = true` on a crate that is required as
`default-features = false` further up the dependency tree, the `true`
setting "wins". We only specify `default-features = false` for three
crates total:

- `names`: This is used only by us
- `surf`: This is used only by us
- `vte`: This is also required by `strip-ansi-escapes`, but that has
  `default-features = false` as well

How this affects our transitive dependencies is unknown at this point.

[2]: https://github.com/rust-lang/cargo/pull/11252/
[3]: https://github.com/rust-lang/cargo/pull/11409/

* rust-toolchain: Bump toolchain version to 1.70.0

which, compared to the previous 1.69.0, as the following impacts on
`zellij`:

1. [Enable sparse registry checkout for crates.io by default][1]

This drastically increases the time to first build on a fresh rust
installation/a rust installation with a clean cargo registry cache.
Previously it took about 75s to populate the deps/cache (with `cargo
fetch --locked` and ~100 MBit/s network), whereas now the same process
takes ~10 s.

2. [The `OnceCell` type is now part of std][2]

In theory, this would allow us to cut a dependency from `zellij-utils`,
but the `once_cell` crate is pulled in by another 16 deps, so there's no
point in attempting it right now.

Build times and binary sizes are unaffected by this change compared to
the previous 1.69.0 toolchain.

[1]: https://github.com/rust-lang/cargo/pull/11791/
[2]: https://doc.rust-lang.org/stable/std/cell/struct.OnceCell.html

* rust-toolchain: Bump toolchain version to 1.75.0

which, compared to the previous 1.70.0, has the following impacts on
`zellij`:

1. [cross-crate inlining][8]

This should increase application performance, as functions can now be
inlined across crates.

2. [`async fn` in traits][9]

This would allow us to drop the `async_trait` dependency, but it is
currently still required by 3 other dependencies.

Build time in debug mode (on my own PC) is cut down from 256s to 189s
(for a clean build). Build time in release mode is cut down from 473s to
391s (for a clean build). Binary sizes only change minimally (825 MB ->
807 MB in debug, 29 MB -> 30 MB in release).

[8]: https://github.com/rust-lang/rust/pull/116505
[9]: https://github.com/rust-lang/rust/pull/115822/

* chore: Apply rustfmt.

* CHANGELOG: Add PR #3039.

* feat(plugins): introduce 'pipes', allowing users to pipe data to and control plugins from the command line (#3066)

* prototype - working with message from the cli

* prototype - pipe from the CLI to plugins

* prototype - pipe from the CLI to plugins and back again

* prototype - working with better cli interface

* prototype - working after removing unused stuff

* prototype - working with launching plugin if it is not launched, also fixed event ordering

* refactor: change message to cli-message

* prototype - allow plugins to send messages to each other

* fix: allow cli messages to send plugin parameters (and implement backpressure)

* fix: use input_pipe_id to identify cli pipes instead of their message name

* fix: come cleanups and add skip_cache parameter

* fix: pipe/client-server communication robustness

* fix: leaking messages between plugins while loading

* feat: allow plugins to specify how a new plugin instance is launched when sending messages

* fix: add permissions

* refactor: adjust cli api

* fix: improve cli plugin loading error messages

* docs: cli pipe

* fix: take plugin configuration into account when messaging between plugins

* refactor: pipe message protobuf interface

* refactor: update(event) -> pipe

* refactor - rename CliMessage to CliPipe

* fix: add is_private to pipes and change some naming

* refactor - cli client

* refactor: various cleanups

* style(fmt): rustfmt

* fix(pipes): backpressure across multiple plugins

* style: some cleanups

* style(fmt): rustfmt

* style: fix merge conflict mistake

* style(wording): clarify pipe permission

* docs(changelog): introduce pipes

* fix: add some robustness and future proofing

* fix e2e tests

---------

Co-authored-by: Aram Drevekenin <aram@poor.dev>
Co-authored-by: har7an <99636919+har7an@users.noreply.github.com>
2024-01-22 09:35:14 +01:00
har7an
592cabeda8
xtask: Disable pusing during publish (#3040)
* xtask: Add `--no-push` flag to `publish`

which can be used when simulating releases to work without a writable
git fork of the zellij code.

* xtask: Fix borrow issues

* xtask/pipe: Require lockfile in publish

to avoid errors from invalid dependency versions.

* CHANGELOG: Add PR #3040.
2024-01-20 12:47:21 +00:00
Aidan Hobson Sayers
ed8ca9383e
performance(terminal): improvements to reflow performance by removing O(n^2) behavior (#3045)
* refactor: Simplify transfer_rows_from_viewport_to_lines_above

next_lines is always consolidated to a single Row, which immediately
gets removed - we can remove some dead code as a result

* perf: Batch remove rows from the viewport for performance

Given a 1MB line catted into the terminal, a toggle-fullscreen +
toggle-fullscreen + close-pane + `run true` goes from ~9s to ~3s

* perf: Optimize Row::drain_until by splitting chars in one step

Given a 10MB line catted into the terminal, a toggle-fullscreen +
toggle-fullscreen + close-pane + `run true` goes from ~23s to ~20s
2024-01-18 10:32:11 +01:00
Aram Drevekenin
ba43a4cbc0
docs(changelog): introduce pipes 2024-01-17 12:12:08 +01:00
Aram Drevekenin
d780bd9105
feat(plugins): introduce 'pipes', allowing users to pipe data to and control plugins from the command line (#3066)
* prototype - working with message from the cli

* prototype - pipe from the CLI to plugins

* prototype - pipe from the CLI to plugins and back again

* prototype - working with better cli interface

* prototype - working after removing unused stuff

* prototype - working with launching plugin if it is not launched, also fixed event ordering

* refactor: change message to cli-message

* prototype - allow plugins to send messages to each other

* fix: allow cli messages to send plugin parameters (and implement backpressure)

* fix: use input_pipe_id to identify cli pipes instead of their message name

* fix: come cleanups and add skip_cache parameter

* fix: pipe/client-server communication robustness

* fix: leaking messages between plugins while loading

* feat: allow plugins to specify how a new plugin instance is launched when sending messages

* fix: add permissions

* refactor: adjust cli api

* fix: improve cli plugin loading error messages

* docs: cli pipe

* fix: take plugin configuration into account when messaging between plugins

* refactor: pipe message protobuf interface

* refactor: update(event) -> pipe

* refactor - rename CliMessage to CliPipe

* fix: add is_private to pipes and change some naming

* refactor - cli client

* refactor: various cleanups

* style(fmt): rustfmt

* fix(pipes): backpressure across multiple plugins

* style: some cleanups

* style(fmt): rustfmt

* style: fix merge conflict mistake

* style(wording): clarify pipe permission
2024-01-17 12:10:49 +01:00
har7an
f6d57295a0
Bump rust version to 1.75.0 (#3039)
* rust-toolchain: Bump toolchain version to 1.69.0

which, compared to the previous 1.67.0, has the following impacts on
`zellij`:

- [Turn off debuginfo for build deps][2]: Increases build time (on my
  machine) from ~230 s in 1.67.0 to ~250 s now, *which is unexpected*

This version also changes [handling of the `default-features` flag][3]
when specifying dependencies in `Cargo.toml`. If a dependent crate
requires `default-features = true` on a crate that is required as
`default-features = false` further up the dependency tree, the `true`
setting "wins". We only specify `default-features = false` for three
crates total:

- `names`: This is used only by us
- `surf`: This is used only by us
- `vte`: This is also required by `strip-ansi-escapes`, but that has
  `default-features = false` as well

How this affects our transitive dependencies is unknown at this point.

[2]: https://github.com/rust-lang/cargo/pull/11252/
[3]: https://github.com/rust-lang/cargo/pull/11409/

* rust-toolchain: Bump toolchain version to 1.70.0

which, compared to the previous 1.69.0, as the following impacts on
`zellij`:

1. [Enable sparse registry checkout for crates.io by default][1]

This drastically increases the time to first build on a fresh rust
installation/a rust installation with a clean cargo registry cache.
Previously it took about 75s to populate the deps/cache (with `cargo
fetch --locked` and ~100 MBit/s network), whereas now the same process
takes ~10 s.

2. [The `OnceCell` type is now part of std][2]

In theory, this would allow us to cut a dependency from `zellij-utils`,
but the `once_cell` crate is pulled in by another 16 deps, so there's no
point in attempting it right now.

Build times and binary sizes are unaffected by this change compared to
the previous 1.69.0 toolchain.

[1]: https://github.com/rust-lang/cargo/pull/11791/
[2]: https://doc.rust-lang.org/stable/std/cell/struct.OnceCell.html

* rust-toolchain: Bump toolchain version to 1.75.0

which, compared to the previous 1.70.0, has the following impacts on
`zellij`:

1. [cross-crate inlining][8]

This should increase application performance, as functions can now be
inlined across crates.

2. [`async fn` in traits][9]

This would allow us to drop the `async_trait` dependency, but it is
currently still required by 3 other dependencies.

Build time in debug mode (on my own PC) is cut down from 256s to 189s
(for a clean build). Build time in release mode is cut down from 473s to
391s (for a clean build). Binary sizes only change minimally (825 MB ->
807 MB in debug, 29 MB -> 30 MB in release).

[8]: https://github.com/rust-lang/rust/pull/116505
[9]: https://github.com/rust-lang/rust/pull/115822/

* chore: Apply rustfmt.

* CHANGELOG: Add PR #3039.
2024-01-08 16:56:01 +00:00
Aram Drevekenin
b3397ccbd0
chore(repo): update issue templates 2023-12-28 16:46:14 +01:00
Jae-Heon Ji
0b32c7e169
docs(changelog): improve plugin perf 2023-12-13 01:23:19 +09:00
Jae-Heon Ji
b3035fc2d7
perf: improve plugin download & load feature (#3001) 2023-12-13 01:21:32 +09:00
Aram Drevekenin
6a1baaf0d6
fix(template): close comment 2023-12-06 20:22:00 +01:00
Aram Drevekenin
468b75ccec
docs(repo): feature request template 2023-12-06 20:20:34 +01:00
Aram Drevekenin
6cd2c7eca4
docs(repo): update issue templates 2023-12-06 20:07:21 +01:00
Aram Drevekenin
5eacf0bb50
docs(repo): update issue templates 2023-12-06 19:58:34 +01:00
Aram Drevekenin
6370a897ed
docs(changelog): synchronized renders 2023-12-02 17:05:22 +01:00
Aram Drevekenin
ecd5e3c453
feat(terminal): implement synchronized renders (#2977) 2023-12-02 17:04:12 +01:00
Aram Drevekenin
d8bbe9115e
docs(changelog): plugin errors 2023-12-01 19:10:52 +01:00
Aram Drevekenin
ac47ff43a3
fix(plugins): display errors properly (#2975)
* fix(plugins): format errors and make sure file not found errors appear

* style(fmt): rustfmt
2023-12-01 19:10:13 +01:00
Felix Yan
3aa72ba5fe
docs: Update Arch Linux package URL in THIRD_PARTY_INSTALL.md (#2956)
The old URL returns 404 now.
2023-12-01 18:51:32 +01:00
Aram Drevekenin
6e250b89a3
docs(changelog): flaky grid scroll fix 2023-11-30 18:22:29 +01:00
pierce
b221e472ca
fix: fix flakey scroll history (#2935)
* fix: fix flakey scroll history

Signed-off-by: xuanyuan300 <xuanyuan300@gmail.com>

* fix: add assertion line

Signed-off-by: xuanyuan300 <xuanyuan300@gmail.com>

* Update e2e.yml

* Update e2e.yml

---------

Signed-off-by: xuanyuan300 <xuanyuan300@gmail.com>
2023-11-30 18:21:22 +01:00
Aram Drevekenin
f46a516057
docs(changelog): grid fixes 2023-11-30 18:17:43 +01:00
Aram Drevekenin
6c20ba9d03
fix(grid): various crashes (#2972)
* fix(grid): various crashes

* style(fmt): rustfmt
2023-11-30 18:16:26 +01:00
Aram Drevekenin
7c841251f6
docs(changelog): skip plugin cache flag 2023-11-30 18:11:40 +01:00
Aram Drevekenin
b0f36540fe
feat(plugins): skip plugin cache flag (#2971)
* feat(plugins): allow explicitly skipping the plugin cache when loading

* style(fmt): rustfmt

* fix tests
2023-11-30 18:10:50 +01:00
Aram Drevekenin
65bea269a4 chore(version): bump development version 2023-11-29 13:13:23 +01:00
Aram Drevekenin
037effd54c
docs(changelog): update release date 2023-11-29 12:33:44 +01:00
Aram Drevekenin
d9b956bc40 chore(release): v0.39.2 2023-11-29 11:46:21 +01:00
Aram Drevekenin
8e2d37e141 chore(version): bump to 0.39.2 2023-11-29 11:41:59 +01:00
Jae-Heon Ji
42af4c5103
docs(changelog): fix compiler warnings 2023-11-29 14:36:05 +09:00
rmsyn
4a351e22be
fixup: zellij-server: fix compiler warnings (#2873)
* fixup: zellij-server: fix compiler warnings

Fixes compiler warnings about variables not being read before being
reassigned a value, and an unused variable.

Removes unnecessary intermediate local variables.

* style(fmt): rustfmt

---------

Co-authored-by: Jae-Heon Ji <atx6419@gmail.com>
2023-11-29 14:34:36 +09:00
Aram Drevekenin
9a38ad2e15
docs(changelog): fix link 2023-11-19 11:03:14 +01:00
Aram Drevekenin
b0172adf25
docs(changelog): slow session-manager update 2023-11-19 11:02:28 +01:00
Aram Drevekenin
d84201aefa
fix(sessions): untie serialization interval from session read interval (#2951) 2023-11-19 11:01:11 +01:00
Jae-Heon Ji
931e11f996
docs(changelog): fix typo 2023-11-14 00:23:21 +09:00
wendrul
ff80e7ed24
Fix typo in help page (#2906) 2023-11-14 00:20:10 +09:00
Aram Drevekenin
c33f5b6cc6 chore(version): bump development version 2023-11-13 10:17:12 +01:00
Aram Drevekenin
ebcf35989a chore(release): v0.39.1 2023-11-13 08:51:24 +01:00
Aram Drevekenin
4756c2125c
docs(changelog): plugin reload 2023-11-11 11:52:13 +01:00
Aram Drevekenin
45fea5817e
fix(plugins): reloading plugin after crash (#2929) 2023-11-11 11:50:58 +01:00
Aram Drevekenin
cb46ac0b12
docs(changelog): serialization interval 2023-11-10 14:17:20 +01:00
Aram Drevekenin
3b4a355f0d
feat(config): add serialization interval configuration (#2923)
* add serialization interval configuration

* fix e2e tests

* fix e2e tests
2023-11-10 14:16:02 +01:00
Aram Drevekenin
e55cd36b53
docs(changelog): command panes CWD 2023-11-09 10:46:29 +01:00
Diego Alonso
261c75ab92
feat(panes): reuse CWD when dropping to shell in command panes (#2915) 2023-11-09 10:45:48 +01:00
Aram Drevekenin
83cf6d6e7c
docs(changelog): CPU utilization fix 2023-11-09 09:42:13 +01:00
pierce
c325eb3af9
fix(performance): only refresh relevant prorcess in sysinfo when serializing sessions (#2920)
* optimize: update refresh prorcess for sysinfo to reduce cpu usage

* fix: fix format

Signed-off-by: xuanyuan300 <xuanyuan300@gmail.com>

---------

Signed-off-by: xuanyuan300 <xuanyuan300@gmail.com>
2023-11-09 09:41:01 +01:00
Aram Drevekenin
a553188601
docs(changelog): plugin cwd fixes 2023-11-08 11:37:45 +01:00
Aram Drevekenin
ea5e6aa8d7
fix(ux): LaunchPlugin and some cwd fixes (#2916)
* LaunchPlugin and some cwd fixes

* style(fmt): rustfmt

* fix e2e tests and some cleanups

* fmt
2023-11-08 11:37:06 +01:00
Aram Drevekenin
d4657a2fd1
docs(changelog): styled underlines fix 2023-11-08 11:36:12 +01:00
Mike Lloyd
3ebaba9e9e
fix: styled underlines in editors (#2918)
* Add styled_underlines param to TerminalPane

* Add styled_underlines to Cursor::new

* Remove styled_underlines from render_first_run_banner
2023-11-08 11:35:26 +01:00
Aram Drevekenin
b20715b5ae chore(version): bump development version 2023-11-07 10:28:04 +01:00