Closed rriski closed 1 year ago
I believe test "$TERM_PROGRAM" != 'vscode'
still work on VSCode version >= 1.75? There's no mention about they're deprecating $TERM_PROGRAM
for $VSCODE_RESOLVING_ENVIRONMENT
?
Unfortunately my tests suggest otherwise. Not sure why TERM_PROGRAM is not set anymore during initialization. To duplicate the issue and see what the ENV is during VSCode initialization do the following (this is on MacOS Ventura VSCode 1.75.0):
open -a "Visual Studio Code.app" --args --crash-reporter-directory /Users/yourusername/vscode-dump/ --log trace
set -U fish_tmux_autostart true && set -U fish_tmux_autostart_once true
/Users/yourusername/Library/Application Support/Code/logs
, there should be multiple log folders named something like 20230208T114023. Remove them )cat main.log
getUnixShellEnvironment#env
, this doesn't include TERM_PROGRAM anymore, only VSCODE_RESOLVING_ENVIRONMENT
❯ cat main.log | grep 'getUnixShellEnvironment#env'
2023-02-08 14:07:30.310 [trace] getUnixShellEnvironment#env {"PWD":"/Users/yourusername","MallocNanoZone":"0","USER":"yourusername","SECURITYSESSIONID":"186b4","COMMAND_MODE":"unix2003","__CFBundleIdentifier":"com.microsoft.VSCode","PATH":"/usr/bin:/bin:/usr/sbin:/sbin","LOGNAME":"yourusername","SSH_AUTH_SOCK":"/private/tmp/com.apple.launchd.MHgmPoHg3a/Listeners","SHLVL":"1","HOME":"/Users/yourusername","SHELL":"/opt/homebrew/bin/fish","_":"/usr/bin/open","TMPDIR":"/var/folders/yl/51y2f87n5jlfxmfffdt_c_080000gn/T/","LaunchInstanceID":"192329C3-C256-4F14-B27D-63319C8AE4C2","__CF_USER_TEXT_ENCODING":"0x1F5:0x0:0x0","XPC_SERVICE_NAME":"application.com.microsoft.VSCode.32703206.32703212","XPC_FLAGS":"0x0","ORIGINAL_XDG_CURRENT_DESKTOP":"undefined","VSCODE_CWD":"/","VSCODE_NLS_CONFIG":"{\"locale\":\"en-gb\",\"availableLanguages\":{},\"_languagePackSupport\":true}","VSCODE_CODE_CACHE_PATH":"/Users/yourusername/Library/Application Support/Code/CachedData/e2816fe719a4026ffa1ee0189dc89bdfdbafb164","VSCODE_IPC_HOOK":"/Users/yourusername/Library/Application Support/Code/1.75.0-main.sock","VSCODE_PID":"27380","ELECTRON_RUN_AS_NODE":"1","ELECTRON_NO_ATTACH_CONSOLE":"1","VSCODE_RESOLVING_ENVIRONMENT":"1"}
Code/logs/20230208T140730 on ☁️ (eu-west-1)
❯ cat main.log | grep 'TERM_PROGRAM'
On earlier versions TERM_PROGRAM was set, on 1.75.0 it seems that it is not.
Okay, thanks for the PR!
The January 2023 release of VSCode added a new
VSCODE_RESOLVING_ENVIRONMENT
variable (https://code.visualstudio.com/updates/v1_75#_new-vscoderesolvingenvironment-environment-variable) that is set to 1 when resolving user's shell environment.Related to #1, this fixes the same issue for VSCode version >= 1.75.