Commit Graph

154 Commits

Author SHA1 Message Date
Aram Drevekenin
7fe87f59a3 chore(version): bump development version 2021-07-05 11:04:51 +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
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
Aram Drevekenin
3313634fe9
Add e2e tests (#582)
* feature(tests): e2e tests

* chore(build): github action

* chore(build): fix workflow

* chore(build): fix workflow

* work

* work

* work

* work

* work

* work

* work

* work

* work

* work

* work

* work

* work

* work

* work

* work

* work

* work

* work

* work

* work

* work

* work

* work

* work

* work

* work

* work

* work

* work

* work

* work

* work

* work

* work

* work

* work

* work

* work

* work

* work

* work

* work

* work

* work

* work

* work

* work

* work

* work

* working

* working

* working

* bring back the proper errors

* make e2e flow run properly

* style(fmt): make rustfmt happy

* style(fmt): make rustfmt happy

* run on everything just to test the workflow

* bring back running behaviour on workflow
2021-06-21 10:45:18 +02:00
Brooks J Rady
dc44a00699 chore(release): bump development version 2021-06-04 10:28:03 +01:00
Brooks J Rady
f2c5ee44f7 Getting back to where we started... (Buggy Resizing) 2021-05-29 23:12:11 +01:00
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
Aram Drevekenin
9bdb40b4c6 chore(version): bump development version 2021-05-27 14:41:33 +02:00
Kunal Mohan
2bca7e007a
Merge pull request #531 from zellij-org/detach-sessions
Feature: Detachable/Persistent sessions
2021-05-25 17:30:40 +05:30
kxt
2168793dc7
fix(pty): use async io to avoid polling (#523)
This patch fixes #509 by using async read instead of polling a
non-blocking fd. This reduces CPU usage when the ptys are idle.
2021-05-24 15:00:49 +02:00
Kunal Mohan
0621ba8f34 Allow user to specify session name 2021-05-22 22:21:26 +05:30
Kunal Mohan
fa0a7e05c3 Add ability to attach to sessions 2021-05-22 22:19:50 +05:30
Kunal Mohan
a351440c99 upgrade termbg and remove build-dependencies 2021-05-19 11:10:21 +05:30
Kunal Mohan
040d10df0f Re-export common dependencies from zellij-utils 2021-05-19 01:35:53 +05:30
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
2038947a14 Big refactor: separate crates for client, server and utilities 2021-05-16 21:41:56 +05:30
Kunal Mohan
0d792e26f2 Switch to multiprocess model: Not looking good 2021-05-15 22:14:34 +05:30
Aram Drevekenin
97589c6a92 chore(version): bump development version 2021-05-15 13:50:35 +02:00
Aram Drevekenin
791cfd0a6e chore(version): bump development version 2021-05-14 11:01:13 +02:00
Aram Drevekenin
e68504552e hotfix: bump zellij-tile version 2021-05-14 10:39:59 +02:00
Aram Drevekenin
ce0ca2f997 chore(version): bump development version 2021-05-11 11:45:21 +02:00
Aram Drevekenin
632a7a3209
fix(compatibility): upgrade vte to support csi subparameters (#469)
* fix(compatibility): upgrade vte to support csi subparameters

* style(fmt): rustfmt and clippy
2021-05-07 16:03:45 +02:00
Aram Drevekenin
ad9576dd95 chore(version): bump development version 2021-05-07 14:45:13 +02:00
Kunal Mohan
d5433f8f89
Merge pull request #223 from zellij-org/isolate-pty
Psuedo Client-Server model
2021-05-06 22:11:07 +05:30
Brooks J Rady
6e5600efc8 chore(plugin): shuffle helper library names and versions 2021-05-04 23:31:30 +01:00
Kunal Mohan
c1dd2c588e Fix after rebase 2021-05-04 20:48:28 +05:30
Kunal Mohan
d33106431d Fix after rebase 2021-05-04 20:48:17 +05:30
Kunal Mohan
913697b144 Place socket file in runtime directory or cache directory and use names crate for socket file name 2021-05-04 20:48:17 +05:30
Kunal Mohan
1eb732773a use Uuid to generate unique server socket names 2021-05-04 20:48:16 +05:30
Kunal Mohan
b7aa3fc21a Use interprocess crate for IPC 2021-05-04 20:48:16 +05:30
Kunal Mohan
fedb588330 Fix after rebase 2021-05-04 20:48:15 +05:30
Kunal Mohan
2a648187fc Fix after rebase 2021-05-04 20:48:15 +05:30
Kunal Mohan
2059d2c6aa Fix after rebase 2021-05-04 20:48:14 +05:30
Kunal Mohan
fd1debaa79 Fix after rebase 2021-05-04 20:47:51 +05:30
Kunal Mohan
d8986351ed fix testing for pseudo client-server model 2021-05-04 20:47:50 +05:30
Kunal Mohan
77682d9ab5 Use ipmpsc crate for IPC 2021-05-04 20:47:49 +05:30
Aram Drevekenin
bea4446586 chore(version): bump development version 2021-05-04 17:17:33 +02:00
Aram Drevekenin
fbe8042695 HOTFIX: allow cargo publish 2021-05-04 16:58:23 +02:00
Aram Drevekenin
1f88b342e2
fix(colors): stabilize colors (#453)
* fix(colors): stabilize colors

* style(fmt): rustfmt
2021-05-04 16:06:55 +02:00
denis
ce1f81bcec chore: remove unused dependency from zellij-tile 2021-05-02 13:04:12 +03:00
denis
56cf446275 chore: added zellij-tile-extra, moved macros from zellij-tile 2021-05-02 12:57:48 +03:00
denis
452940fb65 Merge branch 'main' into x-colors 2021-05-02 11:59:20 +03:00
Yutaka Kamei
168deabea7
Load config before start()
Previously, a config file was loaded within `start()`, and if the config
file is invalid, Zellij was supposed to show a user what's wrong with
it. However, since `start()` starts setting up its terminal with an
alternative screen buffer, neither standard output nor standard error
could display such an error.

This change intends to address this issue by making Zellij load a config
file before `start()`.

In addition, the patch also includes some refactorings:

* Redefine `from_cli_config` with `TryFrom`, which was introduced in
  Rust 1.34
* Remove conditional declaration `cfg(not(test))` because `start()` now
  receive a `Config` as the third argument
* Introduce [`tempfile`](https://crates.io/crates/tempfile) in order to
  run tests with actual files
* Typo?: "Deserialisation" -> "Deserialization"
2021-05-02 06:18:40 +09:00
denis
f85822972a chore: cleanup, fix: the tests finally pass 2021-05-01 14:44:43 +03:00
denis
eabecde90b chore: painless merge this time 2021-05-01 13:45:01 +03:00
Aram Drevekenin
28af9f077d chore(version): boost development version to 0.7.0 and update changelog 2021-04-29 16:50:48 +02:00
Brooks J Rady
2814c30272 feat(plugin): added the get_plugin_ids() query function 2021-04-27 14:57:54 +01:00
denis
47a918a53c wip: merge main 2021-04-24 09:18:37 +03:00
Aram Drevekenin
20a6a8e844 chore(version): boost development version to 0.6.0 2021-04-23 11:59:35 +02:00
Aram Drevekenin
f2fa8839d4 chore(version): 0.5.1 2021-04-22 20:59:20 +02:00
denis
8d98ca7da0 wip: merge main in 2021-04-22 11:45:29 +03:00
Brooks J Rady
74cc48fc50 fix(release): beta tag breaks cargo install 2021-04-20 00:27:43 +01:00
Brooks J Rady
3d6312938f chore(release): bump version and add some pre-release info 2021-04-20 00:23:01 +01:00
Brooks J Rady
fee999ec40 fix(naming): made plugin terminology more consistent 2021-04-19 23:37:47 +01:00
Brooks J Rady
03011c1e5a fix(crates.io): fix outdated zellij-tile library 2021-04-14 20:04:02 +01:00
Brooks J Rady
e98dd69a88 chore(crates.io): bump version to publish 2021-04-14 19:20:27 +01:00
Brooks J Rady
a16a8ad6e3 chore(crates.io): bump version to publish 2021-04-13 20:58:23 +01:00
Brooks J Rady
ee70927611 chore(crates.io): bump version to test upload 2021-04-13 18:59:45 +01:00
Brooks J Rady
0e73227fe2 merge(main): update branch with changes from main 2021-04-13 16:17:40 +01:00
Brooks J Rady
d2a7d100ac docs(build): documented the new build system 2021-04-13 16:06:04 +01:00
denis
7774edd45a wip: need to figure out how to clear lines 2021-04-08 16:29:52 +03:00
Aram Drevekenin
1739f370f9
* fix(ui): react to terminal window size changes (SIGWINCH) (#245)
* fix(ui): react to terminal window size changes (SIGWINCH)

* style(fmt): rustfmt

* style(format): remove some warnings

* style(fmt): rustfmt
2021-04-01 17:38:13 +02:00
Brooks J Rady
ccc34f1fe2 Rudamentary running support implemented 2021-04-01 12:18:05 +01:00
denis
6e276ae386 wip: move Palette out of zellij-tile 2021-03-27 15:30:53 +02:00
denis
b71315b036 wip: latest plugin system merge in 2021-03-27 14:43:16 +02:00
Brooks J Rady
4c662fc6d0 Start porting to cargo-make 2021-03-26 16:01:22 +00:00
denis
2c402b0b1d wip: scary how messy it is, but it's a start 2021-03-26 16:42:38 +02:00
denis
a35cade8de wip: reading colors from xrdb 2021-03-25 18:05:16 +02:00
Brooks J Rady
f2f7758384 Merge in changes from main and fix clippy lints 2021-03-25 14:24:11 +00:00
Brooks J Rady
ac55e59047 Initial implementation of the update callback + upstream termion 2021-03-23 19:52:59 +00:00
Brooks J Rady
9bc7a268ce Merge changes from main 2021-03-23 16:42:54 +00:00
denis
448c426c2b Merge branch 'main' into focused-pane 2021-03-17 10:05:43 +02:00
Aram Drevekenin
8d0ff0fe40
feat(input): new shortcuts and ui (#220)
* feat(statusbar): new shortcuts

* feat(input): new shortcuts and ui

* style(fmt): rustfmt
2021-03-11 16:03:28 +01:00
Brooks J Rady
06bce9a1fd Deduplicate the WASM interface structs 2021-03-09 19:39:42 +00:00
Brooks J Rady
3e10e34575 Rename init() to load() in plugin API + Bump deps 2021-03-09 17:09:21 +00:00
denis
1a5d30d17d wip: visually marking the focused pane 2021-03-07 18:39:44 +02:00
Brooks J Rady
b6ce24280f infra(crates.io): clear the correct directory in build.rs 2021-02-26 09:27:59 +00:00
Brooks J Rady
a20e49d77e infra(crates.io): readd wasm assets to the repo 2021-02-26 09:09:54 +00:00
Jonah Caplan
ce54127d7d add basic tab bar #166 2021-02-25 01:44:10 -05:00
Aram Drevekenin
58c41c5ada chore(version): 0.1.1 2021-02-17 16:07:38 +01:00
henil
fb701afb0f Use temporary fork of termion for now
Because crates.io require each package in the dependency to be published on
crates.io
2021-02-10 17:26:13 +05:30
Brooks J Rady
9791970856 Well, it turns out that I spent 4 hours on something impossible... 2021-02-09 22:19:34 +00:00
Brooks J Rady
678a6f877c Work towards a functional build 2021-02-09 19:06:47 +00:00
Brooks J Rady
fd001860f4 Push the mosaic folder down a directory 2021-02-09 17:27:36 +00:00
Kyle Sutherland-Cash
b6fb330da3
refactor(input): hotkeys (#132)
* Initial definitions and thoughts for hotkeys

* Actually document InputKey properly

* Add a to string function for input keys

* Define keybinds and actions; restructure

* Implement hash and start on defining key bindings

* Derive Serialize for input keys

* Store the key strings as tuples for two-way mapping

* Some string to key functions

* Use termion's Key definition and implement action dispatch

* Fix some borrow-checker errors

* Missing keybind and command mode switching

* Fix incorrect handling of spawn terminal command

* fix(plugins): work with new input - tests not passing

* fix(infra): stabilize tests and properly close pty sessions

* style(fmt): rustfmt

Co-authored-by: Brooks J Rady <b.j.rady@gmail.com>
Co-authored-by: Aram Drevekenin <aram@poor.dev>
2021-02-05 11:28:34 +01:00
denis
bd1e3d2d7b Merge branch 'main' into server-client 2021-01-22 08:24:56 +02:00
Kyle
09b1e03843 Add some message types for server-client comms 2021-01-17 19:15:32 +00:00
Brooks J Rady
555f9af37a Install default layouts and plugins at build-time 2021-01-11 23:00:19 +00:00
Brooks J Rady
58a2fc1656 Finished plugin system! (Added file opening) 2021-01-07 15:23:54 +00:00
Brooks J Rady
6e19401200 Add LTO and use a termion fork with serde support 2021-01-07 12:20:52 +00:00
Brooks J Rady
01eaedcd37 Parse bytes into keys with Termion 2021-01-07 09:39:16 +00:00
Brooks J Rady
a6ba792e89 Also borken 2021-01-06 12:53:12 +00:00
Brooks Rady
22890c53fe
fix(plugins): fully Working WebAssembly Loading! (#125)
* Fully Working WebAssembly Loading!

* Move some wasm code to it's own module
2020-12-30 09:59:32 +01:00
Kunal Mohan
56c53d2487
feat(infra): add custom panic hook. Print backtrace and thread, error info on panic. (#75)
* Add custom panic hook. Print backtrace and thread, error info on panic.

* use sync_channel and SyncSender

* nit fixes and cleanup

* disable custom panic hook while running tests

* make separate errors.rs file and address other review comments

* improve panic message

* debug: does increasing time between snapshots make tests pass? (this is temporary)

* fix(tests): suspend before sending quit command

* fix(tests): add missing use

* style(format): commas are important apparently

* fix(tests): can we get away with reducing the QUIT suspense time?

* fix(tests): can we get away with 50?

Co-authored-by: Aram Drevekenin <aram@poor.dev>
2020-12-03 15:35:16 +01:00
Brooks J Rady
06b5ef8c26 Well, it compiles... 2020-11-25 19:39:45 +00:00
Aram Drevekenin
47954166a2
feat(ux): initial layout engine (#50)
* prototype

* refactor(layout): move stuff around

* style(format): make rustfmt happy
2020-11-15 19:55:56 +01:00
Aram Drevekenin
3ea03edfdd feat(ipc): send external ipc messages to active session through cli 2020-10-21 09:24:31 +02:00