it2 session move
Move a session to be a split pane next to another session
Synopsis
it2 session move <source-session-id> <destination-session-id> [flags]
Description
Move a session to become a split pane by splitting another session.
The source session will be moved to split the destination session's pane.
This uses iTerm2's built-in move_session function.
The move will fail if:
- Either session ID is invalid
- Sessions are not compatible (e.g., tmux vs non-tmux)
- Either session has no tab
- Either session is locked
- Panes are maximized (will auto-unmaximize)
Options
-
-b,--before - Place source before/above destination (default: after/below)
-
--json - Output result as JSON
-
-q,--quiet - Quiet mode - minimal output
-
-v,--vertical - Split destination vertically (default: horizontal)
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
- it2 session - Manage iTerm2 sessions
Examples
# Move current session to split below another session (horizontal)
$ it2 session move $ITERM_SESSION_ID sess_abc123
# Move session to the left of destination (vertical split before)
$ it2 session move sess_abc123 sess_def456 --vertical --before
# Move session to the right of destination (vertical split after)
$ it2 session move sess_abc123 sess_def456 --vertical
# Move with JSON output for scripting
$ it2 session move sess_abc123 sess_def456 --json
# Quiet mode - no output unless error
$ it2 session move sess_abc123 sess_def456 --quiet