it2 session lookup after

Look up the pane immediately after (right or below)

Synopsis

it2 session lookup after [<session-id>] [flags]

Description

Look up the session in the pane immediately after the given session.

This performs spatial lookup that adapts to split direction:

  • In a horizontal split (left-to-right): finds the pane to the right
  • In a vertical split (top-to-bottom): finds the pane below

If no session ID is provided, uses the current session from ITERM_SESSION_ID.
If there is no pane after, returns empty output.

Examples

Basic Usage

$ it2 session lookup after
$ it2 session lookup after sess_abc123
# Scripting Example - Focus next pane
$ next=$(it2 session lookup after -q)
$ if [ -n "$next" ]; then
$ it2 session focus "$next"
$ fi

Options

--json

Output result as JSON
-q, --quiet
Only output the session ID (for scripting)

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