Commit Graph

448 Commits

Author SHA1 Message Date
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
a-kenji
e23bbfddaa
fix: various typos (#1553)
Because they were wrong.
2022-07-02 19:54:50 +02:00
raphCode
7cd355efaf
roll over logs / fix filling up /tmp with logs (#1548)
* roll over logs at 20 MB

* Change cap to 100 kB

* Add fix to changelog
2022-06-28 13:38:43 +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
Ramon
b3fab84557
feat(theme): allow hex colors for themes (#1536)
* feat(theme): allow hex colors for themes

* feat(theme): allow hex strings to start with #

* fix: fix formatting issue

* fix: remove debug print statement

* fix: apply clippy suggestion for # code

Co-authored-by: ramonGonzEdu <rg2872079@gmail.com>
2022-06-24 12:05:34 +09:00
har7an
59d753dc2f
fix: Make key order consistent (#1539)
The order of the "arrow" keys is always left/down/up/right, make the
keybindings for the Scroll mode align with this ordering.
2022-06-23 21:41:57 +02:00
Jae-Heon Ji
8e2be2c61e
feat: add action to undo rename (#1513) 2022-06-18 09:58:42 +09: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
f5a8f95307
chore(deps): update clap: 3.1.18 -> 3.2.2 (#1496) 2022-06-14 18:32:19 +02:00
a-kenji
298ea2d9b7
fix(cli): clear up tooltip information (#1488) 2022-06-11 15:57:25 +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
a-kenji
3ee214ef35
add(option): default_layout (#1467)
* add(option): `default_layout`

Add `option` `default_layout` / `default-layout`,
that allows specifying a different layout, that should
be loaded on start.

Eg:
```
default_layout: compact
```

* add(manpage): `default_layout`
2022-06-07 21:32:04 +02:00
a-kenji
f005c843d8
remove: obsolete comment (#1465) 2022-06-07 20:18:11 +02:00
a-kenji
0f24e684b6
chore(deps): update crossbeam (#1463)
There is a possible race condition in `0.8.0`.
2022-06-07 18:14:05 +02:00
raphCode
92c5c6cb03
Add logging to ipc receiver (#1459)
* Add logging to ipc receiver

* Add to changelog
2022-06-07 17:14:22 +02:00
Aram Drevekenin
6d15af04bd chore(version): bump development version 2022-06-07 15:38:56 +02:00
Cosmin Popescu
e1fcf3a6db
feat(scroll): edit scrollback with default editor (#1456)
* initial commit for opening the current buffer in an editor

* fix(editor): take hidden panes into consideration when manipulating tiled grid

* when closing an edit buffer, take the geometry of the replaced buffer from the closed buffer

* if the floating panels are displayed, don't add to hidden panels the current buffer

* strategy changing - put the panels inside a suppressed_panels HashMap instead of hidden_panels

* Revert "strategy changing - put the panels inside a suppressed_panels HashMap instead of hidden_panels"

This reverts commit c52a203a20.

* remove the floating panes by moving them to the tiled_panes in hidden_panels

* feat(edit): open editor to correct line and don't crash when none is set

* formatting

* feat(edit): use suppressed panes

* style(fmt): rustfmt and logs

* style(fmt): clean up unused code

* test(editor): integration test for suppressing/closing suppressed pane

* test(e2e): editor e2e test

* style(fmt): rustfmt

* feat(edit): update ui and setup

* style(fmt): rustfmt

* feat(config): allow configuring scrollback_editor explicitly

* style(fmt): rustfmt

* chore(repo): build after merging

Co-authored-by: Aram Drevekenin <aram@poor.dev>
2022-06-06 09:20:07 +02:00
a-kenji
d62e6fb57e
add(plugin): compact-bar & compact layout (#1450)
* add(plugin): `compact-bar` & `compact` layout

* add(nix): `compact-bar` plugin

* add(config): `compact-bar` to the config

* add(workspace): `compact-bar` to workspace members

* add(assets): `compact-bar`

* chore(fmt): rustfmt

* add(nix): add `compact-bar`

* add: compact layout to dump command

* nix(build): fix destination of copy command

* add(makefile): add `compact-bar` to `plugin-build`

* add(layout): `compact-bar` to layout

* add: install `compact-bar` plugin

* fix(test): update input plugin test

* fix(plugin): default colors for compact-bar
2022-06-03 11:14:38 +02:00
a-kenji
9dbec05ff9
fix: clarify help text (#1442) 2022-05-30 23:11:36 +02:00
Spyros Roum
2f58835f07
feat(cli): merge --layout and --layout-path (#1426)
* Merge --layout and --layout-path

* Fix e2e tests

* style(comment): reword help text

Co-authored-by: Aram Drevekenin <aram@poor.dev>
2022-05-28 12:20:41 +02:00
Jae-Heon Ji
f7c019743a
fix: add checking for missing extensions (#1432) 2022-05-24 13:09:01 +09:00
Cosmin Popescu
76d871294d
feat(actions): dump the terminal screen into a file (#1375)
* Initial commit for fixing #1353

* adding a new line between the lines_above and the viewport

* changes following code review

* implementing a test case for the dump screen

* implemented test case for dump_screen

* better regexp replace

* fixes following code review

* style(api): remove extraneous method in plugin pane

* style(fmt): rustfmt

* style(tests): fix method name

Co-authored-by: Aram Drevekenin <aram@poor.dev>
2022-05-20 11:22:40 +02:00
Thomas Linford
e663ef2db7
fix: ensure pty_writer thread closes (#1422) 2022-05-17 20:29:06 +02:00
Thomas Linford
e8f9559062
fix(pty): paste freeze with large amounts of text (#1383)
add pty writer thread to avoid screen thread blocking on unistd::write
2022-05-16 21:14:57 +02:00
Jae-Heon Ji
8c38b39ef6
fix: update to output error when using --layout (#1413) 2022-05-12 22:42:31 +09:00
Luke Stadem
a017a6512d
feat: Shows subcommand aliases in help text (#918) (#1409) 2022-05-10 16:36:57 +02:00
a-kenji
b56bfecdf0
fix: a small typo (#1390) 2022-05-10 09:01:18 +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
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
Jae-Heon Ji
be0af7e69c
feat: support the command of auto-start script for shell (#1281) 2022-04-21 00:28:09 +09:00
Jae-Heon Ji
f2a7e73687
fix: minor system improvements (#1328) 2022-04-16 16:11:46 +09:00
Thomas Linford
198625b055
feat(copy): add copy_on_select option (#1298)
* feat(copy): add copy_on_select option

with default value of true, keep current behavior of automatically
copying selection to clipboard when done selecting.
with copy_on_select = false, on mouse release the selection remains, and
can be copied with the `Copy` action.

* add example to default.yaml

* add copy action example to default.yaml, cleanup

* fix updated tab tests

* fix selection changing while scrolling after release

* fix clippy warnings
2022-04-16 09:04:06 +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
85262ba8ad docs(config): add link to theme examples 2022-04-13 15:38:32 +02:00
Aram Drevekenin
25492b448d fix(ui): adjust default bg color 2022-04-13 15:36:04 +02:00
Aram Drevekenin
4f13307828 fix(ui): adjust default colors 2022-04-13 15:23:42 +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
Thomas Linford
ff5773bc6e
chore(deps): update termwiz to 0.16.0 (#1303) 2022-04-07 18:47:36 +02:00
Kunal Mohan
9f716487ca
Improve theme usage + add default ones (#1274)
* Remove gray from theme config and improve colors for dark themes

* improve theme usage

* Add new themes and minor fixes

* improve tokyo-night theme according to new changes

* Fix formatting

* change default black colour

* docs(CHANGELOG): #1274 improve themes
2022-04-02 03:19:42 +05:30
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
18ee784e2d
feat(ui): add navigation with alt + arrow keys (#1264)
* feat(ui): change from non-working alt-brackets to alt-arrows

* style(fmt): rustfmt

* fix: improve parsing of `alt` combination keys

The binding of the keys can now be specified with:

- Alt: 'c'
- Alt: Up
- Alt: Down
- Alt: Left
- Alt: Right

* chore(fmt): rustfmt

Co-authored-by: a-kenji <aks.kenji@protonmail.com>
2022-03-25 14:28:08 +01: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
Jae-Heon Ji
ec319794a5
chore: bump nix version to 0.23.1 (#1234) 2022-03-17 21:29:20 +09:00
a-kenji
092926c5d8
fix(wasm_vm): use cache_dirs for ephemeral plugin data (#1230)
fix(wasm_vm): use `cache_dirs` for ephemeral plugin data

Use proper `cache_directories` by default, that users can be expected
to have proper write permissions for.

The directory is used for plugin hashes, and compilation data.
2022-03-17 11:57:38 +01:00
a-kenji
b0276dfd74
fix(feat): disable_automatic_asset_installation (#1226)
* fix(feat): `disable_automatic_asset_installation`

This fixes a regression in the feature system:
The asset installation didn't get turned off by the feature.

Add error logging to the install functions.

Properly show features in setup

disable `mkdir` in `wasm_vm` on `feature-disable-asset-installation`

Alternative:
    Is this even needed? We make sure the directory is there upon the
    normal asset installation.

fixes #1130
2022-03-17 11:40:09 +01: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
a-kenji
c2e388f339
fix: deprecated function in clap (#1225)
`CommandFactory::into_app()` is deprecated in
favor of `CommandFactory::command()`
2022-03-16 13:15:07 +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
a-kenji
21f7b5baa5
fix(config): allow POSIX style --config override (#1205)
Allow multiple `--config` flags, then use the latter.

Also allows similar behaviour for similar flags.

fixes: #310
2022-03-10 22:19:19 +01:00
Hoang Nguyen
58e816211e
fix(comp): typo in long option '--generate-completion' for fish (#1183) 2022-03-06 19:47:33 +01:00
a-kenji
d341f455ea
fix(comp): typo and add new option (#1178)
Use `-x` for exlusive options
2022-03-05 20:41:58 +01:00
a-kenji
e2ce261210
add(comp): dynamic completions for fish (#1176)
And infrastructure to make it possible
to add more dynamic completions for
different shells in the future.

eg:

```
zellij attach [completes-active-sessions]
zellij kill-session [completes-active-sessions]
```

fixes: #1030
2022-03-05 16:23:51 +01:00
a-kenji
cd4b8ae8b6
fix(layout): allow lowercase keys and values (#1160)
A layout needed to be specified as follows:
```
---
template:
  direction: Horizontal
  parts:
    - direction: Vertical
      body: true
    - direction: Vertical
      borderless: true
      split_size:
        Fixed: 1
```
now the same layout can be specified as:
```
---
template:
  direction: horizontal
  parts:
    - direction: vertical
      body: true
    - direction: vertical
      borderless: true
      split_size:
        fixed: 1
```
2022-03-03 14:08:51 +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
a-kenji
4f84c36024
fix: typo in error message (#1151) 2022-02-28 23:00:47 +01:00
Kerfuffle
e2081f2649
fix: Allow terminal title passthrough even when not drawing pane frames. (#1113)
* fix: Allow terminal title passthrough even when not drawing pane frames.

* Minor formatting fix.

* Handle case where the session name is not set.
2022-02-28 17:54:41 +01:00
Cason Adams
ca015ce9b6
add tmux ctrl+b d shortcut for detach (#1116) 2022-02-27 12:03:17 +01:00
Cason Adams
8577dfca02
add: a few extra tmux binding keys (#1098) 2022-02-24 10:19:02 +01:00
a-kenji
06184e8a32
add(conf): add action to send ^b (#1106)
add an action to send `^b` while in `tmux-mode`

fixes #1095
2022-02-24 04:58:27 +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
a0a0a7e5c4
feat(ux): tmux mode (#1073)
* work

* basic tmux move and functionality

* tmux mode ui

* rustfmt
2022-02-21 15:52:42 +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
Thomas Linford
18709acde9
feat(copy): allow osc52 copy destination configuration (#1022)
add copy_cliboard  option to allow configuring copy destination to primary selection instead of default clipboard
2022-02-02 15:22:34 +01:00
Jae-Heon Ji
1d2e303926
feat: add focus attribute in layout (#958)
* feat(layout): add focus attribute in layout

* feat: add state of focus to tab

* chore: i love clippy

* test(layout): update focus options

* feat: add focus pane

* feat: apply focus-pane when layout is only loaded

* change the instruction name for focus-on-tab

* chore: apply cargo-fmt

* test: add e2e testcase
2022-02-01 02:19:21 +09:00
a-kenji
c82ee774ce
fix(config): warn on mode without actions (#1035)
Log with a warning, if the user finds himself in a mode,
that has no action associated with it.

fix #949
2022-01-31 16:24:06 +01:00
Marcin Puc
e58b67ce2e
chore(deps): update arg parsing to clap v3 (#1017)
* Update arg parsing to clap v3
* Ignore shell argument case
2022-01-23 20:59:03 +01:00
Jordan Callicoat
5f86dc4fd0
doc(config): add copy-command examples to default config (PR #996) (#1019) 2022-01-20 17:36:59 +01:00
Christophe Verbinnen
9cc2645db0
Add a copy command option (#996)
Usage: zellij options --copy-command "xclip -sel clip"

Co-authored-by: Christophe Verbinnen <christophev@knowbe4.com>
2022-01-15 12:38:45 +01:00
Aram Drevekenin
e06300f7db chore(version): bump development version 2022-01-05 11:14:15 +01:00
Kunal Mohan
e23d06b70d
Feature: Configurable scroll buffer (#936)
* Configurable scroll buffer

* Fix unit test failures

* Add scroll_buffer_size description in the default config file

* Fix config file
2022-01-04 23:24:05 +05:30
Aram Drevekenin
d4b14d7657
feat(keybinds): improve default keybindings (#991) 2022-01-04 17:24:18 +01:00
LordMZTE
9e74d8d617
fix(plugins): typo that gives plugins the wrong theme (#975) 2021-12-28 08:58:25 +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
ca8438b0aa
feat(collaboration): implement multiple users (#957)
* work

* feat(collaboration): implement multiple users

* style(cleanup): some leftovers
2021-12-20 17:31:07 +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
Aram Drevekenin
92bddf1b79
fix(plugins): support multiple users (#930)
* fix(plugins): support multiple clients

* fix(style): make clippy happy
2021-12-08 18:41:41 +01:00
Marcin Puc
56e85f87d6
fix(style): various internal refactorings 2021-12-07 10:24:42 +00:00
a-kenji
050fa8fd07
fix(config): unbind keys correctly (#925)
* turn off the merging of key bindings of layout and configuration
  files for now.

  In certain situations the keybindings would be overwritten.

  Fix #923
2021-12-04 16:06:20 +01:00
a-kenji
b78a6d4258
fix(assets): update config option examples (#920)
* update config option examples:
  ```
  no_pane_frames -> pane_frames
  no_mouse_mode -> mouse_mode
  ```

closes #916
2021-12-03 11:13:56 +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
a-kenji
adee5e78a9
fix(theme): add gray to theme (#914)
fix #912

* Add `gray` to theme
2021-11-30 11:03:20 +01:00
Tw
d7e460a3d6
Fix: missing theme in config (#913)
Signed-off-by: Tw <wei.tan@intel.com>
2021-11-30 09:46:48 +01:00
Aram Drevekenin
1ee743156c chore(version): bump development version 2021-11-29 10:09:22 +01:00
Brooks J Rady
7cb165f0c2 fix(style): remove unused imports 2021-11-27 15:35:37 +00:00
Aram Drevekenin
6c6a4393f4
This adds a UI for multiple users in panes (behind a feature flag) (#897)
* feat(ui): multiple users in panes

* style(fmt): make rustfmt happy

* style(fmt): make clippy happy
2021-11-25 16:21:59 +01:00
a-kenji
cd55c86260
Feat: add esc to exit modes (#889)
* Add ability to return to normal mode from any mode,
  except for the locked mode, by pressing the escape key
  to the default keybindings

  fix #887
2021-11-23 12:42:15 +01:00
a-kenji
b861baa6a1
First attempt to provide an overlay prompt (#871) 2021-11-15 20:13:05 +01:00
a-kenji
f6813df0e8
fix(typo): fix setup --check (#869) 2021-11-15 14:41:19 +01:00
a-kenji
347e02ea35
feature(layout): add layout config (#866)
feature(layout): add layout config (#866)
* It is now possible to configure zellij through a layout:

  The config file and the layout file will be merged, on conflicting
  options the order is as follows:
  1. config options `zellij options`
  2. layout
  3. config

  Example:
```
---
template:
  direction: Horizontal
  parts:
    - direction: Vertical
      body: true
    - direction: Vertical
      borderless: true
      split_size:
        Fixed: 1
      run:
        plugin:
          location: "zellij:tab-bar"
default_shell: fish
```
2021-11-14 22:58:20 +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
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
Jae-Heon Ji
4838f0b52c
feat: add initial session name to layout template (#789)
* feat: add session configuration to layout template

WIP: prototyping for issue #611

* test(layout): add session name

* feat(layout): add cond flow to check session name

* feat(layout): update session

* feat: add function to attach a session

* fix(layout): update feedback

* attach option only works when layout template exists.

* feat(layout): add conditional for session-layout

* update default attach value
2021-11-08 19:43:51 +01:00
Aram Drevekenin
b232326dc2 chore(version): bump development version 2021-11-08 15:42:46 +01:00
oromate
8f06f119fd
feat(scrolling): half-page scroll actions (#813)
* Half-page scroll actions #794

* fix(performance): do not hang when resizing large line wraps (#814)

* fix(performance): do not hang when resizing large line wraps

* style(fmt): make rustfmt happy

* style(clippy): make clippy happy

* docs(changelog): scroll fix

* 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

* docs(changelog): home end key fix

* docs(changelog): fix link

* fix(typo): Correct typo from `occured` to `occurred` (#821)

* docs(changelog): fix a typo

* fix(docs): fix wrong arguments for `cargo make run` given in CONTRIBUTING.md (#819)

* docs(changelog): update `cargo-make` for `v0.35.3`

* fix(warning): Fix an unused import warning of std::fs on macos (#820)

* docs(changelog): fix unused import on darwin

* add: `WriteChars` action (#825)

* Behaves like the `Write` action, but one can specify
  strings themselves instead of their bytecodes.

  Usage:

  WriteChars: "cargo make test",

* docs(changelog): Add `WriteChars` action

* fix(docs): Fix a typo and some grammatical errors in bug_report.md (#826)

* docs(changelog): fix typo bug_report template

* add: `rust-version` (msrv) field to `Cargo.toml` (#828)

* specifies the minimum version the package can be compiled with,
  may be ignored with `--ignore-rust-version` option

  ref: https://doc.rust-lang.org/nightly/cargo/reference/manifest.html#the-rust-version-field

* docs(changelog): add `rust-version` to `Cargo.toml`

* fix(unix): forkpty => openpty (#830)

* fix(unix): forkpty => openpty

* style(fmt): make rustfmt happy

* docs(changelog): forkpty => openpty

* Fix: move `colors_transform` to `colorsys` (#832)

* `colors_transform` is deprecated and superceded by `colorsys`

  ref: https://crates.io/crates/colors-transform

* docs(changelog): `colors_transform` to `colorsys`

* feat(ui): add right-click support to plugins

* chore(docs): update changelog

* chore(warnings): remove unused imports (#833)

* rename var sroll_rows and review snapshots

* style(fmt): make rustfmt happy

Co-authored-by: Aram Drevekenin <aram@poor.dev>
Co-authored-by: Ken Matsui <26405363+ken-matsui@users.noreply.github.com>
Co-authored-by: a-kenji <aks.kenji@protonmail.com>
Co-authored-by: Tw <tw19881113@gmail.com>
Co-authored-by: Brooks Rady <b.j.rady@gmail.com>
2021-11-08 15:05:47 +01:00
a-kenji
808458ec7b Merge branch 'support-first-option-in-attach-subcommand-to-attach-the-first-session' of https://github.com/ken-matsui/zellij into ken-matsui-support-first-option-in-attach-subcommand-to-attach-the-first-session 2021-11-05 21:57:01 +01:00
Ken Matsui
4acb2458d2
feat(attach): Support --index option to choose specific session by provided number in active sessions ordered by creation date, resolve #823
feat(attach): Support `--first` option for `attach` sub-command to let zellij choose the alphabetically first session; resolve #823

fix(attach-first): Fix `--first` option to choose the first created session in the existent sessions

feat(attach): Support `--index` option to choose the session indexed by provided number like -t option of tmux

feat(attach): Support listing active sessions with index when a provided number is not found in the active sessions

feat(attach): Support listing active sessions with index when a provided number is not found in the active sessions

feat: Add anyhow to uniformly treat error types and avoid panics
2021-11-06 05:15:09 +09:00
Ken Matsui
f9cb23af65
fix(errors): Introduce thiserror to make error types simpler (#836) 2021-11-05 20:45:57 +01:00
Ken Matsui
8ef1d10df9
fix(errors): Add colored crate to replace primitive color formatting (#837) 2021-11-05 20:39:14 +01:00
Henil Dedania
4ac9344085
feature(resize): Non directional resize (#520)
* feature(resize): Non directional resize

* Implement special cases

* fix resizing for panes that have `+` cross section

* fix resizing for panes that have `T` cross section

* fix panics

* Add Nondirection resize keys to plugin

* fix formatting

* fix: clippy warnings

* fix the last edge case

* implemented some of the suggested changes

* Remove helper function and elevate comment to top of function

* Use `=` to keep it consistent with Normal mode mapping as its easier to use

* Remove extra reference borrowing

* fix an edge case

* add test for nondirectional resize increase/decrease

* fix(controls): add + to resize

* refactor(resize): simplify methods

* fix(resize): properly resize opposite corner pane

Co-authored-by: Aram Drevekenin <aram@poor.dev>
2021-11-05 09:29:45 +01:00
a-kenji
f62ccd2a5c
add: try_from for ConfigFromYaml -> Config (#835) 2021-11-03 19:58:40 +01:00
Tw
9ea3dc0dbe
feat(ui): add right-click support to plugins 2021-11-02 18:49:10 +00:00
a-kenji
070de7a4d1
Fix: move colors_transform to colorsys (#832)
* `colors_transform` is deprecated and superceded by `colorsys`

  ref: https://crates.io/crates/colors-transform
2021-11-02 11:46:06 +01:00
a-kenji
d2b81293df
add: WriteChars action (#825)
* Behaves like the `Write` action, but one can specify
  strings themselves instead of their bytecodes.

  Usage:

  WriteChars: "cargo make test",
2021-11-01 08:52:55 +01:00
Ken Matsui
f902f3ed1d
fix(typo): Correct typo from occured to occurred (#821) 2021-10-31 20:39:57 +01: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
Kunal Mohan
164eb6a5b7
Feature: Rotate Pane locations (#802)
fix #165
2021-10-26 09:54:05 +05:30
a-kenji
a2a0299ea5
add(setup): change the links to be hyperlinks (#768)
- change the links in the setup command to be viable hyperlinks
  according to:
  https://gist.github.com/egmontkob/eb114294efbcd5adb1944c9f3cb5feda
2021-10-25 20:08:30 +02:00
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
Kunal Mohan
d90e3d4cac
Feature: Move panes directionally (#762)
* Feature: Move panes directionally

* change keybinds

* Fix active pane after move

* Add a separate 'Move' mode

* Add tests

* Add more tests

* Send resize message to pty

* wrap set_terminal_size_using_fd() in macro

* change keybind for Move mode

* cargo fmt

* fix test

* move render functions from tab.rs to screen.rs

* undo wrong keybinds
2021-10-19 20:20:28 +05:30
Thomas Linford
76a96b538b
logging: remove unused log functions, change log file const to new file (#779) 2021-10-18 10:52:58 +02:00
Thomas Linford
45af3e4279
Preserve current umask (#777)
* preserve umask when starting server

* make sure log files are created with explicit permissions
2021-10-12 18:11:16 +05:30
Jae-Heon Ji
0ca5c18729
feat(cli): add kill-session command (#745)
* feat: add kill-session command

* style: apply formatting rules

* feat: add new instruction for kill-session

* feat: update feedback of kill-session

* separation of command `kill-session` and `kill-all-sessions` function.
* Add information to various situations
* Add a question (yes or no) when executing the `kill-all-sessions`
  command.

* chore: adjust clippy warning

* fix warning wording

* make rustfmt happy

Co-authored-by: Aram Drevekenin <aram@poor.dev>
2021-10-11 16:57:56 +02:00
Aram Drevekenin
f2401d0b25
refactor(clients): support multiple clients in tab/screen rendering infra (#770) 2021-10-07 15:22:20 +02:00
a-kenji
46a9ead668
add(config): add information to the config file (#766)
- add information to configuration directly to the config file
2021-10-05 20:08:00 +02:00
a-kenji
0ca28486a5
fix(setup): switch setup order (#765)
- commands that don't use the config file now wont throw an error on
  malformed config files
2021-10-05 13:43:05 +02:00
a-kenji
d667dc2a87
feat(config): Allow empty config files (#720)
Fix #714

Allow empty `config` and `layout` files

- Currently empty files are parsed as yaml documents, since they
  are empty they are invalid yaml files and a deseralization error would
  follow.

  Now we ignore the incorrect yaml on an empty document and treat it as
  an empty yaml document.

  Eg:
  ```
  ```
  and
  ```
  ---
  ```

  Are now treated equally.

Alternative: Keep treating the files as `yaml` documents.
2021-10-01 21:49:47 +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
a-kenji
bbe2583904
feat(layout): specify only tab name in tabs section (#722)
Allow specifying only the tab name in the `tabs` section

- For example this is now possible:
```
tabs:
  - name: first
    parts:
      - direction: Vertical
      - direction: Vertical
  - name: second
  - name: third
```
  For that the tab section defaults the direction to
  `direction::Horizontal`

- Adds an error upon specifying a tab name inside the `parts` section
  of the tab-layout
2021-09-21 16:39:37 +02:00
GPery
b761a28702
Implement attach --create subcommand flag to create session if one does not exist (#731)
* Implement attach --create

* fixup! Implement attach --create

* fixup! Implement attach --create

* fixup! Implement attach --create

* fixup! Implement attach --create
2021-09-19 18:17:52 +05:30
Aram Drevekenin
0f3590adb5 chore(version): bump development version 2021-09-15 16:41:07 +02:00
Aram Drevekenin
b1f17a624c fix(keys): bring back ctrl-n to get from scroll mode to resize mode 2021-09-15 14:03:55 +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
a-kenji
2771b247ac
Improve handling of empty valid yaml files (#716)
Improves the way empty valid `yaml` files are handled.
When deserializing a `config` or `layout` file, that is
an empty valid `yaml` file, eg:

```
---
```

We now assume the default configuration is desired.
2021-09-13 12:24:19 +02:00
Tw
da2a9b5c18
feat(screen): support specifying tab's name in layout (#715)
Signed-off-by: Tw <tw19881113@gmail.com>
2021-09-13 11:56:33 +02:00
Paulo Coelho
aae9c9c807
Calculate width with unicode-width in tab-bar and utils (#709)
* fix(tab-bar): calculate string width using unicode-width

* fix(utils): calculate ansi_len using unicode-width
2021-09-12 20:29:07 +02:00
spacemaison
4f94f95c90
feat(cwd-pane): Keeping the cwd when opening new panes (#691)
* feat(cwd-pane): Add a new trait to get the cwd of a given pid

Co-authored-by: Quentin Rasmont <qrasmont@gmail.com>

* feat(cwd-pane): Allow for setting the cwd when spawning a new terminal

Co-authored-by: Quentin Rasmont <qrasmont@gmail.com>

* feat(cwd-pane): Add an active_pane field to the Pty struct

Co-authored-by: Quentin Rasmont <qrasmont@gmail.com>

* feat(cwd-pane): Update Pty with Tab's active pane id

Co-authored-by: Quentin Rasmont <qrasmont@gmail.com>

* feat(cwd-pane): Refactor spawn_terminal to use cwd by default

Co-authored-by: Quentin Rasmont <qrasmont@gmail.com>

* feat(cwd-pane): Fix tests and lints

Co-authored-by: Quentin Rasmont <qrasmont@gmail.com>

* feat(cwd-pane): Fix formatting

* feat(cwd-pane): Refactor child pid fetching to handle errors better

Instead of panicking when transfering the process id of the forked child
command we just return an empty process id.

* feat(cwd-pane): Add non Linux/MacOS targets for the get_cwd method.

This will allow Zellij to compile on non Linux/MacOS targets without
having an inherited cwd.

* feat(cwd-pane): Refactor spawn_terminal method to use ChildId struct.

The spawn_terminal methods been refactored to use the ChildId struct in
order to clarify what the Pid's returned by it are. The documentation
for the ChildId struct was improved as well.

* feat(cwd-pane): Fix tests/lints

Co-authored-by: Jesse Tuchsen <not@disclosing>
Co-authored-by: Quentin Rasmont <qrasmont@gmail.com>
2021-09-10 17:35:06 +02:00
Tw
19b3f8366f
feat(plugin): add exec_cmd helper for executing command in host
Signed-off-by: Tw <wei.tan@intel.com>
Signed-off-by: Tw <tw19881113@gmail.com>
2021-09-09 11:45:03 +01: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
a51f500c17
fix(ui): change resize binding to Ctrl-n
* fix(ui): change resize binding to Ctrl-n

* Fix tests?

* Actually update the keybind in tests

* Cowardly refuse to fix the E2E testing issue
2021-08-30 18:02:14 +01: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
06e3be6205 test(layout): add borderless 2021-08-24 15:02:21 +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
a37d3e5889
feat(ui): pane frames (new pane UI) (#643)
* work

* resize working

* move focus working

* close pane working

* selection and fullscreen working

* pane title line

* titles and conditional scroll title

* whole tab resize working

* plugin frames working

* plugin splitting working

* truncate pane frame titles

* cleanup

* panes always draw their own borders - also fix gap

* toggle pane frames

* move toggle to screen and fix some bugs

* fix plugin frame toggle

* fix terminal window resize

* fix scrolling and fullscreen bugs

* unit tests passing

* e2e tests passing and new test for new frames added

* refactor: TerminalPane and PluginPane

* refactor: Tab

* refactor: moar Tab

* refactor: Boundaries

* only render and calculate boundaries when there are no pane frames

* refactor: Layout

* fix(grid): properly resize when coming back from alternative viewport

* style: remove commented code

* style: fmt

* style: fmt

* style: fmt + clippy

* docs(changelog): update change
2021-08-12 14:50:00 +02:00
Sagittarius-a
081c55458d fix: rename action to ToggleTab 2021-08-03 21:12:20 +02:00
Sagittarius-a
404faf0498 fix: fix toggle to previous tab when deleting tabs 2021-08-03 21:12:20 +02:00
Sagittarius-a
734636637d fix: rename variable as stated in pull request 2021-08-03 21:12:19 +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
2e17756785 Change layout panics to errors
* Adjust and add tests for the change
2021-08-02 12:07:30 +02:00
a-kenji
fc7bc3cc8b Merge branch 'main' of https://github.com/zellij-org/zellij into tab-layout 2021-08-01 20:25:33 +02:00
a-kenji
331807c16a Simplify deserialization for layouts, config
Simplify deserialzation for layouts, config and config options.

Move the logic responsible to `Setup::from_options()` in order
to be able to parse `main.rs` as well as adding new command easier.
2021-07-28 18:17:49 +02:00
Sagittarius-a
7da214fcca feat(scroll): Restore scroll position on SIGINT
Fixes #606

Currently scroll down to bottom then exits scroll mode.
2021-07-24 21:28:19 +02:00
a-kenji
f323880fb7 !fixup cargo fmt 2021-07-23 17:25:05 +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
a-kenji
e2d086d591
Merge pull request #623 from a-kenji/feature/dump-layout
Add cmd to dump `layout` to stdout
2021-07-22 18:44:29 +02:00
a-kenji
903cb68a40 Add cmd to dump layout to stdout
Adds the ability to dump the default layouts to
stdout, similar to the `zellij setup --dump-config`,
but now it needs the name of a currently existing
layout:

- default
- strider
- disable-status

`zellij setup --dump-layout [LAYOUT]`
2021-07-22 16:40:36 +02:00
a-kenji
c9ccfb2919
Merge branch 'main' into display-session-name 2021-07-22 16:12:35 +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
Lovecraftian Horror
eb6e49c260 Move ModeInfo::new() back to get_mode_info() 2021-07-09 15:21:47 -04:00
a-kenji
22b30599d8
Merge pull request #612 from a-kenji/improve-options
Improve options
2021-07-09 17:25:27 +02:00
a-kenji
0ab00e2c6c
Merge pull request #600 from a-kenji/layout-command
Add commands to layout
2021-07-09 16:58:29 +02:00
a-kenji
261e691f9f Add commands to layout
Add the ability to run commands on loading a layout:
```
  - direction: Horizontal
    split_size:
      Percent: 50
    run:
      command: {cmd: htop}
```
or respectively:
```
  - direction: Horizontal
    split_size:
      Percent: 50
    run:
      command: {cmd: htop, args: ["-C"]}
```

In order to specify the difference of commands and
plugins now the plugins need to be under the `run` section:
```
  - direction: Vertical
    split_size:
      Fixed: 2
    run:
      plugin: status-bar
```
This also means that this is a breaking change for people
that already have a custom layout.

Example layouts:
```
---
direction: Vertical
parts:
  - direction: Horizontal
    split_size:
      Percent: 50
    parts:
      - direction: Vertical
        split_size:
          Percent: 50
      - direction: Vertical
        split_size:
          Percent: 50
        run:
          command: {cmd: htop}
  - direction: Horizontal
    split_size:
      Percent: 50
    run:
      command: {cmd: htop}
```
and:
```
---
direction: Horizontal
parts:
  - direction: Vertical
    split_size:
      Fixed: 1
    run:
      plugin: tab-bar
  - direction: Vertical
    parts:
    - direction: Vertical
      parts:
      - direction: Vertical
        split_size:
          Percent: 50
        run:
          command: {cmd: htop}
      - direction: Vertical
        split_size:
          Percent: 50
        run:
          command: {cmd: htop, args: ["-C"]}
  - direction: Vertical
    split_size:
      Fixed: 5
  - direction: Vertical
    split_size:
      Fixed: 2
    run:
      plugin: status-bar
```

closes #551, closes #284
2021-07-09 16:43:44 +02:00
a-kenji
8363705939 Add serde-alias for on_force_close
* It doesn't deserialize from the configuration otherwise,
  if specified in lower-case.

Alternative: use a rename.
2021-07-09 15:05:47 +02:00
a-kenji
cf8d5a7a4d Use lowercase for options 2021-07-09 13:11:02 +02:00
a-kenji
89f84ecd3f Simplify merging of options 2021-07-09 13:09:05 +02:00
a-kenji
6299660d5c Add doc-comment for mouse-mode 2021-07-09 11:57:52 +02:00
a-kenji
337674b073 Improve clarity of precedence in options 2021-07-09 11:56:49 +02:00
qepasa
a38c176646
Update Cargo.toml 2021-07-09 07:56:54 +02:00
qepasa
45d2992a3f
Merge branch 'main' into unified-logging 2021-07-08 22:55:50 -07:00
Paweł Palenica
a076d9ef14 Cleanup 2021-07-08 21:49:56 -07:00
Paweł Palenica
13b5d1e58f Add padding to logger 2021-07-08 21:43:19 -07:00
Kunal Mohan
56af1d8640 Add doc comment for the on_force_close option 2021-07-09 00:42:06 +05:30
Kunal Mohan
67ee63548a Add on_force_close config option 2021-07-09 00:36:47 +05:30
Lovecraftian Horror
4fcf558156 Display session name within session 2021-07-08 14:16:25 -04:00
Paweł Palenica
ba21b86435 Cleanup log config file a bit, make format verbose so everyone can understand it without looking into log4rs docs 2021-07-07 23:27:07 -07:00
a-kenji
af86edcf99 Change name of Run binding for actions
* Change
```
Run: {command: <path>, args: [ARGS], direction:<direction> }
```
into
```
Run: {cmd: <path>, args: [ARGS], direction:<direction> }
```
2021-07-06 23:42:05 +02:00
Kunal Mohan
e2949509a2 Add custom function for unit test in zellij-utils 2021-07-06 21:32:44 +05:30
Kunal Mohan
82288c6a3d Remove test feature and hacks 2021-07-06 21:32:43 +05:30
Aram Drevekenin
7fe87f59a3 chore(version): bump development version 2021-07-05 11:04:51 +02:00
a-kenji
6bcd84f6d5 Add layout-dir to setup --check subcommand 2021-07-04 14:23:52 +02:00
Thomas Linford
f93308f211
feat(ui): initial mouse support (#448)
* Initial mouse support

* enable mouse support (termion MouseTerminal)
* handle scroll up and down events

* Allow enabling/disabling of mouse reporting

Store the mouse terminal on OsInputOutput

* WIP: switch pane focus with mouse

* testing to get mouse character selection

* wip mouse selection

* wip: mouse selection

- initial handling of mouse events for
  text selection within a pane
- wide characters currently problematic
- selection is not highlighted

* highlight currently selected text

* improve get currently selected text from TerminalPane

* copy selection to clipboard (wayland only for now)

* Add missing set_should_render on selection update

* Improve text selection

- Strip whitespace from end of lines
- Insert newlines when selection spans multiple lines

* Simplify selection logic

- Remove Range struct
- Selection is not an Option anymore, it's empty when start == end

* copy selection to clipboard with OSC-52 sequence

* Improve text selection with multiple panes

- Constrain mouse hold and release events to currently active pane
- Fix calculation of columns with side by side panes

* fix for PositionAndSize changes

* Fix mouse selection with full screen pane.

- Transform mouse event positions to relative when passing to pane.

* Move selection to grid, rework highlighting.

- Mark selected lines for update in grid output buffer, for now in the
  simplest way possible, but can be made more efficient by calculating
  changed lines only.
- Clear selection on pane resize.
- Re-add logic to forward mouse hold and release events only to
  currently active pane.

* Tidy up selection

- add method to get selection line range
- add method to sort the current selection

* Grid: move current selection up/down when scrolling

- Make the selection work with lines in lines_above and lines_below
- Todo: update selection end when scrolling with mouse button being held
- Todo: figure out how to move selection when new characters are added.

* Grid: move selection when new lines are added

* Keep track of selection being active

- Handle the selection growing/shrinking when scrolling with mouse
  button held down but not yet released.

* Improve selection end with multiple panes

* Tidying up

- remove logging statements, unused code

* Add some unit tests for selection, move position to zellij-utils

* Change Position::new to take i32 for line

* Grid: add unit tests for copy from selection

* add basic integration test for mouse pane focus

* Add basic integration test for mouse scroll

* Use color from palette for selection rendering

* Improve performance of selection render

- Try to minimize lines to update on selection start/update/end

* fixes for updated start method

* fix lines not in viewport being marked for rendering

- the previous optimization to grid selection rendering was always
adding the lines at the extremes of previous selection, causing problems
when scrolling up or down
- make sure to only add lines in viewport

* Disable mouse mode on exit

* use saturating_sub for usize subtractions

* copy selection to clipboard on mouse release

* disable mouse on exit after error

* remove left-over comments

* remove copy keybinding

* add default impl for selection methods in Pane

- remove the useless methods from Impl Pane in PluginPane

* move line diff between selections to selection

* add option to disable mouse mode

* Allow scrolling with mouse while selecting.

* move action repeater to os_input_output, change timeout to 10ms

- change repeater to take an action instead of a position with hardcoded
action

* replace mouse mode integration tests with e2e tests

* cleanup

* cleanup

* check if mouse mode is disabled from merged options

* fix missing changes in tests, cleanup
2021-07-02 16:40:50 +02:00
a-kenji
5c3759e155
Merge pull request #596 from a-kenji/run-command-action
Add running commands to an action
2021-07-02 14:06:36 +02:00
a-kenji
0bf78100dd Add running commands to an action
Add the ability to bind running commands to
an action.

Eg:
```
- action: [Run: {command: "htop",},]
  key: [F: 6,]
``

Optionally the direction and arguments can be
specified:

```
- action: [Run: {command: "htop", args: ["-C",]},]
  key: [F: 7,]
```
The directional splits are analogous to the `[NewPane]` splits.
```
- action: [Run: {command: "htop", args: ["-C",], direction: "Up"},]
  key: [F: 8,]
```
2021-07-02 13:39:02 +02:00
a-kenji
6f1c103e02 Add option to specify default-shell
* Adds an option to specify a default shell
  either by specifying `default_shell: [PATH]`
  in the config, or running zellij with
  `zellij options --default-shell [PATH]`
2021-07-01 20:02:08 +02:00
a-kenji
242e41d67f Merge branch 'main' of https://github.com/zellij-org/zellij into modularize-spawn-terminal 2021-06-30 18:59:55 +02:00
a-kenji
f9e01c04e1 Modularize spawn_terminal_function
* Breaks the spawn_terminal_function up
  in order to prepare for more functionality.
2021-06-30 11:46:43 +02:00
Aram Drevekenin
ed4fd2a8e7
chore(tests): move all integration tests to be either unit or e2e tests - remove old testing infra (#589)
* tests(integration): move basic integration tests to be unit tests

* fix(tests): silently fail threadbus for tests

* tests(unit): move compatibility tests to become unit tests for grid

* tests(unit): move close_pane tests to become unit tests for grid

* tests(e2e): move basic layout test to e2e

* tests(unit): move move_focus tests to be unit tests

* tests(unit): move resize_down tests to be unit tests

* tests(unit): move resize_left tests to be unit tests

* tests(unit): move resize_right tests to be unit tests

* tests(unit): move resize_up tests to be unit tests

* tests(infra): remove unused infra

* style(fmt): make rustfmt happy

* debug

* debug

* debug

* debug

* chore(test): shift volume mounting around because github actions is a special child
2021-06-30 11:27:35 +02:00
Paweł Palenica
0c570a52f5 feat: Add logger to Zellij
We add log4rs create for logging across Zellij. Additionally, we capture
`stderr` output from plugins and log it the same log file as other
Zellij logs.
2021-06-29 23:46:00 -07:00
a-kenji
b3b9175081 chore(clippy): needless_borrow 2021-06-29 23:02:51 +02:00
a-kenji
a9088264eb Change layout directory from data to config
* default layouts won't be installed by anymore,
  instead they will be directly loaded

* `layout-dir` is now a subdirectory of the
  `config-dir` by default, instead of the `data-dir`

  POSSIBLE BREAKING CHANGE:
  In case of having custom layouts in the previous
  `layout-dir` one can switch either the layouts to
  the new dir, or set the `layout-dir` to be the current
  `layout-dir`

* it is possible to change the location of the `layout-dir`:
  - `zellij options --layout-dir [LAYOUR_DIR]`
  - `layout_dir: [LAYOUT_DIR]`
2021-06-16 17:09:05 +02:00
a-kenji
4743b7e7ab Merge branch 'main' of https://github.com/zellij-org/zellij into layout-error 2021-06-14 22:05:25 +02:00
a-kenji
cafcca0c57 Move layout.rs from server to utils
* give feedback on most errors in the layout-file
2021-06-14 21:55:17 +02:00
Brooks J Rady
dc44a00699 chore(release): bump development version 2021-06-04 10:28:03 +01:00
Brooks J Rady
5164bd99b7 Fixed a build warning and renamed a struct field 2021-06-03 12:38:23 +01:00
Brooks J Rady
98c29832e1 Merge branch 'main' into resize-overhaul 2021-06-01 18:05:32 +01:00
a-kenji
62e7c37688 Fix options in config file
* options depended on specification of the
`simplified_ui` flag, now they are independend of each other
2021-06-01 09:07:41 +02:00
a-kenji
0be151fa28 Merge branch 'main' of https://github.com/zellij-org/zellij into theme-config 2021-05-30 15:17:55 +02:00
a-kenji
ce73b6cca0 Add color theme config
* add option `theme` that allows for setting of a theme,
the default is `default`

* under `themes` the themes can be described as follows:

either:
```
themes:
  default:
    fg: [0,0,0]
    bg: [0,0,0]
    black: [0,0,0]
    red: [0,0,0]
    green: [0,0,0]
    yellow: [0,0,0]
    blue: [0,0,0]
    magenta: [0,0,0]
    cyan: [0,0,0]
    white: [0,0,0]
    orange: [0,0,0]
```
or
```
themes:
  default:
    fg: 0
    bg: 0
    black: 0
    red: 0
    green: 0
    yellow: 0
    blue: 0
    magenta: 0
    cyan: 0
    white: 0
    orange: 0
```

If the key is different from default, it needs to either be specified on
start with `options --theme [THEME]`, or in the configuration file under
theme: [THEME].

closes #390
2021-05-30 15:07:21 +02:00
Brooks J Rady
f2c5ee44f7 Getting back to where we started... (Buggy Resizing) 2021-05-29 23:12:11 +01:00
a-kenji
70d9d2cf4f Add default_mode to attach
* Attaching a new session now also respects the
  default_mode setting of the client
2021-05-29 19:08:36 +02:00
a-kenji
4c079ca25d
Merge pull request #513 from a-kenji/default-mode-368
Default mode 368
2021-05-29 18:18:30 +02:00
Kunal Mohan
0bd05cbcb4 Make session-name option in attach command
If only one session is running, attach to it.
Otherwise list the active sessions (if any)
2021-05-29 00:32:06 +05:30
Aram Drevekenin
d54c82420e chore(version): bump development version 2021-05-28 14:35:34 +02:00
Aram Drevekenin
1c69d70082 chore(version): change to patch version 2021-05-28 14:05:52 +02:00
kxt
0c0355dbc6
refactors for #525 (#534)
* refactor(fakes): clean up add_terminal_input

* refactor(fakes): append whole buf to output_buffer in FakeStdoutWriter::write

* refactor(fakes): append whole buf to output_buffer in FakeInputOutput::write_to_tty_stdin

* fix(fakes): allow partial reads in read_from_tty_stdout

This patch fixes two bugs in read_from_tty_stdout:
* if there was a partial read (ie. `bytes.read_position` is not 0 but
less than `bytes.content.len()`), subsequent calls to would fill `buf`
starting at index `bytes.read_position` instead of 0, leaving range
0..`bytes.read_position` untouched.
* if `buf` was smaller than `bytes.content.len()`, a panic would occur.

* refactor(channels): use crossbeam instead of mpsc

This patch replaces mpsc with crossbeam channels because crossbeam
supports selecting on multiple channels which will be necessary in a
subsequent patch.

* refactor(threadbus): allow multiple receivers in Bus

This patch changes Bus to use multiple receivers. Method `recv` returns
data from all of them. This will be used in a subsequent patch for
receiving from bounded and unbounded queues at the same time.

* refactor(channels): remove SenderType enum

This enum has only one variant, so the entire enum can be replaced with
the innards of said variant.

* refactor(channels): remove Send+Sync trait implementations

The implementation of these traits is not necessary, as
SenderWithContext is automatically Send and Sync for every T and
ErrorContext that's Send and Sync.
2021-05-27 16:28:28 +02:00
a-kenji
81b026df24 Merge branch 'main' of https://github.com/zellij-org/zellij into default-mode-368
* If starting in the locked mode after the merge,
the locked mode seems to need 2 actions to go to
the normal mode - after that everything works
as expected.

- This is not intended.
2021-05-27 15:49:50 +02:00
Aram Drevekenin
9bdb40b4c6 chore(version): bump development version 2021-05-27 14:41:33 +02:00
a-kenji
4e62b3a1b5 Move config assets to zellij-utils crate
* The assets macro seems to not be able to
read across create boundaries.
Now the assets are included in the crate they are used in.
2021-05-27 13:41:17 +02:00
Kunal Mohan
cb3072066d hotfix(publish): Move install module and asset_map to main zellij package. publish should hopefully work now. 2021-05-27 15:30:14 +05:30
Kunal Mohan
0621ba8f34 Allow user to specify session name 2021-05-22 22:21:26 +05:30
Kunal Mohan
62a2d9cff2 join router threads on exit 2021-05-22 22:19:50 +05:30
Kunal Mohan
fa0a7e05c3 Add ability to attach to sessions 2021-05-22 22:19:50 +05:30
Kunal Mohan
ac082a1c93 add keybinds for session mode and detach 2021-05-22 22:19:50 +05:30
Kunal Mohan
b8acf19071 Use Action enum for Quit and detach instead of separate messages under ClientToServerMsg 2021-05-22 22:19:50 +05:30
Kunal Mohan
61aa104576 Add ability to detach a session 2021-05-22 22:19:50 +05:30
Kunal Mohan
d231d28d7c Implement the minimal list-sessions command 2021-05-22 22:19:50 +05:30
Kunal Mohan
d6fc7b04d1 add attach and list sessions subcommand to CliArgs 2021-05-22 22:19:50 +05:30
a-kenji
95964d5f87 Add documentation to actions struct
* Add warning for renaming the actions
2021-05-22 10:16:03 +02:00
a-kenji
658df7ac17 Change Description of Config Flags
* Make distinction clearer between certain
  flags
2021-05-22 09:49:01 +02:00
Kunal Mohan
b20ac47d68
Merge pull request #522 from zellij-org/re-export-dependencies
Re-export common dependencies from zellij-utils
2021-05-19 11:21:33 +05:30
Kunal Mohan
040d10df0f Re-export common dependencies from zellij-utils 2021-05-19 01:35:53 +05:30
kxt
68445af63f
refactor(IO): random fixes (#521)
* refactor(os_input_output): use Pid for child process

* fix(debug): change debug_to_file to write &[u8]

This patch changes debug_to_file to write entire slices in one call, to
avoid the overhead of opening and closing files for each byte written.

* refactor(ServerOsApi): remove unnecessary muts from methods

Co-authored-by: KOVACS Tamas <ktamas@fastmail.fm>
2021-05-18 17:39:36 +02:00
a-kenji
79e7c414b7 Fix clean flag
* The setup subcommand was exiting the programm no matter what
  even if the `clean` flag was provided.
  Now it returns to the
  main function on encountering the clean flag.
2021-05-18 11:12:57 +02:00
a-kenji
bcbde9fbb5 Merge branch 'main' of https://github.com/zellij-org/zellij into layout-path-506 2021-05-18 10:05:15 +02:00
Aram Drevekenin
a3f42b19a9
Osc implementation (#517)
* fix(compatibility): implement most osc methods

* style(fmt): rustfmt

* style(fmt): remove cargo warnings

* style(fmt): make clippy happy

* style(fmt): fix formatting after my clippy fixes broke it again ;P

* fix(grid): fix tests
2021-05-17 18:13:05 +02:00
Kunal Mohan
a872362328 fmt and clippy 2021-05-16 22:25:32 +05:30
Kunal Mohan
2038947a14 Big refactor: separate crates for client, server and utilities 2021-05-16 21:41:56 +05:30