Raxol.Terminal.SessionManager (Raxol v2.0.1)
View SourceTerminal multiplexing system providing tmux-like session management for Raxol.
This module implements comprehensive terminal session multiplexing with:
- Multiple terminal sessions with independent state
- Window and pane management within sessions
- Session persistence across disconnections
- Remote session attachment and detachment
- Session sharing and collaboration features
- Automatic session recovery and state preservation
- Advanced session management (naming, grouping, tagging)
Features
Session Management
- Create, destroy, and switch between multiple sessions
- Named sessions with metadata and tags
- Session persistence to disk with state recovery
- Automatic cleanup of orphaned sessions
- Session templates and presets
Window and Pane Management
- Multiple windows per session
- Split windows into panes (horizontal/vertical)
- Pane resizing and layout management
- Window/pane navigation and switching
- Synchronized input across panes
Advanced Features
- Session sharing between multiple clients
- Remote session access over network
- Session recording and playback
- Custom session hooks and automation
- Resource monitoring and limits
Usage
# Create a new session
{:ok, session} = SessionManager.create_session("dev-session",
windows: 3,
layout: :main_vertical
)
# Attach to an existing session
{:ok, client} = SessionManager.attach_session("dev-session")
# Create window with panes
{:ok, window} = SessionManager.create_window(session, "editor",
panes: [
%{command: "nvim", directory: "/home/user/project"},
%{command: "bash", directory: "/home/user/project"}
]
)
# Detach and session continues running
SessionManager.detach_client(client)
Summary
Functions
Attaches a client to a session.
Broadcasts input to all panes in a window (synchronized input).
Returns a specification to start this module under a supervisor.
Creates a new terminal session.
Creates a new window in a session.
Destroys a session and all its windows/panes.
Destroys a window and all its panes.
Detaches a client from their current session.
Enables session sharing for collaboration.
Gets detailed information about a session.
Gets session statistics and resource usage.
Callback implementation for Raxol.Core.Behaviours.BaseManager.handle_manager_cast/2.
Lists all available sessions.
Resizes a pane.
Restores session from persistent storage.
Saves session state to persistent storage.
Sends input to a specific pane.
Splits a pane horizontally or vertically.
Switches the active pane in a window.
Switches the active window in a session.
Types
Functions
Attaches a client to a session.
Broadcasts input to all panes in a window (synchronized input).
Returns a specification to start this module under a supervisor.
See Supervisor.
Creates a new terminal session.
Examples
{:ok, session} = SessionManager.create_session("dev",
windows: 2,
layout: :main_vertical,
working_directory: "/home/user/project"
)
Creates a new window in a session.
Destroys a session and all its windows/panes.
Destroys a window and all its panes.
Detaches a client from their current session.
Enables session sharing for collaboration.
Gets detailed information about a session.
Gets session statistics and resource usage.
Callback implementation for Raxol.Core.Behaviours.BaseManager.handle_manager_cast/2.
Lists all available sessions.
Resizes a pane.
Restores session from persistent storage.
Saves session state to persistent storage.
Sends input to a specific pane.
Splits a pane horizontally or vertically.
Switches the active pane in a window.
Switches the active window in a session.