feat(launcher): macOS bundle detection, iTerm2 validation, PR #421 review fixes - #422
Merged
Conversation
…view fixes Add macOS .app bundle detection for kitty, alacritty, wezterm, ghostty in /Applications/. Make iTerm2 conditional on installation. Enhance validateTerminalExists for iterm2 app check. Fix env var duplication in ocm-container + AppleScript wrapper flow. Extract shared buildTerminalCommand helper. Add login() integration tests for AppleScript wrapper path. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…rop ghostty, test isolation Bundle-detected terminals now emit the full binary path as Command (e.g., /Applications/kitty.app/Contents/MacOS/kitty) so exec.Command can find them even when not on PATH. Drop ghostty from bundle map — its macOS CLI cannot reliably launch the terminal (needs open -na). Tests now use t.TempDir() via SREPD_WRAPPER_DIR env override instead of writing to the real ~/.cache/srepd/launch directory. Drop misleading TestLogin_AppleScriptWrapperWriteFailureReturnsError test. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…ER_DIR to SREPD_TEST_WRAPPER_DIR Add docs/terminals.md covering all supported terminals across Linux, Flatpak, macOS, and Toolbox — profiles, env var passing, wrapper scripts, and known limitations. Rename SREPD_WRAPPER_DIR to SREPD_TEST_WRAPPER_DIR to make clear it is a test hook, not user-facing configuration. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
The example showed --env= flags combined with an ocm-container login command, but those are mutually exclusive branches in login(). Switched to a non-ocm login command. Also fixed INC_ID shorthand to use real PAGERDUTY_* variable names and added missing cluster_login_command. Co-Authored-By: Claude Opus 4.6 <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.
Summary
.appbundles in/Applications/— the config wizard now offers them even when they're not on PATH/Applications/iTerm.appactually exists (previously unconditional on darwin)buildTerminalCommandhelper, clarifying comment on AppleScript testDetail
Detection (
detect.go)Added
macOSBundleTerminalsmap and injectablestatFnparameter toDetectTerminals. On darwin, after PATH probing, each known bundle path is stat'd. PATH-found terminals take precedence. iTerm2 now guarded bystatFn("/Applications/iTerm.app"). Terminal.app stays unconditional.PR #421 review items
commands_test.go): 3 tests proving the wrapper branch is taken for AppleScript (osascript error on Linux), wrapper scripts are created, and env vars aren't duplicated in the ocm+wrapper flowcommands.go): When ocm-container is present, env vars are now passed only as-eflags —exportlines in the wrapper script are skippedlauncher.go): ExtractedbuildTerminalCommand()— all threeBuild*Commandmethods delegate to it, removing ~50 lines of duplicationappleScriptEscapeinBuildCommand— no change neededREADME
Added macOS terminal support section documenting bundle detection, wrapper scripts, and cleanup behavior.
Test plan
make fmt-check— cleanmake vet— cleanmake lint— 0 issuesmake test— all passmake test-race— all passmake build+/tmp/srepd --dev— TUI renders correctly, no regressionsmake plan-check—docs/plans/416-macos-terminal-coverage.mdpresentmake readme-check— README in diff (real update, not skip-readme)fakeStat/fakeLookPath🤖 Generated with Claude Code