Skip to content

Feature Request: Add tmux Support for Multi-Session Agent Testing #1247

Closed as not planned

Description

@sandipwane

⚠️ Note: I understand from the contribution guidelines that core features need to go through a design process with the core team. I'm opening this issue to start that discussion and gauge interest, not planning to submit a PR without approval.

Summary

Enable OpenCode to manage multiple persistent terminal sessions through tmux integration, allowing it to handle complex workflows with parallel processes, persistent environments, and interactive CLI testing.

Current Limitations

  • No persistence: Can't keep servers running while coding
  • No parallelism: Can't run tests while dev server is active
  • No interactive testing: Can't test CLIs that require user input
  • No real-time monitoring: Can't observe and react to process output

Proposed Solution

Integrate tmux to enable:

  • Multiple persistent terminal sessions
  • Parallel process execution
  • Send keystrokes/input to sessions (crucial for CLI testing)
  • Real-time output monitoring
  • Session switching and management

Key Benefits

1. Interactive CLI Testing

# OpenCode can now test CLIs that require user input\!
Session 1: npm init
  → Send: "my-app" (project name)
  → Send: "1.0.0" (version)
  → Send: "yes" (confirm)

2. Full-Stack Development

Run entire stack in parallel:

  • Frontend: npm run dev
  • Backend: node server.js
  • Database: redis-server
  • Tests: npm test --watch

3. Real-World Example

Current: "I can't fully test this auth flow because I'd need Redis running..."

With tmux: OpenCode starts Redis, runs the app, tests auth flow, monitors sessions, and confirms: "Auth flow tested successfully with proper session storage."

Implementation

Tmux provides a clean API for this functionality:

  • Create/manage named sessions
  • Send keystrokes to sessions (tmux send-keys)
  • Capture output from sessions (tmux capture-pane)
  • Check session status and health

This would be backwards compatible - OpenCode would detect tmux availability and fall back to current behavior if not present.

Why This Matters

  • GitHub Copilot/Cursor/Aider: None support multiple persistent sessions
  • Real Development: Developers always have multiple terminals open
  • Complex Testing: Many tools require interactive input
  • Better AI Assistance: OpenCode could actually verify its work

Conclusion

This single feature would make OpenCode the only AI assistant capable of truly testing and verifying complex applications, especially those with interactive CLIs or multiple services. It bridges the gap between "code generation" and "working software".

Activity

  1. changed the title [-]Feature Request: Terminal Multiplexing Support for Enhanced Agent Capabilities[/-] [+]Feature Request: Add `tmux` Support for Multi-Session Agent Testing[/+] on Jul 23, 2025
  2. self-assigned this
    on Jul 23, 2025
  3. nitsanavni commented on Jul 24, 2025

    @nitsanavni

    I use this workflow a lot. Helpful in many situations. Great tool to have.
    I use this custom slash command:

    execute commands in a dedicated tmux window
    
    # context - when to use?
    
    we want to manually test or execute an interactive cli
    or a long interaction with a remote terminal (e.g. via ssh)
    or just a long running process, that we'll want to check in with later
    
    # how
    
    if already in a tmux session - create a new properly named window
    if not in a tmux session - create one
    use `send-keys` to write to it and `capture-pane` to read from it
    always start with read
    then also make sure we're in the expected pwd
    in general - read more often then write
    
    # tips
    
    some interactive clis require a bit of pause from time to time - e.g. Claude Code, when sending a msg to claude use bash(send(msg), sleep 0.1, send(Enter))
  4. lee-b commented on Jul 26, 2025

    @lee-b

    Additional potential use case: logging into various servers/containers/jails, for distributed systems/solutions. This is potentially very useful for using opencode to work on IaC, for example.

  5. abda11ah commented on Dec 24, 2025

    @abda11ah

    Openhands handles it but it is running in docker isolated envirronment which adds a complexity layer for simple setups

  6. thdxr commented on Mar 25, 2026

    @thdxr
    Member

    To stay organized issues are automatically closed after 90 days of no activity. If the issue is still relevant please open a new one.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions