Skip to content

Conversation

@pmarsceill
Copy link
Owner

Summary

  • Add support for Zellij as an alternative to tmux for managing agent sessions
  • Users can configure their preferred multiplexer via config file, environment variable, or default to tmux
  • Implements multiplexer abstraction interface for clean separation of concerns

Changes

  • New files:

    • internal/daemon/multiplexer.go - Interface definition and factory
    • internal/daemon/multiplexer_tmux.go - Tmux implementation
    • internal/daemon/multiplexer_zellij.go - Zellij implementation
  • Modified files:

    • internal/daemon/process.go - Refactored to use Multiplexer interface
    • internal/daemon/server.go - Initialize multiplexer from config
    • internal/cli/config.go - Added multiplexer default
    • internal/cli/root.go - Added getMultiplexer() helper
    • internal/cli/up.go - Pass multiplexer to daemon config
    • internal/cli/agent_watch.go - Support both multiplexers with appropriate keyboard hints
    • internal/cli/clean.go - Clean sessions from both multiplexers
    • proto/map/v1/daemon.proto - Added multiplexer field to status messages
    • README.md - Documentation for multiplexer configuration

Configuration

The multiplexer can be configured via (in priority order):

  1. Environment variable: MAP_MULTIPLEXER=zellij
  2. Config file: ~/.mapd/config.yaml with multiplexer: zellij
  3. Default: tmux

Test plan

  • Verify tmux still works as default
  • Test with MAP_MULTIPLEXER=zellij map up
  • Test map config set multiplexer zellij
  • Test map agent watch shows correct keyboard shortcuts for each multiplexer
  • Test map clean removes sessions from both multiplexers
  • Run make test and golangci-lint run

Closes #14

🤖 Generated with Claude Code

Add support for Zellij as an alternative to tmux for managing agent sessions.
Users can configure their preferred multiplexer via config file, environment
variable (MAP_MULTIPLEXER), or it defaults to tmux.

Changes:
- Create Multiplexer interface abstracting session management operations
- Implement TmuxMultiplexer with existing tmux functionality
- Implement ZellijMultiplexer with Zellij CLI commands
- Refactor ProcessManager to use Multiplexer interface
- Add 'multiplexer' config option to Viper defaults
- Update CLI commands (watch, clean, up) to support both multiplexers
- Add multiplexer field to proto messages for status reporting

Closes #14

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Support Zellij in addition to Tmux for session managment

2 participants