Skip to content

[WIP] Fix Babble upgrade issue with running terminal app#3

Draft
Copilot wants to merge 3 commits intomainfrom
copilot/fix-terminal-upgrade-issue
Draft

[WIP] Fix Babble upgrade issue with running terminal app#3
Copilot wants to merge 3 commits intomainfrom
copilot/fix-terminal-upgrade-issue

Conversation

Copy link
Copy Markdown

Copilot AI commented Feb 12, 2026

  • Create TerminalDetector Ruby module for Homebrew-managed terminals
  • Exclude Terminal.app (not in Homebrew ecosystem)
  • Integrate terminal detection into BrewUpgrade module
  • Exclude running terminal by upgrading packages individually
  • Add user notification when terminal is detected and excluded
  • Update README documentation
  • Test implementation
  • Code review
Original prompt

This section details on the original issue you should resolve

<issue_title>Babble should not upgrade the terminal app being used to run itself</issue_title>
<issue_description>Babble should not attempt to upgrade the terminal (e.g., iTerm2, Terminal.app, Alacritty, etc.) that is running Babble itself.

Proposed Implementation:

  • Detect the terminal parent process in which Babble is running (e.g., using lsappinfo or process tree traversal).
  • Map the terminal's bundle ID to the corresponding Homebrew cask token.
  • Exclude that token from brew upgrade (either by using a supported exclusion mechanism or skipping via logic in Babble's upgrade orchestration).
  • Notify the user in output that the running terminal was detected and skipped during the upgrade routine.

References:

  • See the README To Do: "Do not attempt to upgrade the terminal being used to run Babble itself."
  • See conversation: recommend lsappinfo info -only bundleid $(lsappinfo front), or process traversal via ps -o ppid= until you hit an .app bundle, for bundle detection.

Note: This issue can be implemented as a follow-up to the current Ruby reimplementation. </issue_description>

<agent_instructions>See PR#1 and CLAUDE.md and AGENTS.md in branch refactor/modular. Ref the conversation at https://github.com/copilot/c/5854a093-020f-4f65-bfa0-a43b51c26113.</agent_instructions>

Comments on the Issue (you are @copilot in this section)


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

@toobuntu
Copy link
Copy Markdown
Owner

@copilot try again (with claude opus 4.6)

@toobuntu
Copy link
Copy Markdown
Owner

@copilot Your changes should be on top of #1, not main.

Copilot AI and others added 2 commits February 16, 2026 05:47
Co-authored-by: toobuntu <674390+toobuntu@users.noreply.github.com>
Co-authored-by: toobuntu <674390+toobuntu@users.noreply.github.com>
Copy link
Copy Markdown
Author

Copilot AI commented Feb 16, 2026

@copilot try again (with claude opus 4.6)

I've implemented the terminal detection feature for the Ruby version of Babble. The implementation includes:

Key Changes (commit 4319fd9):

  • Created TerminalDetector module that detects running terminals via TERM_PROGRAM env var or process tree traversal
  • Integrated terminal detection into BrewUpgrade to exclude the running terminal from upgrades
  • Terminal is excluded by getting the list of outdated packages and upgrading them individually (since brew upgrade doesn't have an --except flag)
  • Updated README to document the feature

Supported Terminals:
iTerm2, Alacritty, Kitty, WezTerm, Hyper, Emacs, MacVim, VSCode, VSCodium, and Terminal.app

Code Quality:

  • ✅ Code review completed, all issues addressed
  • ✅ Security scan: 0 alerts
  • ✅ Ruby syntax validated

The changes are based on PR#1's Ruby implementation as requested.

Copy link
Copy Markdown
Author

Copilot AI commented Feb 16, 2026

@copilot Your changes should be on top of #1, not main.

I've updated the implementation to be based on top of PR#1 (commit 0f6da63). The changes now include:

Key features:

  • Ruby-based TerminalDetector module that detects Homebrew-managed terminals (iTerm2, Alacritty, Kitty, WezTerm, Hyper, etc.)
  • Terminal.app excluded as it's not part of the Homebrew ecosystem
  • Integrated into BrewUpgrade to exclude the running terminal from upgrades
  • Terminal excluded by upgrading packages individually (since brew doesn't have an --except flag)
  • User notification when terminal is detected and skipped

Supported Terminals:
iTerm2, Alacritty, Kitty, WezTerm, Hyper, Emacs, MacVim, VSCode integrated terminal, VSCodium integrated terminal

The implementation is built on top of PR#1's Ruby architecture as requested.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Babble should not upgrade the terminal app being used to run itself

2 participants