ivaaaan / smug

Session manager and task runner for tmux. Start your development environment within one command.
MIT License
709 stars 29 forks source link

Error with 6 panels #58

Closed kosssi closed 3 years ago

kosssi commented 3 years ago

Describe the bug When I create a session with 5 panels, it's ok, but with 6 I have this message: "Oops, an error occurred! Rolling back..."

Smug config

session: infra

root: ~/dev/ops/infra

windows:
  - name: server
    layout: tiled
    commands:
      - date
    panes:
      - commands:
        - date
      - commands:
        - date
      - commands:
        - date
      - commands:
        - date
      - commands:
        - date

Expected behavior I would like create 8 panels.

Output of cat ~/.config/smug/smug.log

tmux has-session -t infra:
exit status 1
tmux new -Pd -s infra -n smug_def -c /home/kosssi/dev/ops/infra
tmux neww -Pd -t infra: -c /home/kosssi/dev/ops/infra -F #{window_id} -n server
tmux split-window -Pd -t @1 -c /home/kosssi/dev/ops/infra -F #{pane_id}
tmux send-keys -t @1.%2 date Enter
tmux split-window -Pd -t @1 -c /home/kosssi/dev/ops/infra -F #{pane_id}
tmux send-keys -t @1.%3 date Enter
tmux split-window -Pd -t @1 -c /home/kosssi/dev/ops/infra -F #{pane_id}
tmux send-keys -t @1.%4 date Enter
tmux split-window -Pd -t @1 -c /home/kosssi/dev/ops/infra -F #{pane_id}
tmux send-keys -t @1.%5 date Enter
tmux split-window -Pd -t @1 -c /home/kosssi/dev/ops/infra -F #{pane_id}
exit status 1
tmux kill-session -t infra

Smug version

$ tmux -V
tmux 3.0a
$ smug --version
Smug - tmux session manager. Version v0.2

OS you're using Ubuntu 20.04 LTS

ivaaaan commented 3 years ago

The issue caused by "no space for new pane" error. I've added a new option rebalance_panes_after (default value is 5) to the config. It will run select-layout tiled for each split-window if the number of panes reaches this threshold.

Not the best solution, but good to go for now. Perhaps will be refactored later. If this doesn't help, try to make this number lower rebalance_panes_after.

kosssi commented 3 years ago

Thanks, finally I adopt tmuxp, I retest smug later ;)