Expose environment variable for GitLab Duo Agentic Chat terminal sessions
### Summary Currently, users experiencing issues with shell plugins (like powerlevel10k) in GitLab Duo Agentic Chat terminal sessions need to completely disable these plugins for all VS Code terminals using `TERM_PROGRAM != "vscode"`. This approach is too broad and prevents users from enjoying their customized shell experience in regular VS Code terminals. We should expose a specific environment variable when launching terminals for GitLab Duo Agentic Chat sessions. ### Proposal Add a `GITLAB_DUO_AGENTIC_CHAT` environment variable (boolean 1/0) when creating terminals for Duo Agentic Chat sessions. ### Benefits 1. **Granular control**: Users can disable heavy shell plugins only for agent sessions while keeping them for regular VS Code terminal usage 2. **Better user experience**: Users don't lose their customized shell experience in regular terminals 3. **Cleaner documentation**: More specific workaround instructions 4. **Follows industry patterns**: Similar to Cursor's approach with `CURSOR_AGENT_SESSION` ### Implementation Based on @shekharpatnaik's analysis, this can be implemented in [`src/common/duo_workflow/terminal_manager.ts`](https://gitlab.com/gitlab-org/gitlab-vscode-extension/-/blob/main/src/common/duo_workflow/terminal_manager.ts#L77): ```typescript async #createTerminal(workflowId: string) { const terminal = window.createTerminal({ name: `GitLab Duo Agent Platform ${workflowId}`, isTransient: true, env: { GITLAB_DUO_AGENTIC_CHAT: "1" } }); this.#terminals[workflowId] = terminal; await this.#listenForShellIntegration(terminal); return this.#terminals[workflowId]; } ``` ### User Configuration Example With this change, users could configure their shell more precisely: ```zsh # Disable heavy prompts only for GitLab Duo Agentic Chat sessions if [[ "$GITLAB_DUO_AGENTIC_CHAT" != "1" ]]; then # Load Oh-My-ZSH and powerlevel10k for regular terminals source $ZSH/oh-my-zsh.sh [[ ! -f ~/.p10k.zsh ]] || source ~/.p10k.zsh fi ``` ### Related Issues - #2070 - Document that some shell plugins can break VS Code Shell integration ### References - [VS Code Shell Integration documentation](https://code.visualstudio.com/docs/terminal/shell-integration#_manual-installation)
issue