Skip to content

Add Open in Terminal command#12

Merged
VdustR merged 2 commits intomainfrom
feat/open-in-terminal
Mar 16, 2026
Merged

Add Open in Terminal command#12
VdustR merged 2 commits intomainfrom
feat/open-in-terminal

Conversation

@VdustR
Copy link
Copy Markdown
Collaborator

@VdustR VdustR commented Mar 16, 2026

Summary

  • New Open in Terminal command — right-click any worktree, workspace file, or favorite to open a terminal at its location
  • Added "terminal" to openBehavior setting — users can set terminal as default click action
  • Inline $(terminal) button on non-favorite items for quick access
  • Leaf worktree/repository nodes (no workspace files) now respond to clicks via openBehavior
  • 4 customizable terminalName templates (favorites reuse non-favorite templates)
  • Prunable worktree guard — shows error instead of creating terminal when directory is missing

Test plan

  • Right-click worktree → "Open in Terminal" → terminal opens at worktree path
  • Right-click workspace file → terminal opens at dirname of file
  • Right-click favorite (repo, worktree, workspaceFile) → same behavior as original item
  • Right-click repository header → terminal opens at repo path
  • Right-click prunable worktree → error message shown, no terminal created
  • Inline terminal button visible on non-favorites, NOT on favorites
  • Change openBehavior to "terminal" → clicking workspace file opens terminal
  • Leaf worktree (no workspace files) → click triggers openBehavior
  • QuickPick shows "Open in Terminal" / "Always Open in Terminal"
  • Custom terminal name templates work
  • Detached HEAD → terminal name shows commit hash (e.g., 781a193)

🤖 Generated with Claude Code

New context menu and inline button to open a terminal at any item's
location. Terminal CWD resolves to the worktree directory for
worktree/repository items, or the parent directory for workspace files.

- Add "terminal" option to openBehavior setting with exhaustive switch
- 4 customizable terminalName templates (favorites reuse non-favorite)
- Inline $(terminal) button on non-favorite items
- Leaf worktree/repository clicks now trigger openBehavior
- QuickPick includes "Open in Terminal" / "Always Open in Terminal"
- Prunable worktree guard (fs.existsSync check before createTerminal)
- Fix resolveUri/resolveItemPath truthiness guard for GroupHeaderItem
- 12 new tests covering all item types and error cases

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@gemini-code-assist
Copy link
Copy Markdown

Summary of Changes

Hello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request significantly enhances user interaction by introducing a versatile 'Open in Terminal' feature. Users can now quickly open a terminal at the location of any worktree, workspace file, or favorite item, either through context menus, an inline button, or by configuring it as the default click behavior. This streamlines workflows by providing direct command-line access from within the extension's tree view, making it easier to manage and navigate projects.

Highlights

  • New 'Open in Terminal' Command: Introduced a new 'Open in Terminal' command accessible via right-click context menus for worktrees, workspace files, and favorites, as well as an inline button for non-favorite items. This command opens a terminal at the item's resolved location.
  • Configurable 'openBehavior' Setting: The openBehavior setting now includes a 'terminal' option, allowing users to set opening a terminal as the default click action for items. The QuickPick menu for 'ask' behavior has also been updated to include terminal options.
  • Enhanced Click Behavior for Leaf Items: Leaf worktree and repository nodes (those without workspace files) now respond to clicks via the openBehavior setting, providing more consistent interaction across item types.
  • Customizable Terminal Naming: Added 4 customizable terminalName templates for different item types (repository, worktree, repository workspace, worktree workspace), with favorites reusing non-favorite templates, allowing for personalized terminal titles.
  • Prunable Worktree Guard: Implemented a guard that checks for the existence of the target directory before creating a terminal for prunable worktrees, preventing errors and providing a user-friendly warning if the directory is missing.
  • Comprehensive Documentation: Updated and added new documentation, including a dedicated specification for 'Open in Terminal', to detail the command's behavior, CWD resolution, naming conventions, and integration with existing features.

🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console.

Changelog
  • git-work-grove
    • Added 'Open in Terminal' command for worktrees and workspace files.
    • Introduced new context menu and inline button for terminal access.
    • Terminal CWD resolves to the worktree directory or parent directory for workspace files.
    • Implemented customizable terminal name templates for all 4 item types.
    • Added 'terminal' option to the openBehavior setting.
    • Enabled leaf worktrees/repository items to respond to clicks via openBehavior.
    • Included 'Open in Terminal' and 'Always Open in Terminal' options in QuickPick menus.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link
Copy Markdown

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces the "Open in Terminal" command to the Git WorkGrove extension, allowing users to open a terminal at the location of worktrees, workspace files, or favorites. It also adds a "terminal" option to the openBehavior setting, enabling users to set the terminal as the default click action. The changes include modifications to the README, documentation, package.json, and several source files to integrate the new command and setting. The addition of a new test file ensures the functionality of the new command.

Comment thread src/commands/openWorkspace.ts
Comment thread README.md
Comment thread docs/spec/commands.md
Comment thread src/commands/openWorkspace.ts
Comment thread src/extension.ts
Comment thread src/commands/openTerminal.ts
The never-typed default case already prevents compile-time misses;
adding a runtime throw provides defense-in-depth if an invalid
config value bypasses TypeScript types.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@VdustR VdustR merged commit 3173d91 into main Mar 16, 2026
1 check passed
@VdustR VdustR deleted the feat/open-in-terminal branch March 16, 2026 14:59
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.

1 participant