Skip to content

gh copilot: pass identifying env var to copilot process #12817

@devm33

Description

@devm33

Problem

The gh copilot command launches the Copilot CLI binary via exec.Command, but does not pass any environment variable or identifier that would allow the copilot process to know it was launched by gh.

This means the copilot process has no way to distinguish whether it was invoked directly by the user or through gh copilot.

Proposed solution

Set a GH_COPILOT=true environment variable on the subprocess before executing it:

externalCmd.Env = append(os.Environ(), "GH_COPILOT=true")
Pinned by williammartin

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementa request to improve CLIgh-copilotrelated to the gh copilot command

    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