Commit Graph

186 Commits

Author SHA1 Message Date
Matthias Beyer
6e102c6084
fix(cli): let the exit message be different when detaching (#1573)
* Let the exit message be different when detaching

This patch changes the exit message printed to the user, so the user
does not get the impression that they fat-fingered an "exit" instead of
what was intended (a detach).

For this, the InputHandler::exit() function was refactored, to get the
reason as a parameter. As this function is not pub, this is considered
okay.

Signed-off-by: Matthias Beyer <mail@beyermatthias.de>

* Change detach message

This patch changes the detach message to be more in line with the other
messages zellij displays to the user.

Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2022-07-12 12:17:24 +02:00
Aram Drevekenin
c89b416d76
feat(terminal): sixel support (#1557)
* work

* work

* work

* work

* work

* more work

* work

* work

* work

* hack around stdin repeater

* refactor(sixel): rename sixel structs

* feat(sixel): render text above images

* fix(sixel): reap images once they're past the end of the scrollbuffer

* fix(sixel): display images in the middle of the line

* fix(sixel): render crash

* fix(sixel): react to SIGWINCH

* fix(sixel): behave properly in alternate screen mode

* fix(sixel): reap images on terminal reset

* feat(sixel): handle DECSDM

* fix(terminal): properly respond to XTSMGRAPHICS and device attributes with Sixel

* Add comment

* fix(sixel): hack for unknown event overflow until we fix the api

* feat(input): query terminal for all OSC 4 colors and respond to them in a buggy way

* fix(sixel): do not render corrupted image

* feat(input): improve STDIN queries

* fix(client): mistake in clear terminal attributes string

* fix(ansi): report correct number of supported color registers

* fix(sixel): reap images that are completely covered

* style(comment): fix name

* test(sixel): infra

* test(sixel): cases and fixes

* fix(sixel): forward dcs bytes to sixel parser

* refactor(client): ansi stdin parser

* refactor(output): cleanup

* some refactorings

* fix test

* refactor(grid): sixel-grid / sixel-image-store

* refactor(grid): grid debug method

* refactor(grid): move various logic to sixel.rs

* refactor(grid): remove unused methods

* fix(sixel): work with multiple users

* refactor(pane): remove unused z_index

* style(fmt): prepend unused variable

* style(fmt): rustfmt

* fix(tests): various apis

* chore(dependencies): use published version of sixel crates

* style(fmt): rustfmt

* style(fmt): rustfmt

* style(lint): make clippy happy

* style(lint): make clippy happy... again

* style(lint): make clippy happy... again (chapter 2)

* style(comment): remove unused

* fix(colors): export COLORTERM and respond to XTVERSION

* fix(test): color register count

* fix(stdin): adjust STDIN sleep times
2022-07-08 17:19:42 +02:00
har7an
c26a6bcf56
refactor(crates): move shared contents from zellij tile to zellij utils (#1541)
* zellij-tile: Move `data` to zellij-utils

The rationale behind this is that all components of zellij access the
data structures defined in this module, as they define some of the most
basic types in the application. However, so far zellij-tile is treated
like a separate crate from the rest of the program in that it is the
only one that doesn't have access to `zellij-utils`, which contains a
lot of other data structures used throughout zellij.

This poses issues as discussed in
https://github.com/zellij-org/zellij/pull/1242 and is one of the reasons
why the keybindings in the status bar default plugin can't be updated
dynamically. It is also the main reason for why the keybindings are
currently passed to the plugin as strings: The plugins only have access
to `zellij-tile`, but since this is a dependency of `zellij-utils`, it
can't import `zellij-utils` to access the keybindings.
Other weird side-effect are that in some places `server` and `client`
have to access the `zellij-tile` contents "through" `zellij-utils`, as
in `use zellij_utils::zellij_tile::prelude::*`.

By moving these central data structures to one common shared crate
(`zellij-utils`), `zellij-tile` will be enabled to import `zellij-utils`
like `screen` and `client` already do. This will, next to other things,
allow dropping a lot of `std::fmt::Fmt` impls needed to convert core
data structures into strings and as a consequence, a lot of string
parsing in the first place.

* utils: Integrate new `data` module, bump rust ver

Integrates the `data` module that was previously part of `zellij-tile`
to allow sharing the contained data structures between all components of
zellij.

This allows `zellij-tile` to use `utils` as a dependency. However, since
`tile` is build against the wasm target, it cannot include all of
`zellij-utils`, since a lot of dependencies there cannot compile with
`wasm` as target (Examples include: termwiz, log4rs, async-std). Thus we
make all the dependencies that cannot compile against `wasm` optional
and introduce a new feature `full` that will compile the crate with all
dependencies. Along with this, modify `lib.rs` to include most of the
data structures only when compiling against the `full` feature.

This makes the compiles of `zellij-tile` lighter, as it doesn't include
all of `utils`. As a side effect, due to the dependency notation for the
optional dependencies (See
https://doc.rust-lang.org/cargo/reference/features.html#optional-dependencies),
we bump the rust toolchain version to 1.60.0.

* tile: Import `data` from zellij-utils

Add `zellij-utils` as a dependency to `zellij-tile` and allow us access
to the `data` module defined there. Update the re-export in the
`prelude` such that from all of the plugins points of view *absolutely
nothing changes*.

* utils: Fix `data` module dependency

Since the `data` module has been migrated from `zellij-tile` to
`zellij-utils`, we import it from `zellij-utils` directly now.
Also unify the imports for the `data` module members: We import all of
the through `data::` now, not through a mixture of `data::` and
`prelude::`.

* client: Fix `data` module dependency

Since the `data` module has been migrated from `zellij-tile` to
`zellij-utils`, we import it from `zellij-utils` directly now.
Also unify the imports for the `data` module members: We import all of
the through `data::` now, not through a mixture of `data::` and
`prelude::`.
Add the "full" feature flag to the `zellij-utils` dependency so it
includes all the components we need.

* server: Fix `data` module dependency

Since the `data` module has been migrated from `zellij-tile` to
`zellij-utils`, we import it from `zellij-utils` directly now.
Also unify the imports for the `data` module members: We import all of
the through `data::` now, not through a mixture of `data::` and
`prelude::`.
Add the "full" feature flag to the `zellij-utils` dependency so it
includes all the components we need.

* tests: Fix `data` module dependency

Since the `data` module has been migrated from `zellij-tile` to
`zellij-utils`, we import it from `zellij-utils` directly now.

* utils: Remove "full" feature

in favor of conditional compilation using `target_family`. Replace the
rust 1.60 method of specifying optional dependencies based on features
and optionally include the dependencies only when not building for wasm
instead. (I.e. `cfg(not(target_family = "wasm"))`)

* cargo: Update module dependencies

since `client`, `server` and `tile` now all depend on `utils` only.
2022-07-06 16:06:56 +02:00
Thomas Linford
3aef436a69
fix: fallback to default values when terminal rows/cols are 0 (#1552)
* fix: fallback to default values when terminal rows/cols = 0

* increase retry_pause for failing test

* e2e: load fixtures with cat

* use variable for fixture path
2022-07-04 18:28:37 +02:00
a-kenji
e23bbfddaa
fix: various typos (#1553)
Because they were wrong.
2022-07-02 19:54:50 +02:00
a-kenji
7ed66d3e78
add(feature): unstable (#1542)
Add a feature `unstable`, which is intended to communicate the same
intent.

Gate: Send actions from cli with the `unstable` feature.
2022-06-25 21:48:00 +02:00
raphCode
5d9c428294
fix: exit client on empty rcv (#1535)
* Exit client on empty ipc receive

This resolves a hang when the server goes away unnoticed (e.g. when it
is killed). In some cases, this delayed system shutdown because the
client did not react to systemd's SIGTERM.

* Add newline after error report to tidy up shell prompt

* Update changelog
2022-06-21 20:40:26 +02:00
a-kenji
29332ca684
add: debug information for certain actions (#1533) 2022-06-20 20:25:29 +02:00
a-kenji
0c24edea7f
fix: dispatch various actions correctly (#1530) 2022-06-19 21:49:47 +02:00
a-kenji
8da6207849
fix(action): dispatch of edit-scrollback (#1523) 2022-06-17 22:02:47 +02:00
a-kenji
464f21aebd
fix: clarify comments (#1519) 2022-06-16 18:34:31 +02:00
a-kenji
35498b6030
fix(action): correctly dispatch the Write action (#1518)
The  `Write` action should be called once per session.
2022-06-16 18:34:19 +02:00
a-kenji
2563fbb441
fix(action): send WriteChars once per action (#1516)
`WriteChars` is not an idempotent action, that's why it should only
be sent to it's destination client.
2022-06-16 15:20:23 +02:00
a-kenji
3de59dac42
fix(clippy): clippy fixes (#1508)
* fix(clippy): clippy fixes

* chore(fmt): cargo fmt
2022-06-15 14:03:11 +02:00
a-kenji
7314b62321
fix: remove obsolete logs (#1504) 2022-06-15 12:30:23 +02:00
a-kenji
0b6001305b
feat: add capability to dispatch actions from cli (#1265)
* feat: add capability to dispatch actions from cli

Add capability to dispatch actions from the cli.

Can be invoked through `zellij action [actions]`

Automatically sends the action either to the current session,
or if there is only one session to the single session.

If there are multiple sessions, and no session is specified it will
error out.

Example:
1.
```
zellij action "[NewTab: , NewTab: ]"
```
2.
```
zellij -s fluffy-cat action '[NewPane: , WriteChars: "echo Purrr\n" ]'
```
3.
```
zellij -s fluffy-cat action '[ CloseTab, ]
```

* add: error message on malformed input

Add an error message on malformed input, for the `action`'s dispatch.
Rather than resulting in a panic.

* add: function to query the client id

* add: send specific actions to certain clients

Adds ability to send actions, that don't impact the server state
to all connected clients. For example `MoveFocus`

* add: client_id to non blocking actions

* chore(fmt): `cargo fmt`

* add: pick correct session, if there is exactly one

* add: use correct `client_id` for detach action

* add: make `[ ]` opaque to the user

* add: miette to toplevel to improve error message

* add: fake client reading configuration

Add the fake client reading configuration files,
this allows actions, that rely on configuration work
correctly. This is an intermediate solution, and should ideally not
be needed. It would be better if most of this state would be handled
by the server itself.

* chore(fmt): rustmt

* add: ability to detach multiple clients

Add ability to detach multiple clients at the same time.

* remove: obsolete functionality

* remove: unused functionality

* add: send correct action upon exiting

* chore(update): cargo update
2022-06-15 11:20:06 +02:00
a-kenji
67d2673cae
add(style): add trailing comma in match blocks (#1483)
This makes it easier to distinguish from normal blocks
2022-06-10 20:03:13 +02:00
Kian-Meng Ang
16b53aa52f
docs: fix typos (#1481) 2022-06-10 23:37:55 +09:00
Aram Drevekenin
6d15af04bd chore(version): bump development version 2022-06-07 15:38:56 +02:00
Thomas Linford
c2453b471b
fix(mouse): selection sometimes getting stuck (#1418)
- when multiple mouse events are read from stdin,
start mouse hold repeat loop only if hold event is the last.
2022-06-06 12:06:48 +02:00
raphCode
eab464b11a
Fix double panic lockup in clients panic handler (#1433)
* Fix possible lockup in the clients panic handler

When the pty the client was running in disappears, reading from stdin
causes a panic, which triggers the custom panic handler. This handler
attempts to print a backtrace to the terminal and tries to unset the raw
mode for that. Since the pty has already disappeared, the tcsetattr call
fails and causes a second panic, which locks everything up.

This commit fixes this by returning an Result from the unset_raw_mode
function, allowing the calling panic handler to handle any error
gracefully.

* Log any client panics to file

Since we are now aware of the fact that panics may happen / are handled
after the pty has disappeared, logging them to file seems useful: there
is no other other place to show them to the user.

* fix tests and improve function return type
2022-05-24 14:10:37 +02:00
Thomas Linford
6ed4bf8c0b
fix(input): ANSI code sent to terminal on startup and resize
* fix macos parsing issues

* format

* fix(ansiparser): validate first key on parse

Co-authored-by: Aram Drevekenin <aram@poor.dev>
2022-05-16 15:32:17 +02:00
dependabot[bot]
fe9fa2d60a
build(deps): bump log from 0.4.16 to 0.4.17 (#1386)
Bumps [log](https://github.com/rust-lang/log) from 0.4.16 to 0.4.17.
- [Release notes](https://github.com/rust-lang/log/releases)
- [Changelog](https://github.com/rust-lang/log/blob/master/CHANGELOG.md)
- [Commits](https://github.com/rust-lang/log/commits/0.4.17)

---
updated-dependencies:
- dependency-name: log
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-05-09 18:32:36 +02:00
Aram Drevekenin
3177542674 chore(version): bump development version 2022-05-02 22:54:23 +02:00
Aram Drevekenin
a7ddfe1acc chore(release): v0.29.1 2022-05-02 22:31:08 +02:00
Aram Drevekenin
77e9dc93f7 chore(version): bump development version 2022-05-02 14:00:20 +02:00
Thomas Linford
03ffd08ebb
fix(mouse): improve mouse event reporting (#1329)
* fix: do not rebroadcast mouse press events
* fix: do not send generated mouse hold events to applications
* begin selecting only if click is on terminal pane
2022-04-30 18:46:17 +02:00
Aram Drevekenin
0dc136ec5f
fix(compatibility): respond to bg and fg color ansi queries (#1358)
* fix(compatibility): respond to background/foreground queries

* style(fmt): rustfmt

* style(clippy): make clippy happy

* style(fmt): rustfmt

* style(fmt): remove unused code
2022-04-28 17:26:44 +02:00
Aram Drevekenin
7ba49658f7
fix(ipc): empty ipc msg crash (#1351)
* fix(ipc): recover from corrupted channel state

* style(fmt): rustfmt
2022-04-27 10:44:14 +02:00
Aram Drevekenin
bf21442186 chore(version): bump development version 2022-04-13 19:17:09 +02:00
Aram Drevekenin
3a2fee601a chore(package): patch version 2022-04-13 18:46:00 +02:00
Aram Drevekenin
19adb29be5 feat(signals): support XTWINOPS 14 and 16 (and query the terminal for them on startup and SIGWINCH) (#1316)
* feat(signals): get pixel info from terminal emulator

* feat(signals): query for pixel info on sigwinch

* feat(signals): reply to csi 14t and csi 16t

* style(fmt): rustfmt

* style(comments): remove outdated
2022-04-12 18:07:32 +02:00
Aram Drevekenin
8439198636 chore(version): bump development version 2022-03-31 15:07:18 +02:00
dependabot[bot]
a4ad296875
build(deps): bump log from 0.4.14 to 0.4.16 (#1278)
Bumps [log](https://github.com/rust-lang/log) from 0.4.14 to 0.4.16.
- [Release notes](https://github.com/rust-lang/log/releases)
- [Changelog](https://github.com/rust-lang/log/blob/master/CHANGELOG.md)
- [Commits](https://github.com/rust-lang/log/commits)

---
updated-dependencies:
- dependency-name: log
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-03-28 10:40:45 +02:00
Aram Drevekenin
7141779153
chore(deps): move from termion to termwiz for STDIN handling (#1249)
* fix(deps): switch from termion to termwiz for STDIN parsing

* style(fmt): clippy

* style(fmt): moar clippy

* style(fmt): rustfmt

* fix(tests): e2e mouse press

* style(fmt): rustfmt

* bring back polling

* fmt fmt fmt

* fix some e2e flakiness
2022-03-23 09:08:35 +01:00
Brooks Rady
9bfafde123
feat(ui): round frame corners (#1227)
* feat(ui): round frame corners

* Allow rounded_corners to be set without a palette

* Revert "Allow rounded_corners to be set without a palette"

This reverts commit 9271a4b545.

* fix(style): remove redundant code

* fix(style): clippy lints that somehow got missed

* feat(config): add ui config section
2022-03-22 14:58:16 +00:00
Aram Drevekenin
2e03692f5b chore(version): bump development version 2022-03-16 14:25:08 +01:00
Aram Drevekenin
9c7d13984f chore(release): v0.26.1 2022-03-16 14:03:07 +01:00
Aram Drevekenin
08d2014cfe hotfix: do not send bracketed paste to panes where it is not on 2022-03-16 09:42:58 +01:00
Jae-Heon Ji
0b74604a9f
feat: improve error reporting system (#1038)
* feat: add draft a concept code

* feat: add err_ctx to diagnostic

* feat: optimize error report

* chore: add user-friendly help

* fix: manual merge lockfile from main
2022-03-13 20:46:03 +09:00
Aram Drevekenin
779679f53b chore(version): bump development version 2022-03-11 16:13:01 +01:00
Thomas Linford
7e008bb039
fix(compatibility): home and end in cursor keys mode (#1190) 2022-03-09 21:21:15 +01:00
a-kenji
6d653e1521
add: set env var's from config and layout (#1154)
Add ability to set `ENVIRONMENT VARIABLES` from the
config and the layout files.

example:

```
env:
  ZELLIJ_CONFIG:
    DEFAULT
```

or

```
env:
  ZELLIJ_LAYOUT_NAME:
    BUILD_SESSION
```

If two keys conflict (configuration and layout), then the key
from the layout is used.

fixes: #1059
2022-03-01 15:47:52 +01:00
Aram Drevekenin
843bf58f51
fix(input): handle discontiguous STDIN input (#1119)
* log stdin reads and events

* attempt fix for incomplete mouse sequences

* read events directly from stdin

* fix flaky e2e test

* bring back bracketed paste

* rustfmt

* remove unused

Co-authored-by: Thomas Linford <linford.t@gmail.com>
2022-02-25 14:34:55 +01:00
Jae-Heon Ji
a489194b55
fix: invalid assignment of client_id (#1052)
* feat: sync socket connection in

* chore: apply clippy

* chore: change message name
2022-02-23 23:50:49 +09:00
Aram Drevekenin
39eddd8b1c chore(version): bump development version 2022-02-22 13:36:39 +01:00
Aram Drevekenin
821e7cbc5a
feat(ui): add floating panes (#1066)
* basic functionality

* close and reopen scratch terminal working

* embed/float and resize whole tab for floating and static floating panes

* move focus working

* fix focus change in floating panes

* move pane with mouse

* floating z indices

* tests and better resize algorithm

* starting to work on performance

* some performance experimentations

* new render engine

* reverse painters algorithm for floating panes

* fix frame buffering

* improve ux situation

* handle multiple new panes on screen without overlap

* adjust keybindings

* adjust key hints

* fix multiuser frame ui

* fix various floating/multiuser bugs

* remove stuff

* wide characters under floating panes

* fix wide character frame override

* fix non-frame boundaries interactions with floating panes

* fix selection character width

* fix title frame wide char overflow

* fix existing tests

* add tests

* refactor output out of tab

* refactor floating panes out of tab

* refactor tab

* moar refactoring

* refactorings and bring back terminal window title setting

* add frame vte output

* remove more unused stuff

* remove even more unused stuff

* you know the drill

* refactor floating panes and remove more stuffs

* refactor pane grids

* remove unused output caching

* refactor output

* remove unused stuff

* rustfmt

* some formatting

* rustfmt

* reduce clippy to normal

* remove comment

* remove unused

* fix closign pane

* fix tests
2022-02-18 21:10:06 +01:00
Aram Drevekenin
e06300f7db chore(version): bump development version 2022-01-05 11:14:15 +01:00
Kunal Mohan
59c71355a9
Remove unused dependency - termbg (#992) 2022-01-04 23:49:53 +05:30
Thomas Linford
6e35f29b0f
fix(mouse): prevent unhandled mouse events escape to terminal (#976)
* workaround to not write csi mouse seqs to terminal

* tab: copy selection to clipboard only if selecting was initiated with left click

* cleanup debug log messages

* unset selecting_with_mouse when selection is empty
2021-12-28 21:39:20 +01:00
Aram Drevekenin
ce8e898e6d chore(version): bump development version 2021-12-20 18:31:54 +01:00
Aram Drevekenin
6175d57702 chore(version): bump development version 2021-12-20 17:56:47 +01:00
Aram Drevekenin
1a991ce7fb chore(version): bump development version 2021-12-14 17:32:02 +01:00
Aram Drevekenin
5f1f190a85 chore(version): bump development version 2021-12-13 16:19:37 +01:00
Kunal Mohan
c75bcbd937
Feature: Add pane names (#928)
* Read pane name from layout

* Update pane name at runtime

* Fix tests

* prefer and render pane name over pane title

* fix clippy errors

* fix after rebase
2021-12-09 23:30:40 +05:30
Marcin Puc
56e85f87d6
fix(style): various internal refactorings 2021-12-07 10:24:42 +00:00
Thomas Linford
e47e3d361f
fix(perf): throttle resizes on sigwinch (#895)
Reduce renders while resizing window to reduce performance problem with a large scrollback buffer due to lines recalculation.
2021-12-05 11:26:32 +01:00
Aram Drevekenin
cbe0d5405e
fix(compatibility): do not duplicate bracketed paste in chunked stdin input (#917)
* debug message

* fix attempt

* oops

* remove log message

* rustfmt

* style(clippy): make clippy happy

* style(clippy): make clippy happy again!
2021-12-02 18:35:55 +01:00
Kunal Mohan
0ed8f06b9f
Prevent a zellij session from attaching to itself. (#911)
* fix #905
Prevent a zellij session from attaching to itself.

* Add check while attaching using index as well
2021-11-30 17:31:05 +05:30
Aram Drevekenin
1ee743156c chore(version): bump development version 2021-11-29 10:09:22 +01:00
a-kenji
bd8c834d7c
fix(options): handling and overwriting cli opts (#859)
* fix(options): handling ond verwriting cli opts

* previously it was only possible to turn off certain features with a
  command line option, now it is possible to also overwrite this
  behavior in a sane way, for that some breaking changes happened:

  following options got renamed and inverted:
  ```
  disable_mouse_mode -> mouse_mode
  no_pane_frames -> pane_frames
  ```

  following cli options got added:
  ```
  mouse-mode [bool]
  pane-frames [bool]
  simplified-ui [bool]
  ```

  the following cli flag got removed:
  ```
  simplified-ui
  ```

  They can be specified in the following way:
  ```
  zellij options --mouse-mode true
  ```
  in order to enable the mouse mode, even if it is turned off in the
  config file:
  ```
  mouse_mode: false
  ```

  The order is now as follows:
  1. corresponding flag (`disable-mouse-mode`)
  2. corresponding option (`mouse-mode`)
  3. corresponding config option (`mouse_mode`)

* add: options and flags for the same value conflict

* example:
  ```
  zellij options --mouse-mode true --disable-mouse-mode`
  ```
  ```
  $ error: The argument '--mouse-mode <mouse-mode>' cannot be used with '--disable-mouse-mode'
  ```
2021-11-11 17:13:34 +01:00
Aram Drevekenin
26bd80be2d chore(version): bump development version 2021-11-10 18:01:56 +01:00
Aram Drevekenin
0fec10b08b chore(release): v0.20.1 2021-11-10 17:54:39 +01:00
Aram Drevekenin
3f408b5251
fix(input): properly query bracketed paste mode in terminals (#858) 2021-11-10 17:41:19 +01:00
a-kenji
abbe3b237a
add(feature): toggle boolean options with cli flag (#855)
add the ability to toggle boolean options with a cli flag:

example:
    if the pane frames are turned off in the config file,
    then passing in the `--no-pane-frames` flag will toggle the
    pane frames on
2021-11-10 13:31:37 +01:00
Ken Matsui
6d60d83e58
fix(envs): Unify operation of Zellij environment variables (#842) 2021-11-10 09:02:17 +01:00
Aram Drevekenin
b232326dc2 chore(version): bump development version 2021-11-08 15:42:46 +01:00
Tw
9ea3dc0dbe
feat(ui): add right-click support to plugins 2021-11-02 18:49:10 +00:00
Aram Drevekenin
6d47d360e1
fix(compatibility): home and end key fix (#815)
* fix(compatibility): handle home/end keys properly from terminfo

* style(fmt): make rustfmt happy

* style(fmt): remove unused import
2021-10-29 15:28:36 +02:00
Aram Drevekenin
21e5ffdfd8
fix(input): properly handle bracketed paste (#810)
* fix(input): properly handle bracketed paste

* style(fmt): make rustfmt happy
2021-10-27 19:20:43 +02:00
Kunal Mohan
164eb6a5b7
Feature: Rotate Pane locations (#802)
fix #165
2021-10-26 09:54:05 +05:30
Brooks J Rady
e0d7212c2a chore(rust): move to 2021 edition
Get with the times, kiddo (and all hail disjoint captures)
2021-10-22 02:21:16 +01:00
Aram Drevekenin
3b2d8f692c chore(version): bump development version 2021-10-20 15:00:32 +02:00
Aram Drevekenin
79fa3594e3 chore(version): bump development version 2021-09-30 11:39:04 +02:00
Aram Drevekenin
3df362d046 chore(version): bump development version 2021-09-30 11:13:33 +02:00
Aram Drevekenin
d7e4ec65db
hotfix(stdin): poll for mouse hold in the stdin thread (#752)
* hotfix(stdin): poll for mouse hold in the stdin thread

* add missing dont panic

* style(fmt): make rustfmt happy
2021-09-30 10:25:48 +02:00
Aram Drevekenin
8d72013d4d chore(version): bump development version 2021-09-29 15:23:22 +02:00
Aram Drevekenin
5c54bf18c2
feat(sessions): mirrored sessions (#740)
* feat(sessions): mirrored sessions

* fix(tests): input units

* style(fmt): make rustfmt happy

* fix(tests): make mirrored sessions e2e test more robust

* refactor(sessions): remove force attach

* style(fmt): rustfmtify

* docs(changelog): update change

* fix(e2e): retry on all errors
2021-09-27 11:29:13 +02:00
spacemaison
c9372212f6
feat(plugin): add manifest to allow for plugin configuration (#660)
* feat(plugins-manifest): Add a plugins manifest to allow for more configuration of plugins

* refactor(plugins-manifest): Better storage of plugin metadata in wasm_vm

* fix(plugins-manifest): Inherit permissions from run configuration

* refactor(plugins-manifest): Rename things for more clarity

- The Plugins/Plugin structs had "Config" appended to them to clarify
  that they're metadata about plugins, and not the plugins themselves.

- The PluginType::OncePerPane variant was renamed to be just
  PluginType::Pane, and the documentation clarified to explain what it
  is.

- The "service" nomenclature was completely removed in favor of
  "headless".

* refactor(plugins-manifest): Move security warning into start plugin

* refactor(plugins-manifest): Remove hack in favor of standard method

* refactor(plugins-manifest): Change display of plugin location

The only time that a plugin location is displayed in Zellij is the
border of the pane. Having `zellij:strider` display instead of just
`strider` was a little annoying, so we're stripping out the scheme
information from a locations display.

* refactor(plugins-manifest): Add a little more documentation

* fix(plugins-manifest): Formatting

Co-authored-by: Jesse Tuchsen <not@disclosing>
2021-09-22 18:13:21 +01:00
Aram Drevekenin
0f3590adb5 chore(version): bump development version 2021-09-15 16:41:07 +02:00
a-kenji
9a5a315aee
Add options subcommand to attach (#718)
fixes #688

- the `options` subcommand of `attach` functions the same,
  as the `options` subcommand of creating the normal session,
  but not every option will have an effect on reattaching,
  for example the `default_mode` setting would make no sense
  to switch.

  In the future it would make sense to be able to hot swap some
  of the options on reattach, but we are not able to do that yet,
  for example the `default_shell` one.

  Eg:

  ```
  zellij attach <session-name> options --theme <theme>
  ```
2021-09-13 16:23:22 +02:00
Paulo Coelho
6d0c5a56f5
style(clippy): various fixes (#704)
* test: fix clippy unused_io_amount

* chore(clippy): various clippy fixes

needless_borrow, let_and_return, vec_init_then_push, unit_arg,
useless_format, field_reassign_with_default, redundant_clone
2021-09-09 10:24:03 +02:00
Aram Drevekenin
7c075ac7e3 chore(version): bump development version 2021-08-31 11:36:09 +02:00
Brooks Rady
76a5bc8a05
feat(ui): overhauled resize and layout systems
* refactor(panes): move to parametric pane sizes

* Fixed the simpler errors by casting to usize

* The least I can do is pass the formatting check...

* Move to stable toolchain

* Well, it compiles?

* And now it doesn't! ;)

* Baseline functionality with the new Dimension type

* Working POC for percent-based resizing

* REVERT THIS COMMIT – DELETES TESTS

* Perfected the discrete resize algorithm

* Fixed fixed-size panes

* Basic bidirectional resize

* feat(resize): finalised parametric resize algorithm

* Reduce the logging level a bit

* Fixed nested layouts using percents

* Bug squishing for implicit sizing

* Here is a funky (read: rubbish) rounding approach

* And now it's gone again!

* Improve discretisation algorithm to fix rounding errors

* Fix the last layout bug (maybe?)

* Mixed explicit and implied percents work now

* Let's pretend that didn't happen...

* Make things a bit less crashy

* Crash slightly more for now (to find bugs)

* Manaually splitting of panes works now

* Start moving to percent-based resizes

* Everything but fullscreen seems to be working

* Fix compilatation errors

* Culled a massive amount of border code

* Why not pause to please rustfmt?

* Turns out I was still missing a few tests...

* Bringing back even more tests!

* Fix tests and pane boarders

* Fix the resize system without gaps

* Fix content offset

* Fixed a bug with pane closing

* Add a hack to fix setting of the viewport

* Fix toggling between shared borders and frames

* fix(tests): make e2e properly use PaneGeom

* style(fmt): make rustfmt happy

* Revert unintentional rounding of borders

* Purge some old borderless stuff

* Fix busted tab-bar shrinking

* Update E2E tests

* Finish implementing fullscreen!

* Don't crash anymore?

* Fix (almost) all tests

* Fix a lack of tab-stops

* All tests passing

* I really can't be bothered to debug a CI issue

* Tie up loose ends

* Knock out some lingering FIXMEs

* Continue to clean things up

* Change some naming and address FIXMEs

* Cull more code + FIXMEs

* Refactor of the resize system + polish

* Only draw frames when absolutely necessary

* Fix the tab-bar crash

* Fix rendering of boarders on reattach

* Fix resizing at small pane sizes

* Deduplicate code in the layout system

* Update tab-bar WASM

* Fixed the pinching of panes during resize

* Unexpose needlessly public type

* Add back a lost test

* Re-add tab tests and get them to compile

* All tabs need layouts

* Start fixing tests + bug in main

* Stabilize the resize algorithm rounding

* All tests from main are now passing

* Cull more dead code
2021-08-28 17:46:24 +01:00
a-kenji
cd0b0119a0 Split tab-layout into template & tabs section
* adjust example layouts and move them from `./example` to
  `./example/layouts`

* simplify the deserialization of the layout

* layouts are now constructed as follows:

```
---
template:
  direction: Horizontal
  parts:
    - direction: Vertical
      borderless: true
      split_size:
        Fixed: 1
      run:
        plugin: tab-bar
    - direction: Vertical
      body: true # <== The body section specifies the position of the
      # inserted tab
    - direction: Vertical
      borderless: true
      split_size:
        Fixed: 2
      run:
        plugin: status-bar
tabs:
  - direction: Vertical
  - direction: Vertical
```
2021-08-26 15:06:59 +02:00
Aram Drevekenin
618c2c376b Merge branch 'tab-layout' of https://github.com/a-kenji/zellij into a-kenji-tab-layout 2021-08-24 10:58:36 +02:00
a-kenji
b1906c893a
Merge pull request #622 from sagittarius-a/feature/go-to-last-tab
feat(tab): add keybind to go to last tab visited
2021-08-23 23:18:43 +02:00
a-kenji
88b4063879 Add template section in layout file
It works as follows:
```
---
template:
  direction: Horizontal
  parts:
    - direction: Vertical
      split_size:
        Fixed: 1
      run:
        plugin: tab-bar
    - direction: Vertical
      body: true
    - direction: Vertical
      split_size:
        Fixed: 2
      run:
        plugin: status-bar
tabs:
  - direction: Vertical
```

The tabs are created in the body section of the template.
2021-08-21 23:27:23 +02:00
Aram Drevekenin
643b7df35c
fix(compatibility): properly paste multilines (#653)
* fix(compatibility): properly paste multilines

* test(input): fix bracketed paste assertion
2021-08-20 16:54:18 +02:00
Sagittarius-a
081c55458d fix: rename action to ToggleTab 2021-08-03 21:12:20 +02:00
Sagittarius-a
5799ea4e5d feat(tab): add keybind to go to last tab visited
Fixes #398.

Tab key is used as default for the `GoToLastTab` action.
2021-08-03 21:11:50 +02:00
a-kenji
485339c584 Merge branch 'main' of https://github.com/zellij-org/zellij into tab-layout 2021-07-23 17:24:45 +02:00
a-kenji
5ede25dc37 Add tabs to layouts
fixes #603, fixes #349

* The layout has now a unique `tabs` section,
  that can be used, like the `parts` section,
  everything that is not inside the tabs section
  is assumed to be present on every single tab
  that is opened.

  This is a BREAKING CHANGE for people that use
  custom `layouts` already, since the `tabs` section
  is not optional - for clarity and intentionality reasons.

  The functionality to specify multiple tabs is already there,
  but is still gated behind a panic, until #621 is fixed.
  So for now one tab can be specified to load on startup.

* The `NewTab` action can optionally be bound to open
  a layout that is assumed to be in the new `tabs` section

  This is a BREAKING CHANGE for people that have the
  `NewTab` action already bound in the config file:

```
- action: [NewTab, ]
  key: [F: 5,]
```
must now be specified as:
```
- action: [NewTab: ,]
  key: [F: 5,]
```
  Optionally a layout that should be opened on the new tab can be
  specified:
```
- action: [NewTab: {
  direction: Vertical,
  parts: [ {direction: Horizontal, split_size: {Percent: 50}}, {direction: Horizontal, run: {command: {cmd: "htop"}}},],
  key: [F: 6,]
```
or:
```
- action: [NewTab: {direction: Vertical, run: {command: {cmd: "htop"} }},]
  key: [F: 7,]
```
or
```
- action: [NewTab: {
  direction: Vertical,
  parts: [ {direction: Vertical, split_size: {Percent: 25},run: {plugin: "strider" }}, {direction: Horizontal}],}, MoveFocus: Left,]
  key: [F: 8,]

```
2021-07-23 17:13:35 +02:00
qepasa
56b7cbf58c
Cleanup Cargo.toml 2021-07-21 07:19:39 +02:00
qepasa
f0bc297743
Merge branch 'main' into unified-logging 2021-07-20 22:19:03 -07:00
Brooks J Rady
6a90542ae3 chore(release): bump development version 2021-07-19 20:35:50 +01:00
Paweł Palenica
27634423d9 Minor fixes 2021-07-17 23:50:24 -07:00
Paweł Palenica
b15cfba6e1 Apply code review suggestions. Rename decorating_pipe to logging_pipe. Add plugin_id to plugin log. Move logger init from file to in-code initialization and change logging file to zellij directory. Change format of timestamp. 2021-07-13 23:29:04 -07:00
Kunal Mohan
67ee63548a Add on_force_close config option 2021-07-09 00:36:47 +05:30
Kunal Mohan
82288c6a3d Remove test feature and hacks 2021-07-06 21:32:43 +05:30