Commit Graph

307 Commits

Author SHA1 Message Date
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