Skip to content

Add a setting to control @ file path context in VSCode terminal #25012

@DirkRemmers

Description

@DirkRemmers

Hello team!

I've noticed a change in behavior since version 0.36.0 regarding how file paths are resolved for @ mentions when running gemini-cli inside the VSCode integrated terminal.

Before v0.36.0: When I launched gemini-cli (in VSCode) from a specific folder, for example my_project/src/component1/, any file I referenced with @ would use a path relative to that components directory. For instance, a file at my_project/src/component1/button.js could be referenced simply as @button.js. I found this quite logical, and easy to use.

From v0.36.0 onwards: The context for @ mentions seems to be the entire path. Using the same example, if my workspace root is my_project, the reference to the same file becomes @c:/Users/User/path_to_project/src/component1/button.js. In addition, it also shows files outside of the cwd, that are in the project. This becomes very inconventient if your project contains many folders that are called similarly, for example, if I also have a button in another component (e.g. c:/Users/User/path_to_project/src/component2/button.js)

Interestingly, if I run gemini-cli v0.36.0 in a standalone terminal, it still operates with the old, desired behavior. This leads me to believe the change is specific to the VSCode integration.

After looking through the changelog, I believe this change might have been introduced by the following pull request:
#21380: fix(cli): automatically add all VSCode workspace folders to Gemini context

While I understand the idea of making the context the entire workspace, it would be great to have control over this behavior. Would it be possible to introduce a setting (perhaps in settings.json) that allows users to choose the desired context for @ file mentions?

Alternatively, if there's an existing workflow to achieve the old behavior within VSCode that I'm not aware of, I would also be helped to get to know more about that instead!

Thanks in advance!

Metadata

Metadata

Assignees

No one assigned

    Labels

    area/coreIssues related to User Interface, OS Support, Core Functionalitystatus/need-triageIssues that need to be triaged by the triage automation.

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions