refactor: Improve tmux API consistency and formatting

- Refactor `logs_get_new` to use `LogsGetArgs` struct
- Return window as reference from `window_new`
- Standardize indentation and spacing
- Remove excessive blank lines
- Comment out initial example usage
This commit is contained in:
Mahmoud-Emad
2025-08-24 16:31:04 +03:00
parent 810cbda176
commit 117c9ac67c
4 changed files with 199 additions and 214 deletions

View File

@@ -1,20 +1,20 @@
#!/usr/bin/env -S v -n -w -gc none -cc tcc -d use_openssl -enable-globals run
import freeflowuniverse.herolib.osal.tmux
mut t := tmux.new()!
if !t.is_running()! {
t.start()!
}
if t.session_exist('main') {
t.session_delete('main')!
}
// Create session first, then create window
mut session := t.session_create(name: 'main')!
session.window_new(name: 'test', cmd: 'mc', reset: true)!
// Or use the convenience method
// t.window_new(session_name: 'main', name: 'test', cmd: 'mc', reset: true)!
// if !t.is_running()! {
// t.start()!
// }
// if t.session_exist('main') {
// t.session_delete('main')!
// }
// // Create session first, then create window
// mut session := t.session_create(name: 'main')!
// session.window_new(name: 'test', cmd: 'mc', reset: true)!
// // Or use the convenience method
// // t.window_new(session_name: 'main', name: 'test', cmd: 'mc', reset: true)!
println(t)