Commit graph

544 commits

Author SHA1 Message Date
Aram Drevekenin
25a684e094
feat(web): allow specifying ip/port/cert/key through the cli (#4314)
* feat(web): allow specifying ip/port/cert/key through the cli

* fix no-web
2025-07-23 10:56:10 +02:00
Aram Drevekenin
91716979e0
fix(status-bar): proper truncation of secondary info (#4313)
* fix(status-bar): properly truncate secondary keybindings

* style(fmt): rustfmt

* more correct fix

* fix e2e tests

* docs(changelog): add PR
2025-07-22 21:12:38 +02:00
Aram Drevekenin
44a3c1dae9
fix(grid): account for wide characters when double-triple mouse clicking (#4302)
* fix(grid): account for wide characters when double-triple mouse clicking

* fix(e2e): moar race conditions

* docs(changelog): add PR
2025-07-18 10:05:32 +02:00
Aram Drevekenin
4a68c6d90b
fix(resurrection): do not parse resurrection layouts on startup (#4292)
* fix(resurrection): do not parse resurrection layouts on startup

* proper error when file is corrupt

* docs(changelog): add PR

* fix attach command

* style(fmt): rustfmt
2025-07-16 12:03:32 +02:00
Aram Drevekenin
403f0a07be
fix(sessions): remove popups from welcome screen (#4294)
* remove popups from welcome screen

* docs(changelog): add pr
2025-07-16 11:43:18 +02:00
Aram Drevekenin
8113ddf9db
fix(compact-bar): fix cursor length calculation for multiple users (#4279)
* fix(compact-bar): account for multiplayer cursor length

* fix(e2e): account for races in tmux mode

* style(fmt): rustfmt

* docs(changelog): add PR
2025-07-09 17:32:41 +02:00
Aram Drevekenin
ed1f067f59 HOTFIX: e2e test flakiness 2025-07-02 15:35:59 +02:00
Aram Drevekenin
ca0048bdcb
feat: stack pane action (#4255)
* refactor: group placement properties

* add stackpane cli and keybinding

* add test

* refactor: move spawn vertically/horizontally to spawnterminal

* fix tests and cleanups

* some cleanups and minor fixes

* more cleanups

* add stack action to the UI

* style(fmt): rustfmt

* fix serialization

* add to default config

* fix e2e tests

* style(fmt): rustfmt

* fix cli

* fix tests

* docs(changelog): add PR
2025-07-01 20:17:37 +02:00
Aram Drevekenin
a4d5b0238d
performance(terminal): consolidate renders (#4245)
* work

* fix tests for async rendering

* remove comment

* some cleanups

* style(fmt): rustfmt

* fix e2e tests

* fix more e2e tests

* style(fmt): rustfmt

* fix one more test

* style(fmt): rustfmt
2025-06-26 12:57:05 +02:00
Aram Drevekenin
c5ac796880
Feature: web-client/server to share your sessions in the browser (#4242)
* work

* moar work

* notes

* work

* separate to terminal and control channels

* stdin working

* serve html web client initial

* serve static assets loaded with include_dir

* merge

* enable_web_server config parameter

* compile time flag to disable web server capability

* rustfmt

* add license to all xterm.js assets

* mouse working except copy/paste

* helpful comment

* web client improvements

- move script to js file
- add favicon
- add nerd font
- change title

TODO: investigate if font license embedded in otf is sufficient

* get mouse to work properly

* kitty keyboard support initial

* fix wrong type in preload link

* wip axum websocket handlers

- upgrade axum to v0.8.1, enable ws feature
- begin setup of websocket handlers
- tidy up imports

* replace control listener

* handle terminal websocket with axum

* cleanup Cargo.toml

* kitty fixes and bracketed paste

* fix(mouse): pane not found crash

* initial session switching infra

* add `web_client_font` option

* session switching, creation and resurrection working through the session manager

* move session module to zellij-utils and share logic with web-client

* some cleanups

* require restart for enable-web-server

* use session name from router

* write config to disk and watch for config changes

* rename session name to ipc path

* add basic panic handler, make render_to_client exit on channel close

* use while let instead of loop

* handle websocket close

* add mouse motions

* make clipboard work

* add weblink handling and webgl rendering

* add todo

* fix: use session name instead of patch on session switch

* use "default" layout for new sessions

* ui indication for session being shared

* share this session ui

* plugin assets

* Fix process crash on mac with notify watcher.

Use poll watcher instead of recommended as a workaround.

* make url session switching and creation work

* start welcome screen on root url

* scaffold control messages, set font from config

* set dimensions on session start

* bring back session name from url

* send bytes on terminal websocket instead of json

- create web client os input and id before websocket connection

* draft ui

* work

* refactor ui

* remove otf font, remove margins to avoid scrollbar

* version query endpoint for server status

* web session info query endpoint

* refactor: move stuff around

* add web client info to session metadata

* make tests pass

* populate real data in session list

* remove unnecessary endpoint

* add web_client node to config, add font option

* remove web_client_font

* allow disabling the web session through the config - WIP

* formalize sharing/not-sharing configuration

* fix tests

* allow shutting down web server

* display error when web clients are forbidden to attach

* only show sessions that allow web clients if this is a web client

* style(fmt): rustfmt

* fix: query web server from Zellij rather than from each plugin

* remove log spam

* handle some error paths better in the web client

* allow controlling the web server through the cli

* allow configuring the web server's ip/port

* fix tests and format code

* use direct WebServerStatus event instead of piggy-backing on SessionInfo

* plugin revamp initial

* make plugin responsive

* adjust plugin title

* refactor: share plugin

* refactor: share plugin

* add cors middleware

* some fixes for running without a compiled web server capability

* display error when starting the share plugin without web server support

* clarify config

* add pipelines to compile zellij without web support

* display error when unable to start web server

* only query web server when share plugin is running

* refactor(web-client): connection table

* give zellij_server_listener access to the control channel

* fixes and clarifications

* refactor: consolidate generate_unique_session_name

* give proper error when trying to attach to a forbidden session

* change browser URL when switching sessions

* add keyboard shortcut

* enforce https when bound to non-loopback ip

* initial authentication token implementation

* background color from theme

* initial web client theme config

* basic token generation ui

* refactor set config message creation

* also set body background

* allow editing scrollback for plugins too

* set scrollback to 0

* properly parse colors in config

* generate token from plugin

* nice login modals

* initial token management screen

* implement token authentication

* refactor(share): token management screen

* style(fmt): rustfmt

* fix(plugin): some minor bugs

* refactor(share): main screen

* refactor(share): token screen

* refactor(share): main

* refactor(share): ui components

* fix(responsiveness): properly send usage_width to the render function

* fix cli commands and add some verbosity

* add support for settings ansi and selection colors

* add cursor and cursor accent

* basic web client tests

* fix tests

* refactor: web client

* use session tokens for authentication

* improve modals

* move shutdown to ipc

* refactor: ipc logic

* serialize theme config for web client

* update tests

* refactor: move some stuff around to prepare for config hot reload

* config live reloading for the web clients

* change remember-me UI wording

* improve xterm.js link handling

* make sure terminal is focused on mousemove

* remove deprecated sharing indication from compact-bar

* gate deps and functionality behind the web_server_compatibility feature

* feat(build): add --no-web flag in all the places

* fix some other build flows

* add new assets

* update CI for no-web (untested)

* make more dependencies optional

* update axum-extra

* add web client configuration options

* gracefully close connections on server exit

* tests for graceful connection closing

* handle client-side reconnect when server is down

* fix: make sure ipc bus folder exists before starting

* add commands to manage login tokens from the cli

* style(fmt): rustfmt

* some cleanups

* fix(ux): allow alt-right-click on the web client without opening the context menu

* fix: prevent attaching to welcome screen

* fix: reload config issues

* fix long socket path on macos

* normalize config conversion and fix color gap in browser

* revoke session_token cookie if it is not valid

* fix: visual bug with multiple clients in extremely small screen sizes

* fix: only include rusqlite for the web server capability builds

* update e2e snapshots

* refactor(web): client side js

* some cleanups

* moar cleanups

* fix(tests): wait for server instead of using a fixed timeout

* debug CI

* fix(tests): use spawn_blocking for running the test web server

* fix(tests): wait for http rather than tcp port

* fix(tests): properly pass config path - hopefully this is the issue...

* success! bring back the rest of the tests

* attempt to fix the macos CI issue

* docs(changelog): add PR

---------

Co-authored-by: Thomas Linford <linford.t@gmail.com>
2025-06-23 19:19:37 +02:00
har7an
6be8c495bc
build: Don't re-export foreign crates in utils (#4087)
* build(utils): Don't use reexported dependency

for internal code, but use the dependency directly.

* build(client): Don't use re-exports from `utils`

but turn `zellij-utils` dependencies into shared workspace dependencies
instead and specify those in `Cargo.toml` explicitly. This gives a much
better overview of what component in zellij uses which crates. The
previous approach hides a lot of this information since it looks like
crates are used in a single place where this isn't actually true.

* deps(tile): Don't use re-exports from zellij-utils.

* build(zellij): Don't use re-exports from zellij-utils.

* build(server): Don't use re-exports from zellij-utils.

* build(utils): Don't re-export foreign crates.

* docs: Update Changelog with PR #4087.

* style: Apply rustfmt.

* style: Apply rustfmt.

* build(e2e): Don't use re-export from zellij-utils.

* test: Restore e2e tests.

* style: Apply more formatting.
2025-03-23 10:03:42 +00:00
Brooks Rady
4fd0bac675
fix(stacked): stacked panes can't resize status-bar (#4051)
* fix(typo): fix a typo in error message

* fix(typo): fix typo in Tip #6

* fix(logging): silence filesystem error

This `Option` chain already ends with `.unwrap_or_else(Default::default)`
so it's clearly expected that prior operations in the chain may fail. I
didn't have the default `layout_dir` on my computer, and it would fill my
logfile with unhelpful spam — on every pane creation, resize, etc.

* fix(stacked): stacked panes can't resize status-bar

* fix(e2e): race in multiple users test

---------

Co-authored-by: Aram Drevekenin <aram@poor.dev>
2025-03-10 17:21:10 +01:00
Aram Drevekenin
544982dad4
feat(ui): resize shortcuts (#4003)
* feat(ui): show resize and focus shortcuts when relevant

* update serialization and snapshots

* update e2e tests

* style(fmt): rustfmt
2025-02-18 11:11:58 +01:00
Aram Drevekenin
7aaa7aea8f
feat(ux): tips on startup (#3988)
* add some tips

* refactoring and max tip index

* add config to disable release notes and startup tips

* allow dismissing startup tips from plugin

* random tip at startup

* custom launch about

* fix tests

* style(fmt): rustfmt
2025-02-13 17:12:47 +01:00
Mark Grey
26b99eac63
feat(config): new theme definition spec (#3242)
* Implement initial structs from spec

* kdl configuration unmarshalling

* typo text styling

* remove is_selected toggle

* incorporate new status bar ui into theming

* improve test coverage of config behavior

* tab bar correction

* correct also compact bar

* remove spacing between table columns

* refactor table styling

* use text_unselected.emphasis_1 for keygroup sep

* fix tab bar more text

* repair field flattening for theme

* remove extra styling KDL node

* update tests

* updated selected text conversion

* padding for header bar

* minor corrections for existing themes

* background handling

* compact bar corrections

* properly handle opaque method to activate background

* update newer plugins to use styling struct

* correct omission of selected state

* fix: bold typeface for text elements

* fix: fg -> white for list_unselected conversion

* fix: emphasis and opacity handling for nested_list

* correct stylings in the session-manager

* fix emphases translation for table component

* correct emphasis for run instructions

* correct frame_highlight translation for old themes

* provide missing implementation of frame_highlight

* fencepost emphasis color names

* Set a pseudo-None for frame_unselected in old theme conversion

* correct alternating bg for simplified-ui

* update snapshots

* fix inner text padding and errorneous snapshots

* suppress warning about deprecated usage of palette

* remove unused import

* feat(plugins): API to change floating pane coordinates (#3958)

* basic functionality through the cli

* added to plugin api

* add display area and viewport size to TabInfo

* fix tests and add new one

* some cleanups

* refactor: extract pane_id parsing logic

* style(fmt): rustfmt

* docs(changelog): floating pane coordinate chagne API

* fix(tiled-panes): opening panes from the cli (#3963)

* feat(plugins): add `PastedText` Event (#3962)

* working with text paste

* handle utf8 conversion error

* feat(plugins): add PastedText Event

* docs(changelog): plugins pasted text event

* black for table opaque background

* properly apply opacity to table

* correct padding for explicit width ribbons

* feat(plugins): Allow opening panes near plugin (#3966)

* added command + terminal variants

* added editor variant

* style(fmt): rustfmt

* docs(changelog): plugin apis to open panes near plugin

* feat(plugins): send info about $EDITOR and $SHELL (#3971)

* feat(plugins): send info about $EDITOR and $SHELL

* fix(e2e): snapshot update

* docs(changelog): plugin editor and shell info

* fix(floating-panes): when changing coordinates, if a pane is not floating - make it floating (#3972)

* fix(panes): when changing floating pane coordinates, if the pane is not floating, float it

* style(fmt): rustfmt

* docs(changelog): floating pane coordinate fix

* fix(break-pane): strip logical position when inserting pane to new tab (#3973)

* docs(changelog): logical position fix

* Optional frame_unselected theme

* fixture with correct width to account for arrow padding

* update snapshot and rustfmt

---------

Co-authored-by: Aram Drevekenin <aram@poor.dev>
2025-02-07 11:59:54 +01:00
Aram Drevekenin
407120b872
feat(ui): stacked resize (#3957)
* work

* tests and initial notes for refactoring

* refactor(stacked-panes): break out pane

* vertical functionality working with a single stack

* refactor: break out pane from stack

* fix: properly support multiple stacks in tab

* combining multiple stacks vertically

* vertical resizing working for all cases

* base functionality and tests

* some UX tweaking

* final functionality for directionless stacked increase

* some cleanups

* moar cleanups

* refactor: stacked resize

* fix: issue where resizing stacked geoms to 0 would cause them to overflow afterwards

* fix: handle uneven stacking

* functionality with tombstones

* new open new pane functionality

* match decrease increment behavior to increase one and fix some issues

* set fullscreen if maxed out

* allow splitting stacks

* fix tests mostly by parameterizing stacked_resize

* add tests

* some cleanups

* style(fmt): rustfmt

* add to config

* disable ci cache

* is_stacked => stacked

* docs(config): remove duplication
2025-01-28 21:24:07 +01:00
har7an
10df29ed11
Update rust toolchain to 1.84 (#3945)
* chore: Remove deprecated `Makefile.toml`

which really should have been deleted as part of #2012. This hasn't been
updated for more than 2 years now and I don't expect anyone to still use
this. Our build process is now managed by `cargo xtask`.

* Cargo: Update the Rust toolchain to 1.84.0

from 1.75.0 which has been deprecated for a while now. Along with this
change, the `wasm32-wasi` target is no longer available (see subsequent
commit for additional info).

* chore: Rename `wasm32-wasi` to `wasm32-wasip1`

as required by the Rust project. The `wasm32-wasi` target name has been
retired and will likely be reused at a later time, although to express
an entirely different target (i.e. implementation of the WASI standard).

For additional information, see:

  - https://blog.rust-lang.org/2024/04/09/updates-to-rusts-wasi-targets.html
  - https://blog.rust-lang.org/2024/09/05/Rust-1.81.0.html#wasi-01-target-naming-changed

* chore: Drop `rust-analysis` component

from the `rust-toolchain.toml` definition. This was added way back in
2021 via 8688569a, and while I'm not sure what it expressed back then,
nowadays it refers to [Metadata for RLS][1], which apparently was an
early language server implementation and has long since been replaced by
*rust-analyzer*.

We don't want to propose or enforce the use of a specific toolchain and
in any case, setting this up properly is the job of a developers
IDE/Editor.

[1]:
1f06e3b31d/doc/user-guide/src/concepts/components.md (previous-components)

* chore: Adhere to type rename

from `std::panic::PanicInfo` to `std::panic::PanicHookInfo`, which was
introduced in Rust 1.81.0. For additional information, see:

- https://releases.rs/docs/1.81.0/#compatibility-notes
- https://github.com/rust-lang/rust/pull/115974/

* fix(utils/data): Adhere to expected case

in match arm patterns, since the expression being matched against has
been modified using `to_ascii_lowercase`. Hence, we cannot have upper
case ASCII chars in the expressions (these arms were previously no-ops).

* fix(utils): Derive `Hash` manually

in `input/layout` since the `PartialEq` trait is also implemented
manually. Previously the `Hash` impl wasn't consistent with the `Eq`
impl, which can have weird effects when using these types in e.g.
`HashMap`s or similar types. For additional information, see:

  - https://rust-lang.github.io/rust-clippy/master/index.html#derived_hash_with_manual_eq
  - https://doc.rust-lang.org/stable/std/hash/trait.Hash.html#hash-and-eq

* fix(utils): Derive `Hash` manually

in `pane_size` since the `PartialEq` trait is also implemented manually.
Previously the `Hash` impl wasn't consistent with the `Eq` impl, which
can have weird effects when using these types in e.g. `HashMap`s or
similar types. For additional information, see:

  - https://rust-lang.github.io/rust-clippy/master/index.html#derived_hash_with_manual_eq
  - https://doc.rust-lang.org/stable/std/hash/trait.Hash.html#hash-and-eq

* fix(server): Don't redeclare variables

with their same names. Latest rust toolchains reject this code.

* chore(actions): Use non-archived toolchain setup

for the Rust toolchain. The previously used action has been archived
over a year ago. The new one should also support reading our
`rust-toolchain.toml`, so we no longer have to keep track of the
toolchain in multiple places.

* chore(actions): Add some space to YAML files

to make them better visually parsable.

* ci: Remove toolchain update Job

since as far as I can tell, this isn't used any more.

* ci: Fix invalid actions specification

and only request an action without running other code.

* CHANGELOG: Add PR #3945.
2025-01-25 17:43:49 +00:00
Aram Drevekenin
86535f1612
fix(layout-applier): logical index pane sorting (#3893)
* initial draft

* working with floating panes as well

* use the same method for applying an initial layout to tiled panes

* some refactoring

* all code paths working with logical positioning fallback!

* get tests to compile

* get e2e tests to pass

* fix e2e remote runner

* breadth-first layout sorting

* fix some bugs

* style(fmt): rustfmt

* style(fmt): remove comments
2024-12-25 20:26:27 +01:00
Aram Drevekenin
dd291e2a1f
feat(ux): pin floating panes (#3876)
* working

* ui indication

* add keybinding

* add to plugin panes

* fix with multiple cursors

* toggle with the mouse

* fix e2e tests and add new one

* some cleanups

* add to layouts

* make mouse click more lenient

* allow setting a new floating pane as pinned

* make toggle work throughthe command line

* add to plugin api

* get tests to pass

* style(fmt): rustfmt
2024-12-16 16:03:20 +01:00
Aram Drevekenin
e8b95402d8
fix(input): refix ctrl-j (#3746)
* fix(input): refix ctrl-j

* fix e2e tests
2024-11-08 14:34:47 +01:00
Aram Drevekenin
61908a7cfe
feat(ui): bring back fullscreen indication (#3688)
* feat(ui): bring back fullscreen indication

* fix e2e tests
2024-10-22 18:32:44 +02:00
Aram Drevekenin
618e0f7a34
fix(plugins): allow switching to a new session with cwd without specifying a layout (#3676) 2024-10-14 16:44:28 +02:00
Aram Drevekenin
2bd0f2a535
fix(plugins): various plugin api and other fixes (#3665)
* fix(plugins): do not allow focusing an unselectable pane

* fix(folders): make sure config and cache folders exist on app start
2024-10-11 18:04:18 +02:00
Aram Drevekenin
203fbf7a49
feat(cli): make --layout idempotent(-ish) (#3650)
* feat(cli): if inside a session, apply --layout to the session

* fix(screen): some focusing races when switching tab focus

* style(fmt): rustfmt
2024-10-08 16:57:54 +02:00
Aram Drevekenin
ce8e3995df
feat(config): allow loading background plugins on startup (#3616)
* remove old partial implementation

* feat(plugins): allow loading background plugins on startup

* add e2e test

* update config

* udpate config merging

* style(fmt): rustfmt
2024-09-20 15:38:20 +02:00
Aram Drevekenin
056537d3ee
feat(ux): first run setup-wizard (#3556)
* separate saved/runtime structure, kind of working

* serializing config

* work

* work

* save config through the configuration screen

* work

* startup wizard

* style(code): cleanups

* fix(session): reload config from disk when switching sessions

* style(fmt): rustfmt

* fix(config): propagate cli config options to screen

* style(fmt): rustfmt
2024-08-16 14:00:01 +02:00
Aram Drevekenin
4df7b42766
fix(startup): do not parse resurrectable sessions on startup (#3505)
* fix(startup): do not parse resurrectable sessions on startup

* style(fmt): rustfmt
2024-07-18 16:35:07 +02:00
Aram Drevekenin
2deffc3289
feat(plugins): add stringified layout to switch_session_with_layout (#3503) 2024-07-18 10:45:42 +02:00
Aram Drevekenin
84ff29dd02
feat(ui): configuration screen + configure non-colliding keys at runtime (#3502)
* rebind => reconfigure

* persist keybinds and mode info to new tabs

* add configuration plugin

* make tests pass

* remove warnings

* style(fmt): rustfmt
2024-07-17 16:08:31 +02:00
Aram Drevekenin
a6d6c0e4ff
feat(ui): status bar redesign (#3475)
* work

* work

* working

* get default mode from server and some ui responsiveness

* work

* finish design and get tests to pass

* get e2e tests to pass

* add classic layout

* add classic layout assets

* fix e2e tests

* style(fmt): rustfmt

* fix plugin system test

* style(fmt): some cleanups
2024-07-05 15:13:51 +02:00
bjorn3
7d7848cddc
dependencies: switch from Wasmer to Wasmtime (#3349)
* Remove ForeignFunctionEnv wrapper around PluginEnv

This will enable PluginEnv to be the Store context when migrating to
Wasmtime.

* Pass PluginEnv by value to load_plugin_instance

This will allow removing the Clone impl from PluginEnv when migrating to
Wasmtime as required by the missing Clone impl on Wasmtime's WasiCtx.

* Avoid passing a Store around when an Engine is enough

* Pass PluginEnv to the wasi read/write functions

Wasmtime requires storing the read/write end of the pipe outside of the
WasiCtx. Passing PluginEnv to these functions allows storing them in the
PluginEnv.

* Migrate to Wasmtime

* Switch from wasi-common to wasmtime-wasi

* Reduce verbosity of wasmtime_wasi logs

* Increase startup delay

To wait for all plugins to be compiled.

* Disable some wasmtime features

* Update to Wasmtime 21.0.1
2024-06-28 16:47:43 +02:00
Aram Drevekenin
1f0ae94f01
feat(plugins): rebind keys at runtime (#3422)
* refactor(server): interpret keys on server so they can be rebound

* feat(plugins): allow rebinding keys at runtime

* various cleanups

* add tests

* style(fmt): rustfmt

* fix(tests): address (some) e2e test flakiness

* style(fmt): rustfmt
2024-06-14 17:11:02 +02:00
Aram Drevekenin
62c37a87cc
feat(keybindings): support multiple modifiers (eg. Ctrl+Alt) and the kitty keyboard protocol (#3383)
* parse kitty keys from STDIN

* work

* work

* replace internal Key representation with the new KeyWithModifier in all the places

* work

* work

* allow disabling with config

* adjust ordering

* handle enabling/disabling properly on the client

* support multiple modifiers without kitty too

* normalize uppercase keys

* get tests to pass

* various cleanups

* style(fmt): rustfmt
2024-05-27 16:15:09 +02:00
Aram Drevekenin
90a62217fd
feat(layouts): allow consuming a layout from a url (#3351)
* feat(cli): allow loading layouts directly from a url

* feat(plugins): allow loading layouts directly from a url

* style(fmt): rustfmt
2024-05-15 11:20:36 +02:00
Aram Drevekenin
954bdcb1a2
fix(cli): rename attach --background to attach --create-background (#3265)
* fix(cli): rename background to create_background

* fix(cli): change create-background shortcut
2024-04-15 17:37:38 +02:00
Aram Drevekenin
e68bc649d6
feat(cli): allow starting a session detached (#3257)
* feat(cli): allow starting a session detached

* fix tests
2024-04-12 15:39:36 +02:00
Bradford Hovinen
312817fcf6
fix(config): add support for Ctrl and Alt modifiers on function keys in keybindings (#3179)
Previously, it was not possible to define keybindings with a modifier
and a function key. The `Key` enum only supported combinging the Ctrl
and Alt modifiers with letters. This is somewhat limiting: I would like
to make the Zellij keybindings more "distant" than those used in the
programs I use from within Zelilj, so that Zellij does not intefere with
those programs. Thus I would like to move some of the keybindings from
Ctrl+<character> to Ctrl+<function key>.

This change adds:

  * support for function keys with the Ctrl and Alt modifiers in the
    `Key` enum,
  * support for parsing such keybindings from the configuration file,
  * support for such keybindings in the protobuf which communicates the
    keybindings to plugins, and
  * support for these keybindings in the plugin API.

This is tested by modifying one of the e2e tests to include an example
of such keybindings. This verifies that the configuration is correctly
parsed, communicated with the plugin, and rendered.
2024-03-25 15:04:38 +01:00
toymil
9deb033340
feat: list-sessions show newest sessions last, for better user experience (#3194)
* feat: sort `list-sessions` from oldest to newest

by putting the most recent sessions last, the user won't need to scroll back up
to see active sessions when there are a lot of resurrectable sessions.

* feat: add an `--reverse` option to the `list-sessions` subcommand

the `--reverse` flag reverts sorting order back to the old "newest sessions
first".  also updated call sites of `list_sessions` and `print_sessions` with
`reverse: true`, to keep the original behavior everywhere else except the output
of `list-sessions` subcommand.

* chore: update the help message

---------

Co-authored-by: Jae-Heon Ji <atx6419@gmail.com>
2024-03-24 23:30:47 +09:00
Aram Drevekenin
ec6d627b06
chore(integrations): zpipe alias (#3210)
* chore(completions): zpipe alias

* chore(integrations): zpipe alias
2024-03-20 18:34:50 +01:00
Aram Drevekenin
ee16a4b8c3
feat(plugins): session manager cwd and new filepicker (#3200)
* prototype

* folder selection ui in session manager

* overhaul strider

* scan folder host command

* get strider to work from the cli and some cli pipe fixes

* some ux improvements to strider

* improve strider's ui

* make strider ui responsive

* make session-manager new ui parts responsive

* fix tests

* style(fmt): rustfmt
2024-03-18 09:19:58 +01:00
Aram Drevekenin
896b09aa6f
feat(plugins): allow specifying the cwd when switching sessions (#3172)
* feat(plugins): allow specifying the cwd when switching sessions

* style(fmt): rustfmt
2024-02-29 16:26:25 +01:00
Bartosz Zbytniewski
dd5ea26cc7
feat: add moving tab to other position (#3047)
* feat: add moving tab to other position

* docs(changelog): revert changes

* test: update config snapshots

* refactor: get rid of HorizontalDirection enum

* refactor: cleanup code order

* refactor: use debug! instead of info!

* refactor: use more defensive way to switch tabs

* refactor: revert tip changes

* refactor: code formatting

* refactor: improve invalid input notification

* refactor: inline fns for calculating target index

---------

Co-authored-by: Jae-Heon Ji <atx6419@gmail.com>
2024-02-19 03:40:03 +09:00
Aram Drevekenin
326c8cd3c6
feat(panes): allow specifying coordinates for a new floating pane through the CLI or plugins (#3122)
* working

* add tests

* add coordinates to all the places

* refactor: move things around:

* style(fmt): rustfmt

* style(code): cleanups
2024-02-08 17:35:55 +01:00
Aram Drevekenin
7e549cdbd5
fix(cli): respect cwd in zellij run and zellij plugin (#3116)
* fix(cli): respect cwd in zellij run and zellij plugin commands

* style(fmt): rustfmt

* fix tests
2024-02-07 10:39:51 +01:00
Aram Drevekenin
6b20a958f4
feat(sessions): welcome screen (#3112)
* prototype - can send layout name for new session from session-manager

* feat(sessions): ui for selecting layout for new session in the session-manager

* fix: send available layouts to plugins

* make tests compile

* fix tests

* improve ui

* fix: respect built-in layouts

* ui for built-in layouts

* some cleanups

* style(fmt): rustfmt

* welcome screen ui

* fix: make sure layout config is not shared between sessions

* allow disconnecting other users from current session and killing other sessions

* fix: respect default layout

* add welcome screen layout

* tests(plugins): new api methods

* fix(session-manager): do not quit welcome screen on esc and break

* fix(plugins): adjust permissions

* style(fmt): rustfmt

* style(fmt): fix warnings
2024-02-06 14:26:14 +01:00
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
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
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
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
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