feat: implement dynamic pane resizing

- Add `resize_panes_equal()` to `Window`.
- Dynamically apply `tmux` layouts based on pane count.
- Implement `get_width()` and `get_height()` for `Pane`.
- Update test to create 4 panes and use equal resizing.
This commit is contained in:
Mahmoud-Emad
2025-08-31 17:56:03 +03:00
parent 9657e9aa97
commit 7d28129f06
5 changed files with 81 additions and 20 deletions

View File

@@ -1,18 +0,0 @@
#!/usr/bin/env hero
// Debug test - no ttyd, just basic declarative functionality
// Ensure a test session exists
!!tmux.session_ensure
name:"debug_test"
// Ensure a simple 2-pane window exists
!!tmux.window_ensure
name:"debug_test|demo"
cat:"2pane"
// Try to configure just one pane
!!tmux.pane_ensure
name:"debug_test|demo|1"
label:"test"
cmd:"echo Hello from pane 1"

View File

@@ -9,7 +9,7 @@
// Ensure a simple 2-pane window exists
!!tmux.window_ensure
name:"test|demo"
cat:"2pane"
cat:"4pane"
// Configure the panes
!!tmux.pane_ensure
@@ -20,4 +20,14 @@
!!tmux.pane_ensure
name:"test|demo|2"
label:"second"
cmd:"echo Second pane ready"
cmd:"echo Second pane ready"
!!tmux.pane_ensure
name:"test|demo|3"
label:"third"
cmd:"echo Third pane ready"
!!tmux.pane_ensure
name:"test|demo|4"
label:"fourth"
cmd:"echo Fourth pane ready"