libtmux_mcp.tools.server_tools.create_session
- libtmux_mcp.tools.server_tools.create_session ( session_name: str | None = None, window_name: str | None = None, start_directory: str | None = None, x: int | None = None, y: int | None = None, environment: dict[str, str] | str | None = None, socket_name: str | None = None, suppress_persistent_history: bool = False, ) Session
Info -
Create a new tmux session.
Description#
Check list_sessions first to avoid name conflicts. A new session starts with one window and one pane. Values in
environmentare stored in the tmux session environment, so future panes inherit them too.- Parameters
-
-
session_name(str | None) # – Name for the new session. -
window_name(str | None) # – Name for the initial window. -
start_directory(str | None) # – Existing directory to start in.~expands; a relative path resolves against the MCP server process's directory. -
environment(dict[str, str] | str | None) # – Environment variables to store in the session environment. Accepts either a dict of env vars or a JSON-serialized string of the same — the latter is the cursor-composer-1 workaround described inlibtmux_mcp._utils._coerce_dict_arg. Each item appears in the tmux client argv as one-eKEY=VALUEelement and may be visible to host process inspection during launch. tmux retains the values in tmux session state, whereshow-environmentcan reveal them. They reach the initial and future child environments unless a later spawn overrides them. MCP audit redaction does not hide these surfaces. Pass credential references, not literal credentials. -
socket_name(str | None) # – tmux socket name. Defaults to LIBTMUX_SOCKET env var. -
suppress_persistent_history(bool) # – Whether to suppress persistent history for the spawned shell. Defaults to False for MCP and direct Python calls. This per-call option does not inherit LIBTMUX_SUPPRESS_HISTORY. Startup files may override these controls.
-
- Returns
-
SessionInfo The created session.