Repository navigation
feat(launch): add agterm overlay backend - #238
Merged
Merged
Conversation
detect $AGTERM_SESSION_ID and open revdiff in a full-pane agterm overlay via `agtermctl session overlay open <cmd> --target <sid> --block`. agterm's --block blocks until the overlay exits and returns revdiff's exit code, so no sentinel poll is needed. Checked first so an agterm session always uses its native overlay. Documented in README, site/docs.html, and the codex plugin README; both launcher copies kept in sync.
There was a problem hiding this comment.
Pull request overview
Adds agterm as the highest-priority terminal overlay backend for the revdiff launcher scripts, and updates documentation to reflect the new supported terminal and detection/priority behavior.
Changes:
- Add an agterm backend to both
launch-revdiff.shcopies, usingagtermctl session overlay open … --blockwhen$AGTERM_SESSION_IDis present. - Update terminal-support tables and priority order in user-facing docs (
README.md,site/docs.html) and Codex plugin docs (plugins/codex/README.md).
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
plugins/codex/skills/revdiff/scripts/launch-revdiff.sh |
Adds agterm overlay backend (highest priority) using agtermctl and blocking execution. |
.claude-plugin/skills/revdiff/scripts/launch-revdiff.sh |
Mirrors the agterm backend logic for the Claude Code plugin copy. |
README.md |
Documents agterm support and updates the backend priority chain. |
site/docs.html |
Updates the published docs HTML with agterm support and revised priority chain. |
plugins/codex/README.md |
Updates Codex skill requirements to include agterm as a supported terminal. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| <p>Priority: agterm → tmux → zellij → herdr → kitty → wezterm/kaku → cmux → ghostty → iTerm2 → Emacs vterm (first detected wins). cmux is checked before ghostty when <code>$CMUX_SURFACE_ID</code> is set, <code>__CFBundleIdentifier=com.cmuxterm.app</code>, or <code>GHOSTTY_RESOURCES_DIR</code> / <code>GHOSTTY_BIN_DIR</code> contains <code>cmux.app</code>. iTerm2 uses a split pane rather than a full-screen overlay.</p> | ||
| <p><strong>Sandbox note:</strong> Ghostty and iTerm2 launchers use <code>osascript</code> (Apple Events), which is blocked by Claude Code's sandbox. If you use these terminals with sandbox enabled, add the launcher to <code>excludedCommands</code> in your Claude Code <code>settings.json</code>:</p> | ||
| <div class="code-block"><code>{ "permissions": { "excludedCommands": ["*/launch-revdiff.sh*"] } }</code></div> | ||
| <p>Terminals that use CLI tools instead of AppleScript (tmux, Zellij, herdr, kitty, wezterm, cmux) are not affected.</p> |
| | **Emacs vterm** | New frame via `emacsclient` | `$INSIDE_EMACS` env var | | ||
|
|
||
| Priority: tmux → Zellij → herdr → kitty → wezterm/Kaku → cmux → ghostty → iTerm2 → Emacs vterm (first detected wins). If none are available, the plugin exits with an error. | ||
| Priority: agterm → tmux → Zellij → herdr → kitty → wezterm/Kaku → cmux → ghostty → iTerm2 → Emacs vterm (first detected wins). If none are available, the plugin exits with an error. |
the "not affected by osascript restrictions" note omitted agterm (added here) and Kaku (uses kaku cli, not AppleScript). Only ghostty and iTerm2 use osascript. Keeps README and site/docs.html in sync.
Deploying revdiff with
|
| Latest commit: |
0e44296
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://321172a3.revdiff.pages.dev |
| Branch Preview URL: | https://agterm-overlay-backend.revdiff.pages.dev |
umputun
added a commit
that referenced
this pull request
Jun 30, 2026
* fix: detect renames when the new file is untracked a plain `mv old new` (no `git mv`/staging) left `old` as an unstaged deletion and `new` untracked, so `git diff -M` never paired them - the tree showed a deletion plus an all-+ add instead of one rename. `UntrackedRenames` recovers the pairing off a throwaway index: copy `.git/index`, `git add -N` the untracked paths against the copy via `GIT_INDEX_FILE`, then `git diff -M` reports the rename. The real index and working tree are never touched. `FileDiff` renders these the same way via `untrackedRenameDiff`. Git-only (hg/jj have no untracked-rename concept), gated to unstaged working-tree mode. Related to #243 * fix(test): clear AGTERM env so launcher exit-code test stays hermetic `cleanOverlayEnv` cleared every overlay-detection var except the agterm ones. On an agterm host `AGTERM_SESSION_ID` leaked from the real environment, so the launcher took its agterm branch (real `agtermctl session overlay open`) instead of the fake backend under test. That path doesn't pipe the fake revdiff's stdout/exit back, so every non-clean case returned exit 0 / empty output, while the "clean" case passed by coincidence. CI stayed green because CI isn't an agterm session. now clear `AGTERM_SESSION_ID` and `AGTERM_SOCKET` too. The agterm overlay backend (#238) added the launcher branch but left this helper out of sync. * fix(review-loop): iteration 1 addressed 8 findings - [major] [annotations_load.go] --annotations preload now runs the untracked-rename detector (foldUntrackedRenames) so (-)/context annotations on an untracked rename round-trip instead of being dropped as all-added - [major] [diff.go] untracked-rename git calls use GIT_LITERAL_PATHSPECS=1 (renameIndexEnv) so a filename like ":(top)x" is treated literally, not as pathspec magic - [minor] [diff.go] temp index path made absolute (filepath.Abs) so GIT_INDEX_FILE and cleanup agree when TMPDIR is relative - [minor] [diff.go] UntrackedRenames returns nil on a missing .git/index (fresh repo, no commits) instead of a spurious WARN - [over-engineering] [loaders.go] dropped the redundant renameNew map in mergeUntrackedEntries (entrySet already covers rename new-sides) - [test-gap] [diff_test.go] added pure-rename, path-with-spaces, pathspec-magic-name, and no-commit-repo tests - [test-gap] [annotations_load_test.go] added untracked-rename preload round-trip test - [doc-gap] [site/docs.html] rename-detection paragraph now covers the working-tree --untracked case CLAUDE.md gotcha updated to match. * fix(review-loop): final cleanup pass — addressed 1 finding - [minor] [diff.go] scope the no-index no-op to the missing-.git/index case via an errNoIndex sentinel; previously errors.Is(err, fs.ErrNotExist) wrapped the whole tempIndexWithIntentToAdd call, so an ENOENT from os.CreateTemp (missing TMPDIR) or a corrupt index was swallowed and silently disabled rename detection. other ENOENT now propagates with a warning. - [test] [diff_test.go] added TestGit_UntrackedRenames_RealErrorNotSwallowed
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.
Adds agterm to the terminal overlay backends in
launch-revdiff.sh, so a coding agent running inside an agterm session opens revdiff in a full-pane agterm overlay instead of falling through to a non-agterm backend.How it works. When
$AGTERM_SESSION_IDis set andagtermctlis on PATH, the launcher runsagtermctl session overlay open "<revdiff cmd>" --target $AGTERM_SESSION_ID --block --socket $AGTERM_SOCKET. The--blockflag opens the overlay, blocks until revdiff exits, and returns revdiff's exit code directly, so unlike the kitty/zellij/herdr backends there is no sentinel file to poll. Full-pane mode is just omitting--size-percent. It is checked first in the priority chain, so an agterm session always uses its native overlay even when a multiplexer is also present.Docs and sync. Backend table and priority updated in
README.md,site/docs.html, andplugins/codex/README.md. Bothlaunch-revdiff.shcopies (.claude-pluginandplugins/codex) stay byte-identical except the sync comment, and both pass shellcheck.Verified by mocking
agtermctl/revdiffon PATH: an agterm session builds the overlay command correctly (env prefix,--output,--target,--block,--socket), and a non-agterm session falls through unchanged.