Command URL options

11 views
Skip to first unread message

Daniel Rich

unread,
Feb 8, 2026, 12:38:25 AMFeb 8
to iterm2-discuss
Are there any other options to the command url other than what is documented at https://iterm2.com/documentation-command-selection.html

I'm looking to craft a URL that will open a new iTerm2 window, ssh to a remote host, and give me a shell. I would expect something like iterm2:@myhost.example.com to work, but that just changes the focus to my existing iTerm2 windows and doesn't ssh to the remote host -- with or without the leading "@". Going with iterm2:/command?c=ssh%20myhost.example.com mostly does what I'm looking for, but I have to answer the "new window, new tab, etc" prompt first. Using the "silent" parameter will suppress the query, but doesn't let me specify that it should run in a new window.

Are there a bunch of undocumented options to the item: URL or is this it?

George Nachman

unread,
Feb 12, 2026, 12:03:33 AMFeb 12
to iterm2-...@googlegroups.com
The format is, if you specify everything:

Iterm2://[username]@[hostname]/?c=[command]&d=[directory]&silent

So iterm2://example.com/ will open an SSH connection. There isn’t an option to default to window vs tab. If you want more control, AppleScript is probably the simplest solution.
Reply all
Reply to author
Forward
0 new messages