Repository navigation
Open terminal: bring back the app the session runs in - #238
Merged
Louis-CFM merged 1 commit intoOct 8, 2026
Merged
Conversation
"Open terminal" and the Jump to terminal shortcut picked the first running app from a fixed list (Terminal, iTerm, kitty, Ghostty). Sessions in any other terminal (cmux, Warp, WezTerm, Alacritty...) got a new Terminal.app window instead. The hook already sends the session's app as bundle_id. Keep it on the task next to sessionCwd and activate that app first, then fall back to the known terminals (now including cmux, Warp, WezTerm and Alacritty), then Terminal.app as before. The three copies of the list now share TerminalTarget, which has Foundation-only tests. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Owner
|
Merged in #326 — thank you @mateuslamaral! "Open terminal" now brings back the app the session actually runs in, VS Code included (that fixes #291). I combined it with #282's terminal detection: Claude Code's terminal first, then the session's app, then any running terminal. 🙏 Generated by Claude Code |
JhoanG956
pushed a commit
to JhoanG956/coucou
that referenced
this pull request
Oct 8, 2026
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LJm3SRL9k3gBPaVtfPhwcT
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 terminal" (finished card), the ⌃⌥T Jump to terminal shortcut and tapping a session now bring back the app the session actually runs in, instead of the first running app from a fixed list.
Why
The three places that jump to a terminal each had their own copy of
["com.apple.Terminal", "com.googlecode.iterm2", "net.kovidgoyal.kitty", "com.mitchellh.ghostty"]. With Claude Code running in any other terminal (cmux in my case, but also Warp, WezTerm, Alacritty…), none of those is running, so Coucou opens a new Terminal.app window instead of going back to the session.nb-hookalready sends the session's app asbundle_id(__CFBundleIdentifier), so the information is there. It just wasn't used for jumping.How
AgentTask.sessionBundleId, stored next tosessionCwdbyupsertWorkspaceTaskfrom the hook'sbundle_id.TerminalTarget(Foundation only): candidates = the session's app first, then the known terminals, now including cmux, Warp, WezTerm and Alacritty.TerminalTarget.activate(sessionBundleId:)(AppKit) replaces the three copies of the list. If nothing is running, the existing fallback (open Terminal.app) is unchanged.No visual change, no new permission, nothing new for the App Store build (all call sites are still under
#if !APPSTORE).Tests
Covers: session app preferred, VS Code session, fallback order, blank or missing bundle id, nothing running, no duplicate entries.
Built with
xcodegen && xcodebuild -scheme NotchBuddy -configuration Debug build: BUILD SUCCEEDED. The two new files are picked up byxcodegen. I left the regeneratedproject.pbxprojout of this PR: the committed one is behindproject.ymlonmain, so regenerating it adds ~900 unrelated lines.How to reproduce the bug
🤖 Generated with Claude Code