feat(op): top-level switch-layout action #62

Closed
opened 2026-04-26 16:15:06 +00:00 by barrettruth · 0 comments
barrettruth commented 2026-04-26 16:15:06 +00:00

There should be one mosaic-level action for switching the current window to a named layout, instead of making every keybinding spell out raw tmux option writes and a manual relayout.

Why

Right now changing layouts from keybindings requires spelling out both:

  • set-option -wq @mosaic-algorithm <layout>
  • run '#{E:@mosaic-exec} relayout'

That leaks implementation details into tmux config and makes layout switching harder to standardize.

Scope

  • Add a top-level op such as #{E:@mosaic-exec} switch-layout <name>
  • It should set the current window's @mosaic-algorithm
  • It should relayout immediately
  • It should work even when no layout is currently active
  • It should fail cleanly on unknown layout names

Acceptance criteria

  • A single mosaic command switches the current window to a named layout
  • It updates @mosaic-algorithm window-locally
  • It relayouts immediately
  • Unknown layouts fail cleanly
  • README shows the preferred binding pattern
There should be one mosaic-level action for switching the current window to a named layout, instead of making every keybinding spell out raw tmux option writes and a manual relayout. ## Why Right now changing layouts from keybindings requires spelling out both: - `set-option -wq @mosaic-algorithm <layout>` - `run '#{E:@mosaic-exec} relayout'` That leaks implementation details into tmux config and makes layout switching harder to standardize. ## Scope - Add a top-level op such as `#{E:@mosaic-exec} switch-layout <name>` - It should set the current window's `@mosaic-algorithm` - It should relayout immediately - It should work even when no layout is currently active - It should fail cleanly on unknown layout names ## Acceptance criteria - [ ] A single mosaic command switches the current window to a named layout - [ ] It updates `@mosaic-algorithm` window-locally - [ ] It relayouts immediately - [ ] Unknown layouts fail cleanly - [ ] README shows the preferred binding pattern
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
barrettruth/tmux-mosaic#62
No description provided.