Repository navigation
✨ feat: 🖥️ open-as iterm2 — show a page in an iTerm2 browser tab beside the session - #88
Merged
Merged
Conversation
…de the session A session that wants to show a localhost dashboard or a report next to the terminal had no way to put it there: iTerm2 3.7's browser tabs cannot be reached from AppleScript (the dictionary has no URL verb), and handing the URL to iTerm2 through Finicky lands in an untested not-default-browser branch with no say over window or reuse. So the reserved alias `iterm2` drives the Python API directly: find the caller's window from ITERM_SESSION_ID, reuse that window's open-as tab or create one, load the URL. Tabs come from a dynamic profile with a fixed UUID Guid because WebKit keys the cookie jar by the profile's GUID, which is what makes "log in once per site" hold. The iterm2 library fetches its own cookie and key; handing it the raw `request cookie` reply as ITERM2_COOKIE (the first plan) would have stuffed both halves into one variable. The runtime is checked before anything talks to iTerm2, which otherwise offers to install it in a dialog nobody is watching. Every missing piece falls open to the old path with one stderr line naming it. Not yet run against a live iTerm2: the Python runtime is not installed on the development machine. Tests drive the real script against a fake `iterm2` module. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…ake the login A profile's browser pin becomes BROWSER for the whole session, so it takes every link Claude Code opens, the OAuth login included. The iTerm2 browser has no passkey entitlement (WKWebView restriction), so pinning it would send the login somewhere it may not complete. claude() now refuses the pin out loud and launches untagged; claude-doctor says REFUSED rather than calling it an invalid alias, which it is not. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
A feature no session knows about never gets used; the shared memory is what every profile reads, so the instruction lives there, next to the Claude in Chrome guidance it must not be confused with (viewing, not automation). Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
open-as iterm2 <url>opens a URL in an iTerm2 3.7 web-browser tab in the calling session's window, reusing that window's tab on later calls. It's for localhost dashboards, status pages and reports that a Claude session wants to show beside the terminal.open-aswith a fixed UUID Guid. WebKit keys the cookie jar by the profile's GUID, so you log in once per site.browser.tag.iterm2if an overlay pins one.claude()refusesiterm2as a profile's browser pin.BROWSERtakes the OAuth login too, and iTerm2's browser has no passkeys.claude-doctorreports it as REFUSED.open-as iterm2for viewing. Claude in Chrome stays the automation path.Decided against
opbackend, fills on request instead.verify.shis 47/48 on 3.7.3 because the "AI key is stored in the Keychain" sentence is gone from the binary, and that sentence is the safety claim behind tracking the prefs plist.Verified
bats tests: 560 pass. The newtests/open-as.batsdrives the real script against a fakeiterm2module.iterm22.24 package source./code-review: the first-run profile-load race is fixed with a retry instead ofsleep 1.ITERM_SESSION_ID's UUID is the API's session idfile://renders🤖 Generated with Claude Code