Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Add layout configuration to exclude panes from tab sync #2314

Merged
merged 1 commit into from
Apr 18, 2023

Conversation

on3iro
Copy link
Contributor

@on3iro on3iro commented Mar 21, 2023

Closes: #2285

This PR adds the ability to configure panes to be excluded from receiving input when tab sync is activated.
I'm not sure if there is a better way than to add another parameter to the write_to_pane_id-function - so just let me know if I should change something.

I also did not find any tests in regard to tab syncing, so I also didn't add any.

If this PR gets merged I should probably also make an addition to the zellij website providing an example in the layouts section. I am just a bit unsure right now, how these two repos are being kept in sync.
Should I already make the PR or should I wait until this PR might've been merged?

@on3iro on3iro temporarily deployed to cachix March 28, 2023 07:38 — with GitHub Actions Inactive
Copy link
Member

@imsnif imsnif left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey @on3iro - this is great work. Good job threading the attribute, I imagine it was not trivial to figure out!

I left some comments in the code, and also I think there's a bit of a functionality issue. Using this layout:

layout {
    pane
    pane split_direction="vertical" {
        pane
        pane exclude_from_sync=true
    }
}

If I start tab-sync, I can't write into the excluded pane even if I'm focused on it. Would you like to take a look?

zellij-utils/src/input/unit/layout_test.rs Outdated Show resolved Hide resolved
zellij-server/src/tab/mod.rs Outdated Show resolved Hide resolved
zellij-server/src/tab/mod.rs Outdated Show resolved Hide resolved
zellij-server/src/tab/mod.rs Outdated Show resolved Hide resolved
zellij-server/src/tab/mod.rs Outdated Show resolved Hide resolved
@on3iro
Copy link
Contributor Author

on3iro commented Mar 29, 2023

Hey @on3iro - this is great work. Good job threading the attribute, I imagine it was not trivial to figure out!

I left some comments in the code, and also I think there's a bit of a functionality issue. Using this layout:

layout {
    pane
    pane split_direction="vertical" {
        pane
        pane exclude_from_sync=true
    }
}

If I start tab-sync, I can't write into the excluded pane even if I'm focused on it. Would you like to take a look?

@imsnif thanks a lot for your kind words and feedback. I'll take a closer look at all the comments asap.
Regarding the functionality issue: I was aware of that behavior and it was a actually intentional on my side.
To me this behavior feels consistent, meaning that if I am inside sync mode, the pane should not receive input, no matter where I type. However I totally understand if you don't desire such behavior.
Should I try to make it so that the pane will always receive input when it is in focus? :)

@imsnif
Copy link
Member

imsnif commented Mar 29, 2023

Should I try to make it so that the pane will always receive input when it is in focus? :)

Actually, this makes sense. Let's leave it like this.

@on3iro
Copy link
Contributor Author

on3iro commented Mar 30, 2023

@imsnif I made the changes you requested. I kept them inside a separate commit for now, so they are easier to distinguish from the previous code. If you are satisfied with them you can just squash 'em :)

Just let me know if there is anything else I should change 👍

@on3iro on3iro temporarily deployed to cachix April 6, 2023 08:31 — with GitHub Actions Inactive
@imsnif
Copy link
Member

imsnif commented Apr 6, 2023

Hey @on3iro - the code changes look good, thanks! If you'd like to merge from main again, we can give this one last spin to make sure all is working and then merge. I'll try to get to it quickly after you merge in order not to create more drift!

@on3iro
Copy link
Contributor Author

on3iro commented Apr 9, 2023

Hey @imsnif - sorry for the late response. I am in the midst of moving into a new flat and super busy right now.
I will get back to this as soon as things have settled a bit. (probably around Thursday next week)

@on3iro
Copy link
Contributor Author

on3iro commented Apr 15, 2023

@imsnif I squashed my two branches and rebased onto main - everything should be fine and ready to merge now :) 🎉

Should I also add a section to the docs repository?

@on3iro on3iro temporarily deployed to cachix April 18, 2023 13:24 — with GitHub Actions Inactive
@imsnif
Copy link
Member

imsnif commented Apr 18, 2023

Very nice work on this! I hope the move went well. Thank you for your patience.

@imsnif imsnif merged commit 525928b into zellij-org:main Apr 18, 2023
renovate bot referenced this pull request in scottames/dots Jun 19, 2023
[![Mend
Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com)

This PR contains the following updates:

| Package | Update | Change |
|---|---|---|
| [aquaproj/aqua-registry](https://github.com/aquaproj/aqua-registry)
| minor | `v4.19.0` -> `v4.20.0` |
| [zellij-org/zellij](https://github.com/zellij-org/zellij) | minor |
`v0.36.0` -> `v0.37.0` |

---

### Release Notes

<details>
<summary>aquaproj/aqua-registry</summary>

###
[`v4.20.0`](https://github.com/aquaproj/aqua-registry/releases/tag/v4.20.0)

[Compare
Source](https://github.com/aquaproj/aqua-registry/compare/v4.19.0...v4.20.0)


[Issues](https://github.com/aquaproj/aqua-registry/issues?q=is%3Aissue+milestone%3Av4.20.0)
| [Pull
Requests](https://github.com/aquaproj/aqua-registry/pulls?q=is%3Apr+milestone%3Av4.20.0)
| aquaproj/aqua-registry@v4.19.0...v4.20.0

#### 🎉 New Packages


[#&#8203;13132](https://github.com/aquaproj/aqua-registry/issues/13132)
[segmentio/golines](https://github.com/segmentio/golines): A golang
formatter that fixes long lines
[@&#8203;iwata](https://github.com/iwata)

#### Fixes


[#&#8203;13143](https://github.com/aquaproj/aqua-registry/issues/13143)
[terraform-linters/tflint](https://github.com/terraform-linters/tflint):
Support old versions

</details>

<details>
<summary>zellij-org/zellij</summary>

###
[`v0.37.0`](https://github.com/zellij-org/zellij/releases/tag/v0.37.0)

[Compare
Source](https://github.com/zellij-org/zellij/compare/v0.36.0...v0.37.0)

In this release we've done a lot of work on our WebAssembly / WASI
plugin system and are very excited to invite adventurous Rust developers
to come pioneer our plugin system with us. To read more, please see the
official [Plugin
Documentation](https://zellij.dev/documentation/plugins.html).

Please also drop by our Discord or Matrix and show us the plugins you're
working on!

#### Other Highlights

- Some basic themes are now included with the release, give it a try by
starting Zellij with `zellij options --theme catppuccin-mocha`
-   Layouts now support environment variables and tilde expansions
-   We can now provide a `--cwd` option when starting Zellij

#### All changes

- fix(plugin): respect hide session option on compact-bar by
[@&#8203;pedromfedricci](https://github.com/pedromfedricci) in
[https://github.com/zellij-org/zellij/pull/2368](https://github.com/zellij-org/zellij/pull/2368)
- feat: Add layout configuration to exclude panes from tab sync by
[@&#8203;on3iro](https://github.com/on3iro) in
[https://github.com/zellij-org/zellij/pull/2314](https://github.com/zellij-org/zellij/pull/2314)
- Fix 2205 - Support cwd by
[@&#8203;Kangaxx-0](https://github.com/Kangaxx-0) in
[https://github.com/zellij-org/zellij/pull/2290](https://github.com/zellij-org/zellij/pull/2290)
- feat(plugins): reload plugin at runtime by
[@&#8203;imsnif](https://github.com/imsnif) in
[https://github.com/zellij-org/zellij/pull/2372](https://github.com/zellij-org/zellij/pull/2372)
- Update architecture doc by
[@&#8203;Kangaxx-0](https://github.com/Kangaxx-0) in
[https://github.com/zellij-org/zellij/pull/2371](https://github.com/zellij-org/zellij/pull/2371)
- feat(themes): add nightfox themes by
[@&#8203;EdenEast](https://github.com/EdenEast) in
[https://github.com/zellij-org/zellij/pull/2384](https://github.com/zellij-org/zellij/pull/2384)
- feat: provide default themes by
[@&#8203;jaeheonji](https://github.com/jaeheonji) in
[https://github.com/zellij-org/zellij/pull/2307](https://github.com/zellij-org/zellij/pull/2307)
- feat(plugins): update and render plugins asynchronously by
[@&#8203;imsnif](https://github.com/imsnif) in
[https://github.com/zellij-org/zellij/pull/2410](https://github.com/zellij-org/zellij/pull/2410)
- feat(layout): Support environment variables in cwd
([#&#8203;2288](https://github.com/zellij-org/zellij/issues/2288)) by
[@&#8203;shahamran](https://github.com/shahamran) in
[https://github.com/zellij-org/zellij/pull/2291](https://github.com/zellij-org/zellij/pull/2291)
- Add file path context to all IO errors in ConfigError by
[@&#8203;Imberflur](https://github.com/Imberflur) in
[https://github.com/zellij-org/zellij/pull/2412](https://github.com/zellij-org/zellij/pull/2412)
- fix(e2e): fix flaky locked mode test by
[@&#8203;imsnif](https://github.com/imsnif) in
[https://github.com/zellij-org/zellij/pull/2413](https://github.com/zellij-org/zellij/pull/2413)
- Fix error loading non-existant themes directory and use default themes
as the base when merging by
[@&#8203;Imberflur](https://github.com/Imberflur) in
[https://github.com/zellij-org/zellij/pull/2411](https://github.com/zellij-org/zellij/pull/2411)
- improve build/ci times by
[@&#8203;tlinford](https://github.com/tlinford) in
[https://github.com/zellij-org/zellij/pull/2396](https://github.com/zellij-org/zellij/pull/2396)
- Do not unwrap() the sticky bit setting! by
[@&#8203;valpackett](https://github.com/valpackett) in
[https://github.com/zellij-org/zellij/pull/2424](https://github.com/zellij-org/zellij/pull/2424)
- Use rust 1.67 by [@&#8203;har7an](https://github.com/har7an) in
[https://github.com/zellij-org/zellij/pull/2375](https://github.com/zellij-org/zellij/pull/2375)
- Fix issue 2421 - Update config file output by
[@&#8203;Kangaxx-0](https://github.com/Kangaxx-0) in
[https://github.com/zellij-org/zellij/pull/2443](https://github.com/zellij-org/zellij/pull/2443)
- feat(plugins): Plugin workers and strider by
[@&#8203;imsnif](https://github.com/imsnif) in
[https://github.com/zellij-org/zellij/pull/2449](https://github.com/zellij-org/zellij/pull/2449)
- fix: cwd of newtab action by
[@&#8203;onichandame](https://github.com/onichandame) in
[https://github.com/zellij-org/zellij/pull/2455](https://github.com/zellij-org/zellij/pull/2455)
- feat(wasm-plugin-system): major overhaul and some goodies by
[@&#8203;imsnif](https://github.com/imsnif) in
[https://github.com/zellij-org/zellij/pull/2510](https://github.com/zellij-org/zellij/pull/2510)
- feat(plugins): extensive plugin api by
[@&#8203;imsnif](https://github.com/imsnif) in
[https://github.com/zellij-org/zellij/pull/2516](https://github.com/zellij-org/zellij/pull/2516)
- fix: runtime panic because of local cache by
[@&#8203;jaeheonji](https://github.com/jaeheonji) in
[https://github.com/zellij-org/zellij/pull/2522](https://github.com/zellij-org/zellij/pull/2522)
- fix(output): do not hide cursor on a render that does not include
visual assets by [@&#8203;imsnif](https://github.com/imsnif) in
[https://github.com/zellij-org/zellij/pull/2528](https://github.com/zellij-org/zellij/pull/2528)
- fix(screen): focus tab as well as pane when launching existing plugin
by [@&#8203;imsnif](https://github.com/imsnif) in
[https://github.com/zellij-org/zellij/pull/2530](https://github.com/zellij-org/zellij/pull/2530)
- fix(strider): clear search term on ESC by
[@&#8203;imsnif](https://github.com/imsnif) in
[https://github.com/zellij-org/zellij/pull/2531](https://github.com/zellij-org/zellij/pull/2531)
- fix(plugins): only listen to hd if a plugin is subscribed to hd events
by [@&#8203;imsnif](https://github.com/imsnif) in
[https://github.com/zellij-org/zellij/pull/2529](https://github.com/zellij-org/zellij/pull/2529)
- fix(logs): suppress debug logs when not debugging by
[@&#8203;imsnif](https://github.com/imsnif) in
[https://github.com/zellij-org/zellij/pull/2532](https://github.com/zellij-org/zellij/pull/2532)
- fix(plugins): allow loading relative urls by
[@&#8203;imsnif](https://github.com/imsnif) in
[https://github.com/zellij-org/zellij/pull/2539](https://github.com/zellij-org/zellij/pull/2539)
- feat(plugins): plugin pane state events by
[@&#8203;imsnif](https://github.com/imsnif) in
[https://github.com/zellij-org/zellij/pull/2545](https://github.com/zellij-org/zellij/pull/2545)
- performance(plugins): use a debounced fs watcher by
[@&#8203;imsnif](https://github.com/imsnif) in
[https://github.com/zellij-org/zellij/pull/2546](https://github.com/zellij-org/zellij/pull/2546)
- feat(plugins): more plugin api methods by
[@&#8203;imsnif](https://github.com/imsnif) in
[https://github.com/zellij-org/zellij/pull/2550](https://github.com/zellij-org/zellij/pull/2550)
- refactor(plugins): improve api by
[@&#8203;imsnif](https://github.com/imsnif) in
[https://github.com/zellij-org/zellij/pull/2552](https://github.com/zellij-org/zellij/pull/2552)
- feat(plugins): strider improvements by
[@&#8203;imsnif](https://github.com/imsnif) in
[https://github.com/zellij-org/zellij/pull/2551](https://github.com/zellij-org/zellij/pull/2551)
- docs(plugins): document the zellij-tile events and commands api by
[@&#8203;imsnif](https://github.com/imsnif) in
[https://github.com/zellij-org/zellij/pull/2554](https://github.com/zellij-org/zellij/pull/2554)
- docs(plugins): better zellij-tile-docs by
[@&#8203;imsnif](https://github.com/imsnif) in
[https://github.com/zellij-org/zellij/pull/2560](https://github.com/zellij-org/zellij/pull/2560)

#### New Contributors

- [@&#8203;on3iro](https://github.com/on3iro) made their first
contribution in
[https://github.com/zellij-org/zellij/pull/2314](https://github.com/zellij-org/zellij/pull/2314)
- [@&#8203;Kangaxx-0](https://github.com/Kangaxx-0) made their first
contribution in
[https://github.com/zellij-org/zellij/pull/2290](https://github.com/zellij-org/zellij/pull/2290)
- [@&#8203;EdenEast](https://github.com/EdenEast) made their first
contribution in
[https://github.com/zellij-org/zellij/pull/2384](https://github.com/zellij-org/zellij/pull/2384)
- [@&#8203;shahamran](https://github.com/shahamran) made their first
contribution in
[https://github.com/zellij-org/zellij/pull/2291](https://github.com/zellij-org/zellij/pull/2291)
- [@&#8203;Imberflur](https://github.com/Imberflur) made their first
contribution in
[https://github.com/zellij-org/zellij/pull/2412](https://github.com/zellij-org/zellij/pull/2412)
- [@&#8203;valpackett](https://github.com/valpackett) made their first
contribution in
[https://github.com/zellij-org/zellij/pull/2424](https://github.com/zellij-org/zellij/pull/2424)
- [@&#8203;onichandame](https://github.com/onichandame) made their
first contribution in
[https://github.com/zellij-org/zellij/pull/2455](https://github.com/zellij-org/zellij/pull/2455)

**Full Changelog**:
zellij-org/zellij@v0.36.0...v0.37.0

</details>

---

### Configuration

📅 **Schedule**: Branch creation - At any time (no schedule defined),
Automerge - At any time (no schedule defined).

🚦 **Automerge**: Enabled.

♻ **Rebasing**: Whenever PR is behind base branch, or you tick the
rebase/retry checkbox.

👻 **Immortal**: This PR will be recreated if closed unmerged. Get
[config help](https://github.com/renovatebot/renovate/discussions) if
that's undesired.

---

- [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check
this box

---

This PR has been generated by [Mend
Renovate](https://www.mend.io/free-developer-tools/renovate/). View
repository job log
[here](https://app.renovatebot.com/dashboard#github/scottames/dots).

<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNS4xMjYuMCIsInVwZGF0ZWRJblZlciI6IjM1LjEyNi4wIiwidGFyZ2V0QnJhbmNoIjoibWFpbiJ9-->

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Enhancement: Pane option in layout to exclude a pane from receiving sync input
2 participants