it2 tab close
Close one or more tabs
Synopsis
it2 tab close <tab-id> [tab-id...] [flags]
Description
Close one or more tabs by their IDs. Use --force to close without prompting
Options
-
--force - Force close the tabs without prompting
-
--format(default "table") - Output format (table|json|yaml|text)
-
--timeout(default "5s") - Command timeout
-
--url(default "ws://localhost:1912") - iTerm2 WebSocket URL
See Also
- it2 tab - Manage iTerm2 tabs
Examples
# Close a specific tab
$ it2 tab close tab-123
# Close multiple tabs
$ it2 tab close tab-123 tab-456 tab-789
# Close current tab
$ it2 tab close $(it2 tab current)
# Force close without confirmation
$ it2 tab close --force tab-123
# Close with JSON output
$ it2 tab close --format json tab-123
# Close all tabs in current window except current
$ for tid in $(it2 tab list --format id); do
[[ "$tid" != "$(it2 tab current)" ]] && it2 tab close --force $tid
done