Commit Graph

307 Commits

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