Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Missing TERM_PROGRAM variable at launch time #173438

Closed
stefanistrate opened this issue Feb 4, 2023 · 2 comments
Closed

Missing TERM_PROGRAM variable at launch time #173438

stefanistrate opened this issue Feb 4, 2023 · 2 comments
Assignees
Labels
*as-designed Described behavior is as designed

Comments

@stefanistrate
Copy link

Does this issue occur when all extensions are disabled?: Yes

  • VS Code Version: 1.75.0
  • OS Version: macOS Ventura 13.2

Steps to Reproduce:

  1. Add the following line to ~/.zshrc (or the equivalent ~/.bashrc):
echo "TERM=$TERM_PROGRAM" >> ~/Desktop/debug.txt
  1. When launching VS Code, the variable TERM_PROGRAM is not set properly (i.e. the output of the text file I write to is TERM=).
  2. When opening the TERMINAL tab in VS Code afterwards, a new line is added to my output file with the correct TERM_PROGRAM (i.e. TERM=vscode).

Why is TERM_PROGRAM missing initially? This behaviour is stopping me from using TERM_PROGRAM to decide when to launch tmux automatically (i.e. I don't want to launch it when the terminal belongs to VS Code).

Any workarounds?

Thanks,
Ștefan

@meganrogge
Copy link
Contributor

maybe related #173277

@Tyriar
Copy link
Member

Tyriar commented Feb 6, 2023

This is by design, TERM_PROGRAM is only set when a terminal launches. You might be looking for the new environment variable VSCODE_RESOLVING_ENVIRONMENT that we just added in 1.75 https://code.visualstudio.com/updates/v1_75#_new-vscoderesolvingenvironment-environment-variable

@Tyriar Tyriar closed this as completed Feb 6, 2023
@Tyriar Tyriar added the *as-designed Described behavior is as designed label Feb 6, 2023
@github-actions github-actions bot locked and limited conversation to collaborators Mar 23, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
*as-designed Described behavior is as designed
Projects
None yet
Development

No branches or pull requests

5 participants