Skip to content

Commit

Permalink
Merge pull request #37 from ethagnawl/feature/detect-pane-base-index
Browse files Browse the repository at this point in the history
Detect and use base-index and pane-base-index values
  • Loading branch information
ethagnawl authored Apr 2, 2024
2 parents bdf85ba + a71406d commit 8768644
Show file tree
Hide file tree
Showing 7 changed files with 348 additions and 59 deletions.
31 changes: 22 additions & 9 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ keywords = ["tmux", "productivity"]
[dependencies]
clap = "2.33"
mockall = "0.10"
regex = "1.10"
serde = { version = "1.0", features = ["derive"] }
toml = "0.4"

Expand Down
25 changes: 8 additions & 17 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,14 @@ compiling/distributing binaries for various platforms.

### Cargo
- install: `cargo install rmuxinator`
- run: `rmuxinator start Example.toml`
- run: `rmuxinator start samples/Example.toml`

### Source
#### `cargo build`
- build: `cargo build && ./target/debug/rmuxinator start Example.toml`
- run: `./target/debug/rmuxinator start Example.toml`
- build: `cargo build && ./target/debug/rmuxinator start samples/Example.toml`
- run: `./target/debug/rmuxinator start samples/Example.toml`
#### `cargo run`
- run: `cargo run start Example.toml`
- run: `cargo run start samples/Example.toml`

## Documentation

Expand Down Expand Up @@ -118,11 +118,11 @@ Optional attributes will be noted below.
#### `debug`
Print the tmux commands that would be used to start and configure a tmux
session using a path to a project config file:
`rmuxinator debug Example.toml`
`rmuxinator debug samples/Example.toml`

#### `start`
Start a tmux session using a path to a project config file:
`rmuxinator start Example.toml`
`rmuxinator start samples/Example.toml`

### Use as a library
rmuxinator can also be used as a library by other programs.
Expand Down Expand Up @@ -172,17 +172,6 @@ let rmuxinator_config = rmuxinator::Config {
rmuxinator::run_start(rmuxinator_config).map_err(|error| format!("Rmuxinator error: {}", error))
```

## Known Issues and Workarounds
### Indexes
rmuxinator currently assumes that both `base-index` and `pane-base-index` are
0. This will be handled programatically in a future release, but for the time
being, it can be worked around by either removing overrides from .tmux.conf or
by adding the following:
```
set -g base-index 0
set -g pane-base-index 0
```

## Status
This project is currently a proof of concept and I'll be duplicating tmuxinator
features and adding additional improvements as I can find time. Right now, it's
Expand All @@ -200,6 +189,7 @@ capable of:
pane-border-format config option)
- running pane commands
- wiring up optional tmux event hooks/callbacks
- detecting/using tmux server base-index and pane-base-index values

## Still TODO:
- Consider building up and executing a single script (a la tmuxinator) instead
Expand All @@ -226,6 +216,7 @@ config (I'm not convinced this is necessary)
- Other CLI commands? (stop session, create/edit/delete project)
- Use named args in calls to format! where possible
- Implement default for Config struct
- Accept optional tmux config file (i.e. `tmux -f ./foo.conf ...`)

## Platforms
Here are the platforms rmuxinator is known to work on:
Expand Down
2 changes: 1 addition & 1 deletion Example.toml → samples/Example.toml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ start_directory = "$HOME/Documents"

[[windows]]
name = "window two"
start_directory = "/var/www"
start_directory = "/tmp"

[[windows.panes]]
commands = ["echo pane-one"]
Expand Down
7 changes: 7 additions & 0 deletions samples/Minimal.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
name = "debug"

[[windows]]
name = "one"
[[windows]]
name = "two"

Loading

0 comments on commit 8768644

Please sign in to comment.