https://github.com/deinstapel/cursive-multiplex
A tmux like multiplexer for gyscos/cursive views π₯οΈ
https://github.com/deinstapel/cursive-multiplex
cursive cursive-views layout manager multiplexer pane terminal tiling tmux tui view window
Last synced: 3 months ago
JSON representation
A tmux like multiplexer for gyscos/cursive views π₯οΈ
- Host: GitHub
- URL: https://github.com/deinstapel/cursive-multiplex
- Owner: deinstapel
- License: bsd-3-clause
- Created: 2019-07-06T10:00:49.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2024-08-12T17:47:36.000Z (over 1 year ago)
- Last Synced: 2025-08-15T07:23:37.684Z (5 months ago)
- Topics: cursive, cursive-views, layout, manager, multiplexer, pane, terminal, tiling, tmux, tui, view, window
- Language: Rust
- Homepage:
- Size: 9.7 MB
- Stars: 56
- Watchers: 2
- Forks: 3
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- Funding: .github/FUNDING.yml
- License: LICENSE
Awesome Lists containing this project
README
Welcome to cursive-multiplex π
A tmux like multiplexer for
gyscos/cursive
views
---
> This project is work-in-progress
This project provides a tiling window manager for [gyscos/cursive](https://github.com/gyscos/cursive) similar to Tmux. You can place any other `cursive` view inside of a `Mux` view to display these views in complex layouts side by side. Watch the demo below to see how it looks.
## How does it look like? `demo` [](https://github.com/faressoft/terminalizer)
Expand to view

## Usage
Simply add to your `Cargo.toml`
```toml
[dependencies]
cursive-multiplex = "^0.2.0"
```
And then use `Mux::new` to create a new Mux view
```rust
let (mut mux, root_node) = cursive_multiplex::Mux::new(
cursive::views::TextView::new("Hello World!".to_string())
);
```
> Mux has defaults defined for key bindings. You can change them with the API described in the [docs](https://docs.rs/cursive-multiplex).
Expand to see default keybindings
Action
Key
Move focus up
Alt + β
Move focus right
Alt + β
Move focus down
Alt + β
Move focus left
Alt + β
Resize up
Ctrl + β
Resize right
Ctrl + β
Resize down
Ctrl + β
Resize left
Ctrl + β
Zoom
Ctrl + x
### Adding views
You can add views by giving a path or an id to an existing node e.g.
```rust
let new_node = mux.add_right_of(
cursive::views::TextView::new("Foo"),
root_node,
).expect("adding right panel to root failed");
```
Its also possible to add views by their path.
```rust
if let Some(sibbling) = mux.root().right().right().down().build() {
let new_node = mux.add_above(
cursive::views::TextView::new("Foo"),
sibbling,
).expect("adding by path failed");
}
```
Returned will be a Result Ok contains the new id assigned to the view, or an error in case of failure.
### Removing Views
You can also remove views, by giving the id of the views.
```rust
mux.remove_id(new_node)?;
```
On success the id of the removed node is returned.
### Switch Views
If you want to reorder your views you can easily switch them by using
```rust
mux.switch_views(new_node, old_node)?;
```
## Troubleshooting
If you find any bugs/unexpected behaviour or you have a proposition for future changes open an issue describing the current behaviour and what you expected.
## Development [](https://github.com/deinstapel/cursive-multiplex/actions)
### Running the tests
#### Running all test suites
Just run
```
$ cargo test
```
to execute all available tests.
#### Investigating failed tests
In case some test fails with your changes, you can use the `cargo-insta` tool to investigate the test case.
To install
```
$ cargo install cargo-insta
```
and to run the tests and investigate all failing tests interactively.
```
$ cargo insta review
```
Any changes between the expected and received screen will be then displayed.
#### shields.io endpoints
[shields.io](https://shields.io) endpoints are generated inside the `./target/shields` folder. They are used in this README.
## Authors
**Fin Christensen**
> [:octocat: `@fin-ger`](https://github.com/fin-ger)
> [:elephant: `@fin_ger@weirder.earth`](https://weirder.earth/@fin_ger)
> [:bird: `@fin_ger_github`](https://twitter.com/fin_ger_github)
**Johannes WΓΌnsche**
> [:octocat: `@jwuensche`](https://github.com/jwuensche)
> [:elephant: `@fredowald@mastodon.social`](https://mastodon.social/web/accounts/843376)
> [:bird: `@Fredowald`](https://twitter.com/fredowald)
## Show your support
Give a :star: if this project helped you!