it2 session split

Split a session pane

Synopsis

it2 session split [<session-id>] [flags]

Description

Split a session pane horizontally or vertically, creating a new session.

If no session-id is provided, uses $ITERM_SESSION_ID environment variable.
If neither --horizontal nor --vertical is specified, automatically chooses based on
session dimensions: vertical split when width > height, horizontal otherwise.

Examples

# Split current session (auto-detects best direction)
$ it2 session split
# Split current session vertically
$ it2 session split --vertical
# Split specific session horizontally
$ it2 session split SESSION-ID --horizontal
# Split with badge text
$ it2 session split --badge "Build"
# Split and just output the new session ID (for scripting)
$ it2 session split --quiet
# Split and run a command in the new session
$ it2 session split --vertical --command "ssh vm1"

Options

--badge

Set badge text on new session(s)

--before

Create new pane before the current one

--command

Command to run in the new session

--horizontal

Split horizontally

--json

Output result as JSON

--profile

Profile name for the new session (optional, uses default if not specified)
-q, --quiet
Only output the new session ID (for scripting)

--vertical

Split vertically

Options inherited from parent commands

--format (default "text")

Output format (text, json, yaml) - affects how command results are displayed

--timeout

Timeout for API operations - how long to wait for iTerm2 to respond

--url

WebSocket URL for iTerm2 API - typically ws://localhost:1912 for local iTerm2

See Also