microsoft / vscode

Visual Studio Code
https://code.visualstudio.com
MIT License
160.96k stars 28.24k forks source link

Incorrect $PATH order in task shell #187955

Open ryanb opened 1 year ago

ryanb commented 1 year ago

Type: Bug

I have a custom task in tasks.json. Since upgrading to 1.80 it's loading my $PATH env variable in an incorrect order.

I have tested this by adding this task in tasks.json.

{
  "label": "echo PATH",
  "type": "shell",
  "command": "echo $PATH"
},

When I run this task it shows a different $PATH than when I choose New Terminal within VS Code and run echo $PATH. The paths themselves appear the same, just in a different order which is causing issues with finding the proper bins.

I'm on Mac OS X 13.3 and use zsh.

VS Code version: Code 1.80.1 (Universal) (74f6148eb9ea00507ec113ec51c489d6ffb4b771, 2023-07-12T17:20:23.298Z) OS version: Darwin x64 22.4.0 Modes:

System Info |Item|Value| |---|---| |CPUs|Intel(R) Core(TM) i9-9880H CPU @ 2.30GHz (16 x 2300)| |GPU Status|2d_canvas: enabled
canvas_oop_rasterization: disabled_off
direct_rendering_display_compositor: disabled_off_ok
gpu_compositing: enabled
metal: disabled_off
multiple_raster_threads: enabled_on
opengl: enabled_on
rasterization: enabled
raw_draw: disabled_off_ok
video_decode: enabled
video_encode: enabled
vulkan: disabled_off
webgl: enabled
webgl2: enabled
webgpu: enabled| |Load (avg)|2, 2, 2| |Memory (System)|16.00GB (0.58GB free)| |Process Argv|. --crash-reporter-id f3967eb1-1d64-41bb-a279-ee5aa5d9697f| |Screen Reader|no| |VM|0%|
Extensions (12) Extension|Author (truncated)|Version ---|---|--- vscode-toggle-quotes|Bri|0.3.6 compulim-vscode-closetag|Com|1.2.0 vscode-mac-color-picker|dae|1.1.0 vscode-eslint|dba|2.4.2 ERB Syntax|und|0.0.1 prettier-vscode|esb|9.19.0 batch-rename-extension|Jan|0.0.6 dotenv|mik|1.0.1 remote-containers|ms-|0.299.0 material-icon-theme|PKi|4.28.0 vscode-syntax-tree|rub|0.5.1 svelte-vscode|sve|107.8.0 (1 theme extensions excluded)
A/B Experiments ``` vsliv368cf:30146710 vsreu685:30147344 python383cf:30185419 vspor879:30202332 vspor708:30202333 vspor363:30204092 vswsl492:30256859 vslsvsres303:30308271 vserr242cf:30382550 pythontb:30283811 vsjup518:30340749 pythonptprofiler:30281270 vshan820:30294714 vstes263cf:30335440 vscod805cf:30301675 binariesv615:30325510 bridge0708:30335490 bridge0723:30353136 vsaa593cf:30376535 pythonvs932:30410667 py29gd2263cf:30789497 vsclangdc:30486549 c4g48928:30535728 dsvsc012cf:30540253 pynewext54:30695312 azure-dev_surveyone:30548225 vscccc:30610679 282f8724:30602487 pyind779:30671433 89544117:30613380 vscrp:30673768 pythonsymbol12:30671437 showlangstatbar:30737416 vsctsb:30748421 pythonms35:30701012 03d35959:30757346 pythonfmttext:30731395 pythoncmv:30756943 fixshowwlkth:30771522 showindicator:30785052 pythongtdpath:30769146 i26e3531:30780429 pythonnosmt12:30779714 pythonidxpt:30784022 pythonnoceb:30776495 h7j2d465:30786200 dsvsc013cf:30789518 ```
meganrogge commented 1 year ago

can you reproduce the issue in insider's?

ryanb commented 1 year ago

@meganrogge yes, it is happening there too, fresh Insider install.

Version: 1.81.0-insider (Universal) Commit: dc142e4cd111b8f370d0549d8c207df7de55facd Date: 2023-07-14T10:58:42.494Z Electron: 22.3.14 ElectronBuildId: 21893604 Chromium: 108.0.5359.215 Node.js: 16.17.1 V8: 10.8.168.25-electron.0 OS: Darwin x64 22.4.0

ryanb commented 1 year ago

For the record, here are my two $PATH envs, split on : for easy comparing.

From Task

/usr/local/bin
/System/Cryptexes/App/usr/bin
/usr/bin
/bin
/usr/sbin
/sbin
/opt/X11/bin
/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/local/bin
/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/bin
/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/appleinternal/bin
/Users/rbates/.asdf/shims
/usr/local/opt/asdf/libexec/bin
/usr/local/opt/postgresql/bin
/Users/rbates/.rbenv/shims
/Users/rbates/.oh-my-zsh/custom/plugins/rbates/bin
/usr/local/sbin
/Users/rbates/Library/Android/sdk/tools
/Users/rbates/Library/Android/sdk/platform-tools
/Users/rbates/.sentinel/current/bin

From Terminal

/Users/rbates/.asdf/shims
/usr/local/opt/asdf/libexec/bin
/usr/local/opt/postgresql/bin
/Users/rbates/.rbenv/shims
/Users/rbates/.oh-my-zsh/custom/plugins/rbates/bin
/usr/local/sbin
/usr/local/bin
/usr/local/bin
/System/Cryptexes/App/usr/bin
/usr/bin
/bin
/usr/sbin
/sbin
/opt/X11/bin
/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/local/bin
/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/bin
/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/appleinternal/bin
/usr/local/opt/postgresql/bin
/Users/rbates/.rbenv/shims
/Users/rbates/.oh-my-zsh/custom/plugins/rbates/bin
/usr/local/sbin
/Users/rbates/Library/Android/sdk/tools
/Users/rbates/Library/Android/sdk/platform-tools
/Users/rbates/.sentinel/current/bin
/Users/rbates/Library/Android/sdk/tools
/Users/rbates/Library/Android/sdk/platform-tools
/Users/rbates/.sentinel/current/bin

Note: the task dedups the paths and changes the order, otherwise they are the same paths.

meganrogge commented 1 year ago

thanks, it's unlikely i'll get to this issue soon. if you're curious, you can poke around the code and try to figure out why this is the case. it might be by design. I'm not sure why it would be breaking anything for you though πŸ€”

meganrogge commented 1 year ago

maybe here... https://github.com/microsoft/vscode/blob/a06ece3136b11030e2033cd2651c102eee30dcb4/src/vs/workbench/contrib/tasks/browser/terminalTaskSystem.ts#L1240-L1245

ryanb commented 1 year ago

@meganrogge I wonder if it's due to this commit. Not sure if this is in 1.80. https://github.com/microsoft/vscode/commit/ca9192e80b096d715378e905fc074723924bad10

It's strange that the PR this commit references (https://github.com/microsoft/vscode/pull/186938) seems to just be for performance but the commit seems to remove fetching the shell env.

coffenbacher commented 1 year ago

I'm not sure why it would be breaking anything for you though πŸ€”

Changing the order of the path breaks a lot of things for me, it is loading system versions of things like Ruby etc instead of my local ones πŸ˜… I tried to override the behavior with options.env.PATH but that gets blown away too.

I am a little surprised that there's not more activity on this issue, my environment must be weirder than I thought, because I thought this would have blown a lot of people up

coffenbacher commented 1 year ago

I think this one is probably related: https://github.com/microsoft/vscode/issues/186244

I'm also adopting the source ~/.zshrc && in the command workaround suggested in that linked issue, seems like the only thing that works for now

ryanb commented 1 year ago

I think this one is probably related: #186244

Looks like that issue is for 1.79 but I only noticed this after upgrading to 1.80. Unsure if they are the same.

meganrogge commented 1 year ago

do you have inheritEnv set?

can you enable trace logging and share the output for the ptyHost and terminal?

(IE run the command developer set logging, choose trace for each of those...

ryanb commented 1 year ago

do you have inheritEnv set?

Yes. However I've tested it with and without this enabled and it has the same issue both ways.

can you enable trace logging and share the output for the ptyHost and terminal?

(IE run the command developer set logging, choose trace for each of those...

I ran this on the Insiders build.

Here's the ptyHost output

2023-07-18 16:24:11.401 [trace] [RPC Request] PtyService#getDefaultSystemShell(2)
2023-07-18 16:24:11.401 [trace] [RPC Response] PtyService#getDefaultSystemShell /bin/zsh
2023-07-18 16:24:11.410 [trace] [RPC Request] PtyService#createProcess({"name":"echo path","type":"Task","executable":"/bin/zsh","args":["-l","-c","echo $PATH"],"env":{},"icon":{"id":"tools"},"color":null,"initialText":" ","cwd":{"$mid":1,"fsPath":"/Users/rbates/code/test","external":"file:///Users/rbates/code/test","path":"/Users/rbates/code/test","scheme":"file"},"isFeatureTerminal":true,"useShellEnvironment":true}, "/Users/rbates/code/test", 164, 15, "11", {"MallocNanoZone":"0","USER":"rbates","COMMAND_MODE":"unix2003","__CFBundleIdentifier":"com.microsoft.VSCodeInsiders","PATH":"/Users/rbates/.asdf/shims:/usr/local/opt/asdf/libexec/bin:/usr/local/opt/postgresql/bin:/Users/rbates/.rbenv/shims:/Users/rbates/.oh-my-zsh/custom/plugins/rbates/bin:/usr/local/sbin:/usr/local/bin:/usr/local/bin:/System/Cryptexes/App/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin:/opt/X11/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/local/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/appleinternal/bin:/Users/rbates/Library/Android/sdk/tools:/Users/rbates/Library/Android/sdk/platform-tools:/Users/rbates/.sentinel/current/bin","LOGNAME":"rbates","DISPLAY":"/private/tmp/com.apple.launchd.wiLmUwcMdf/org.macosforge.xquartz:0","SSH_AUTH_SOCK":"...","HOME":"/Users/rbates","SHELL":"/bin/zsh","TMPDIR":"/var/folders/7b/p3z3qsvj03d3pbn9pnngh8hh0000gn/T/","__CF_USER_TEXT_ENCODING":"0x1F5:0x0:0x0","XPC_SERVICE_NAME":"application.com.microsoft.VSCodeInsiders.201961085.201961091","XPC_FLAGS":"0x0","ORIGINAL_XDG_CURRENT_DESKTOP":"undefined","SHLVL":"0","PWD":"/","OLDPWD":"/","EDITOR":"code -w","PAGER":"less","LESS":"-R","LC_CTYPE":"","LSCOLORS":"Gxfxcxdxbxegedabagacad","RBENV_SHELL":"zsh","RUBYLIB":"/usr/local/lib/ruby/site_ruby:","ANDROID_HOME":"/Users/rbates/Library/Android/sdk","JRUBY_OPTS":"--1.9","_SENTI_C_PRINT":"1","ASDF_DIR":"/usr/local/opt/asdf/libexec","_":"/Applications/Visual Studio Code - Insiders.app/Contents/MacOS/Electron","TERM_PROGRAM":"vscode","TERM_PROGRAM_VERSION":"1.81.0-insider","LANG":"en_US.UTF-8","COLORTERM":"truecolor","GIT_ASKPASS":"/Applications/Visual Studio Code - Insiders.app/Contents/Resources/app/extensions/git/dist/askpass.sh","VSCODE_GIT_ASKPASS_NODE":"/Applications/Visual Studio Code - Insiders.app/Contents/Frameworks/Code - Insiders Helper (Plugin).app/Contents/MacOS/Code - Insiders Helper (Plugin)","VSCODE_GIT_ASKPASS_EXTRA_ARGS":"--ms-enable-electron-run-as-node","VSCODE_GIT_ASKPASS_MAIN":"/Applications/Visual Studio Code - Insiders.app/Contents/Resources/app/extensions/git/dist/askpass-main.js","VSCODE_GIT_IPC_HANDLE":"/var/folders/7b/p3z3qsvj03d3pbn9pnngh8hh0000gn/T/vscode-git-49a0914403.sock"}, {"MallocNanoZone":"0","USER":"rbates","COMMAND_MODE":"unix2003","__CFBundleIdentifier":"com.microsoft.VSCodeInsiders","PATH":"/Users/rbates/.asdf/shims:/usr/local/opt/asdf/libexec/bin:/usr/local/opt/postgresql/bin:/Users/rbates/.rbenv/shims:/Users/rbates/.oh-my-zsh/custom/plugins/rbates/bin:/usr/local/sbin:/usr/local/bin:/usr/local/bin:/System/Cryptexes/App/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin:/opt/X11/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/local/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/appleinternal/bin:/Users/rbates/Library/Android/sdk/tools:/Users/rbates/Library/Android/sdk/platform-tools:/Users/rbates/.sentinel/current/bin","LOGNAME":"rbates","DISPLAY":"/private/tmp/com.apple.launchd.wiLmUwcMdf/org.macosforge.xquartz:0","SSH_AUTH_SOCK":"...","HOME":"/Users/rbates","SHELL":"/bin/zsh","TMPDIR":"/var/folders/7b/p3z3qsvj03d3pbn9pnngh8hh0000gn/T/","__CF_USER_TEXT_ENCODING":"0x1F5:0x0:0x0","XPC_SERVICE_NAME":"application.com.microsoft.VSCodeInsiders.201961085.201961091","XPC_FLAGS":"0x0","ORIGINAL_XDG_CURRENT_DESKTOP":"undefined","VSCODE_CWD":"/","VSCODE_NLS_CONFIG":"{\"locale\":\"en-us\",\"osLocale\":\"en-us\",\"availableLanguages\":{},\"_languagePackSupport\":true}","VSCODE_CODE_CACHE_PATH":"/Users/rbates/Library/Application Support/Code - Insiders/CachedData/dc142e4cd111b8f370d0549d8c207df7de55facd","VSCODE_IPC_HOOK":"/Users/rbates/Library/Application Support/Code - Insiders/1.81-main.sock","VSCODE_PID":"74823","SHLVL":"0","PWD":"/","OLDPWD":"/","EDITOR":"code -w","PAGER":"less","LESS":"-R","LC_CTYPE":"","LSCOLORS":"Gxfxcxdxbxegedabagacad","RBENV_SHELL":"zsh","RUBYLIB":"/usr/local/lib/ruby/site_ruby:","ANDROID_HOME":"/Users/rbates/Library/Android/sdk","JRUBY_OPTS":"--1.9","_SENTI_C_PRINT":"1","ASDF_DIR":"/usr/local/opt/asdf/libexec","_":"/Applications/Visual Studio Code - Insiders.app/Contents/MacOS/Electron"}, {"shellIntegration":{"enabled":true,"suggestEnabled":false,"nonce":"dc877b42-e21d-41e3-8e1a-77f8103c1c6c"},"windowsEnableConpty":true,"environmentVariableCollections":[["vscode.git",[["GIT_ASKPASS",{"variable":"GIT_ASKPASS","value":"/Applications/Visual Studio Code - Insiders.app/Contents/Resources/app/extensions/git/dist/askpass.sh","type":1,"options":{"applyAtProcessCreation":true,"applyAtShellIntegration":false}}],["VSCODE_GIT_ASKPASS_NODE",{"variable":"VSCODE_GIT_ASKPASS_NODE","value":"/Applications/Visual Studio Code - Insiders.app/Contents/Frameworks/Code - Insiders Helper (Plugin).app/Contents/MacOS/Code - Insiders Helper (Plugin)","type":1,"options":{"applyAtProcessCreation":true,"applyAtShellIntegration":false}}],["VSCODE_GIT_ASKPASS_EXTRA_ARGS",{"variable":"VSCODE_GIT_ASKPASS_EXTRA_ARGS","value":"--ms-enable-electron-run-as-node","type":1,"options":{"applyAtProcessCreation":true,"applyAtShellIntegration":false}}],["VSCODE_GIT_ASKPASS_MAIN",{"variable":"VSCODE_GIT_ASKPASS_MAIN","value":"/Applications/Visual Studio Code - Insiders.app/Contents/Resources/app/extensions/git/dist/askpass-main.js","type":1,"options":{"applyAtProcessCreation":true,"applyAtShellIntegration":false}}],["VSCODE_GIT_IPC_HANDLE",{"variable":"VSCODE_GIT_IPC_HANDLE","value":"/var/folders/7b/p3z3qsvj03d3pbn9pnngh8hh0000gn/T/vscode-git-49a0914403.sock","type":1,"options":{"applyAtProcessCreation":true,"applyAtShellIntegration":false}}]],[["",{"description":"Enables the following features: git auth provider"}]]]],"workspaceFolder":{"uri":{"$mid":1,"fsPath":"/Users/rbates/code/test","external":"file:///Users/rbates/code/test","path":"/Users/rbates/code/test","scheme":"file"},"name":"test","index":0}}, false, "ae3e8ec2622c0063caf309f8dbb069bf", "test")
2023-07-18 16:24:11.411 [debug] MutationLogger "Persistent process "2" interaction state" set to "None", reason: initialized
2023-07-18 16:24:11.412 [debug] MutationLogger "Persistent process "2" interaction state" set to "Session", reason: setTitle
2023-07-18 16:24:11.412 [trace] [RPC Response] PtyService#createProcess 2
2023-07-18 16:24:11.421 [trace] [RPC Request] PtyService#shutdown(1, false)
2023-07-18 16:24:11.421 [trace] [RPC Response] PtyService#shutdown undefined
2023-07-18 16:24:11.421 [trace] [RPC Request] PtyService#start(2)
2023-07-18 16:24:11.421 [trace] [RPC Event] PtyService#_onDidChangeProperty.fire({"id":2,"property":{"type":"initialCwd","value":"/Users/rbates/code/test"}})
2023-07-18 16:24:11.422 [trace] [RPC Event] PtyService#_onDidChangeProperty.fire({"id":2,"property":{"type":"failedShellIntegrationActivation","value":true}})
2023-07-18 16:24:11.422 [trace] node-pty.IPty#spawn /bin/zsh ["-l","-c","echo $PATH"] {"name":"xterm-256color","cwd":"/Users/rbates/code/test","env":{"MallocNanoZone":"0","USER":"rbates","COMMAND_MODE":"unix2003","__CFBundleIdentifier":"com.microsoft.VSCodeInsiders","PATH":"/Users/rbates/.asdf/shims:/usr/local/opt/asdf/libexec/bin:/usr/local/opt/postgresql/bin:/Users/rbates/.rbenv/shims:/Users/rbates/.oh-my-zsh/custom/plugins/rbates/bin:/usr/local/sbin:/usr/local/bin:/usr/local/bin:/System/Cryptexes/App/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin:/opt/X11/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/local/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/appleinternal/bin:/Users/rbates/Library/Android/sdk/tools:/Users/rbates/Library/Android/sdk/platform-tools:/Users/rbates/.sentinel/current/bin","LOGNAME":"rbates","DISPLAY":"/private/tmp/com.apple.launchd.wiLmUwcMdf/org.macosforge.xquartz:0","SSH_AUTH_SOCK":"...","HOME":"/Users/rbates","SHELL":"/bin/zsh","TMPDIR":"/var/folders/7b/p3z3qsvj03d3pbn9pnngh8hh0000gn/T/","__CF_USER_TEXT_ENCODING":"0x1F5:0x0:0x0","XPC_SERVICE_NAME":"application.com.microsoft.VSCodeInsiders.201961085.201961091","XPC_FLAGS":"0x0","ORIGINAL_XDG_CURRENT_DESKTOP":"undefined","SHLVL":"0","PWD":"/","OLDPWD":"/","EDITOR":"code -w","PAGER":"less","LESS":"-R","LC_CTYPE":"","LSCOLORS":"Gxfxcxdxbxegedabagacad","RBENV_SHELL":"zsh","RUBYLIB":"/usr/local/lib/ruby/site_ruby:","ANDROID_HOME":"/Users/rbates/Library/Android/sdk","JRUBY_OPTS":"--1.9","_SENTI_C_PRINT":"1","ASDF_DIR":"/usr/local/opt/asdf/libexec","_":"/Applications/Visual Studio Code - Insiders.app/Contents/MacOS/Electron","TERM_PROGRAM":"vscode","TERM_PROGRAM_VERSION":"1.81.0-insider","LANG":"en_US.UTF-8","COLORTERM":"truecolor","GIT_ASKPASS":"/Applications/Visual Studio Code - Insiders.app/Contents/Resources/app/extensions/git/dist/askpass.sh","VSCODE_GIT_ASKPASS_NODE":"/Applications/Visual Studio Code - Insiders.app/Contents/Frameworks/Code - Insiders Helper (Plugin).app/Contents/MacOS/Code - Insiders Helper (Plugin)","VSCODE_GIT_ASKPASS_EXTRA_ARGS":"--ms-enable-electron-run-as-node","VSCODE_GIT_ASKPASS_MAIN":"/Applications/Visual Studio Code - Insiders.app/Contents/Resources/app/extensions/git/dist/askpass-main.js","VSCODE_GIT_IPC_HANDLE":"/var/folders/7b/p3z3qsvj03d3pbn9pnngh8hh0000gn/T/vscode-git-49a0914403.sock"},"cols":164,"rows":15,"useConpty":false,"conptyInheritCursor":false}
2023-07-18 16:24:11.423 [trace] [RPC Event] PtyService#_onProcessReady.fire({"id":2,"event":{"pid":76441,"cwd":"/Users/rbates/code/test"}})
2023-07-18 16:24:11.423 [trace] [RPC Response] PtyService#start undefined
2023-07-18 16:24:11.424 [trace] [RPC Event] PtyService#_onDidChangeProperty.fire({"id":2,"property":{"type":"title","value":"/bin/zsh"}})
2023-07-18 16:24:11.425 [trace] [RPC Event] PtyService#_onDidChangeProperty.fire({"id":2,"property":{"type":"shellType"}})
2023-07-18 16:24:11.435 [trace] [RPC Request] PtyService#getLatency()
2023-07-18 16:24:11.435 [trace] [RPC Response] PtyService#getLatency []
2023-07-18 16:24:11.435 [trace] [RPC Request] PtyService#getLatency()
2023-07-18 16:24:11.435 [trace] [RPC Response] PtyService#getLatency []
2023-07-18 16:24:11.443 [trace] node-pty.IPty#onData /usr/local/bin:/System/Cryptexes/App/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin:/opt/X11/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/local/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/appleinternal/bin:/Users/rbates/.asdf/shims:/usr/local/opt/asdf/libexec/bin:/usr/local/opt/postgresql/bin:/Users/rbates/.rbenv/shims:/Users/rbates/.oh-my-zsh/custom/plugins/rbates/bin:/usr/local/sbin:/Users/rbates/Library/Android/sdk/tools:/Users/rbates/Library/Android/sdk/platform-tools:/Users/rbates/.sentinel/current/bin

2023-07-18 16:24:11.444 [trace] TerminalProcess#_queueProcessExit 
    at Ue.S (/Applications/Visual Studio Code - Insiders.app/Contents/Resources/app/out/vs/platform/terminal/node/ptyHostMain.js:26:18191)
    at /Applications/Visual Studio Code - Insiders.app/Contents/Resources/app/out/vs/platform/terminal/node/ptyHostMain.js:26:17893
    at EventEmitter2.fire (/Applications/Visual Studio Code - Insiders.app/Contents/Resources/app/node_modules.asar/node-pty/lib/eventEmitter2.js:41:22)
    at PipeSocket.<anonymous> (/Applications/Visual Studio Code - Insiders.app/Contents/Resources/app/node_modules.asar/node-pty/lib/terminal.js:93:76)
    at PipeSocket.emit (node:events:513:28)
    at Terminal.emit (/Applications/Visual Studio Code - Insiders.app/Contents/Resources/app/node_modules.asar/node-pty/lib/terminal.js:155:34)
    at PipeSocket.<anonymous> (/Applications/Visual Studio Code - Insiders.app/Contents/Resources/app/node_modules.asar/node-pty/lib/unixTerminal.js:98:27)
    at Object.onceWrapper (node:events:628:26)
    at PipeSocket.emit (node:events:525:35)
    at Pipe.<anonymous> (node:net:757:14)
2023-07-18 16:24:11.449 [trace] [RPC Event] PtyService#_onProcessData.fire({"id":2,"event":"/usr/local/bin:/System/Cryptexes/App/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin:/opt/X11/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/local/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/appleinternal/bin:/Users/rbates/.asdf/shims:/usr/local/opt/asdf/libexec/bin:/usr/local/opt/postgresql/bin:/Users/rbates/.rbenv/shims:/Users/rbates/.oh-my-zsh/custom/plugins/rbates/bin:/usr/local/sbin:/Users/rbates/Library/Android/sdk/tools:/Users/rbates/Library/Android/sdk/platform-tools:/Users/rbates/.sentinel/current/bin\r\n"})
2023-07-18 16:24:11.699 [trace] node-pty.IPty#kill
2023-07-18 16:24:11.699 [trace] [RPC Event] PtyService#_onProcessExit.fire({"id":2,"event":0})
2023-07-18 16:24:11.927 [trace] [RPC Request] PtyService#setTerminalLayoutInfo({"workspaceId":"ae3e8ec2622c0063caf309f8dbb069bf","tabs":[{"isActive":true,"terminals":[]}]})
2023-07-18 16:24:11.927 [trace] [RPC Response] PtyService#setTerminalLayoutInfo undefined

Here's the terminal output.

2023-07-18 16:24:11.404 [debug] [ae3e8ec] parsing data "
" [[10,27,91,71]]
2023-07-18 16:24:11.405 [debug] [ae3e8ec] parsing data "]633;A]633;P;Task=True]633;P;Cwd=/Users/rbates/code/test]633;B *  Executing task: echo $PATH 

]633;C" [[27,93,54,51,51,59,65,7,27,93,54,51,51,59,80,59,84,97,115,107,61,84,114,117,101,7,27,93,54,51,51,59,80,59,67,119,100,61,47,85,115,101,114,115,47,114,98,97,116,101,115,47,99,111,100,101,47,109,101,116,97,112,117,108,115,101,7,27,93,54,51,51,59,66,7,27,91,48,109,27,91,55,109,32,42,32,27,91,48,109,32,69,120,101,99,117,116,105,110,103,32,116,97,115,107,58,32,101,99,104,111,32,36,80,65,84,72,32,27,91,48,109,10,13,27,93,54,51,51,59,67,7]]
2023-07-18 16:24:11.405 [debug] [ae3e8ec] CommandDetectionCapability#handlePromptStart [0,8]
2023-07-18 16:24:11.406 [debug] [ae3e8ec] CommandDetectionCapability#handleCommandStart [0,8]
2023-07-18 16:24:11.407 [debug] [ae3e8ec] CommandDetectionCapability#handleCommandExecuted [0,9]
2023-07-18 16:24:11.407 [debug] [ae3e8ec] parsing data "
" [[13,10]]
2023-07-18 16:24:11.408 [trace] [ae3e8ec] Relaunching terminal instance 1 []
2023-07-18 16:24:11.420 [debug] [ae3e8ec] terminalInstance added capability [1]
2023-07-18 16:24:11.425 [debug] [ae3e8ec] Terminal process ready (shellProcessId: 76441) []
2023-07-18 16:24:11.436 [info] [ae3e8ec] Latency measurements for local backend
window<->ptyhost (message port): 0.40ms
window<->ptyhostservice<->ptyhost: 1.00ms
ptyhostservice<->ptyhost: 0.41ms []
2023-07-18 16:24:11.450 [debug] [ae3e8ec] parsing data "/usr/local/bin:/System/Cryptexes/App/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin:/opt/X11/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/local/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/appleinternal/bin:/Users/rbates/.asdf/shims:/usr/local/opt/asdf/libexec/bin:/usr/local/opt/postgresql/bin:/Users/rbates/.rbenv/shims:/Users/rbates/.oh-my-zsh/custom/plugins/rbates/bin:/usr/local/sbin:/Users/rbates/Library/Android/sdk/tools:/Users/rbates/Library/Android/sdk/platform-tools:/Users/rbates/.sentinel/current/bin
" [[47,117,115,114,47,108,111,99,97,108,47,98,105,110,58,47,83,121,115,116,101,109,47,67,114,121,112,116,101,120,101,115,47,65,112,112,47,117,115,114,47,98,105,110,58,47,117,115,114,47,98,105,110,58,47,98,105,110,58,47,117,115,114,47,115,98,105,110,58,47,115,98,105,110,58,47,111,112,116,47,88,49,49,47,98,105,110,58,47,118,97,114,47,114,117,110,47,99,111,109,46,97,112,112,108,101,46,115,101,99,117,114,105,116,121,46,99,114,121,112,116,101,120,100,47,99,111,100,101,120,46,115,121,115,116,101,109,47,98,111,111,116,115,116,114,97,112,47,117,115,114,47,108,111,99,97,108,47,98,105,110,58,47,118,97,114,47,114,117,110,47,99,111,109,46,97,112,112,108,101,46,115,101,99,117,114,105,116,121,46,99,114,121,112,116,101,120,100,47,99,111,100,101,120,46,115,121,115,116,101,109,47,98,111,111,116,115,116,114,97,112,47,117,115,114,47,98,105,110,58,47,118,97,114,47,114,117,110,47,99,111,109,46,97,112,112,108,101,46,115,101,99,117,114,105,116,121,46,99,114,121,112,116,101,120,100,47,99,111,100,101,120,46,115,121,115,116,101,109,47,98,111,111,116,115,116,114,97,112,47,117,115,114,47,97,112,112,108,101,105,110,116,101,114,110,97,108,47,98,105,110,58,47,85,115,101,114,115,47,114,98,97,116,101,115,47,46,97,115,100,102,47,115,104,105,109,115,58,47,117,115,114,47,108,111,99,97,108,47,111,112,116,47,97,115,100,102,47,108,105,98,101,120,101,99,47,98,105,110,58,47,117,115,114,47,108,111,99,97,108,47,111,112,116,47,112,111,115,116,103,114,101,115,113,108,47,98,105,110,58,47,85,115,101,114,115,47,114,98,97,116,101,115,47,46,114,98,101,110,118,47,115,104,105,109,115,58,47,85,115,101,114,115,47,114,98,97,116,101,115,47,46,111,104,45,109,121,45,122,115,104,47,99,117,115,116,111,109,47,112,108,117,103,105,110,115,47,114,98,97,116,101,115,47,98,105,110,58,47,117,115,114,47,108,111,99,97,108,47,115,98,105,110,58,47,85,115,101,114,115,47,114,98,97,116,101,115,47,76,105,98,114,97,114,121,47,65,110,100,114,111,105,100,47,115,100,107,47,116,111,111,108,115,58,47,85,115,101,114,115,47,114,98,97,116,101,115,47,76,105,98,114,97,114,121,47,65,110,100,114,111,105,100,47,115,100,107,47,112,108,97,116,102,111,114,109,45,116,111,111,108,115,58,47,85,115,101,114,115,47,114,98,97,116,101,115,47,46,115,101,110,116,105,110,101,108,47,99,117,114,114,101,110,116,47,98,105,110,13,10]]
2023-07-18 16:24:11.732 [debug] [ae3e8ec] Terminal process exit ["instanceId",1,"code",0,"processState",4]
2023-07-18 16:24:11.733 [debug] [ae3e8ec] parsing data " *  ]633;D;0Terminal will be reused by tasks, press any key to close it. 

" [[27,91,48,109,27,91,55,109,32,42,32,27,91,48,109,32,27,93,54,51,51,59,68,59,48,7,84,101,114,109,105,110,97,108,32,119,105,108,108,32,98,101,32,114,101,117,115,101,100,32,98,121,32,116,97,115,107,115,44,32,112,114,101,115,115,32,97,110,121,32,107,101,121,32,116,111,32,99,108,111,115,101,32,105,116,46,32,27,91,48,109,10,13]]
2023-07-18 16:24:11.733 [debug] [ae3e8ec] CommandDetectionCapability#handleCommandFinished [4,14,"",{"promptStartMarker":{"line":8,"isDisposed":false,"_disposables":[{"_listeners":[null],"_disposed":false},{},{},{},{}],"_id":5,"_onDispose":{"_listeners":[null],"_disposed":false}},"commandStartMarker":{"line":8,"isDisposed":false,"_disposables":[{"_listeners":[null,null],"_disposed":false},{},{},{},{}],"_id":6,"_onDispose":{"_listeners":[null,null],"_disposed":false}},"commandStartX":0,"commandExecutedMarker":{"line":9,"isDisposed":false,"_disposables":[{"_listeners":[null],"_disposed":false},{},{},{},{}],"_id":7,"_onDispose":{"_listeners":[null],"_disposed":false}},"commandExecutedX":0,"command":"","commandFinishedMarker":{"line":14,"isDisposed":false,"_disposables":[{"_listeners":[null],"_disposed":false},{},{},{},{}],"_id":8,"_onDispose":{"_listeners":[null],"_disposed":false}}}]
2023-07-18 16:24:11.733 [debug] [ae3e8ec] CommandDetectionCapability#onCommandFinished [{"command":"","isTrusted":false,"marker":{"line":8,"isDisposed":false,"_disposables":[{"_listeners":[null,null],"_disposed":false},{},{},{},{}],"_id":6,"_onDispose":{"_listeners":[null,null],"_disposed":false}},"endMarker":{"line":14,"isDisposed":false,"_disposables":[{"_listeners":[null],"_disposed":false},{},{},{},{}],"_id":8,"_onDispose":{"_listeners":[null],"_disposed":false}},"executedMarker":{"line":9,"isDisposed":false,"_disposables":[{"_listeners":[null],"_disposed":false},{},{},{},{}],"_id":7,"_onDispose":{"_listeners":[null],"_disposed":false}},"timestamp":1689722651709,"cwd":"/Users/rbates/code/test","exitCode":0}]
2023-07-18 16:24:27.999 [trace] [ae3e8ec] terminalMultiLineLinkDetector#detect text [" *  Terminal will be reused by tasks, press any key to close it. "]
2023-07-18 16:24:28.000 [trace] [ae3e8ec] terminalLocalLinkDetector#detect text [" *  Terminal will be reused by tasks, press any key to close it. "]
2023-07-18 16:24:28.000 [trace] [ae3e8ec] terminalLocalLinkDetector#detect parsedLinks [[]]
2023-07-18 16:24:29.170 [trace] [ae3e8ec] terminalMultiLineLinkDetector#detect text ["/usr/local/bin:/System/Cryptexes/App/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin:/opt/X11/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/local/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/appleinternal/bin:/Users/rbates/.asdf/shims:/usr/local/opt/asdf/libexec/bin:/usr/local/opt/postgresql/bin:/Users/rbates/.rbenv/shims:/Users/rbates/.oh-my-zsh/custom/plugins/rbates/bin:/usr/local/sbin:/Users/rbates/Library/Android/sdk/tools:/Users/rbates/Library/Android/sdk/platform-tools:/Users/rbates/.sentinel/current/bin"]
2023-07-18 16:24:29.171 [trace] [ae3e8ec] terminalLocalLinkDetector#detect text ["/usr/local/bin:/System/Cryptexes/App/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin:/opt/X11/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/local/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/appleinternal/bin:/Users/rbates/.asdf/shims:/usr/local/opt/asdf/libexec/bin:/usr/local/opt/postgresql/bin:/Users/rbates/.rbenv/shims:/Users/rbates/.oh-my-zsh/custom/plugins/rbates/bin:/usr/local/sbin:/Users/rbates/Library/Android/sdk/tools:/Users/rbates/Library/Android/sdk/platform-tools:/Users/rbates/.sentinel/current/bin"]
2023-07-18 16:24:29.171 [trace] [ae3e8ec] terminalLocalLinkDetector#detect parsedLinks [[{"path":{"index":0,"text":"/usr/local/bin"}},{"path":{"index":15,"text":"/System/Cryptexes/App/usr/bin"}},{"path":{"index":45,"text":"/usr/bin"}},{"path":{"index":54,"text":"/bin"}},{"path":{"index":59,"text":"/usr/sbin"}},{"path":{"index":69,"text":"/sbin"}},{"path":{"index":75,"text":"/opt/X11/bin"}},{"path":{"index":88,"text":"/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/local/bin"}},{"path":{"index":162,"text":"/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/bin"}},{"path":{"index":230,"text":"/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/appleinternal/bin"}},{"path":{"index":312,"text":"/Users/rbates/.asdf/shims"}},{"path":{"index":338,"text":"/usr/local/opt/asdf/libexec/bin"}},{"path":{"index":370,"text":"/usr/local/opt/postgresql/bin"}},{"path":{"index":400,"text":"/Users/rbates/.rbenv/shims"}},{"path":{"index":427,"text":"/Users/rbates/.oh-my-zsh/custom/plugins/rbates/bin"}},{"path":{"index":478,"text":"/usr/local/sbin"}},{"path":{"index":494,"text":"/Users/rbates/Library/Android/sdk/tools"}},{"path":{"index":534,"text":"/Users/rbates/Library/Android/sdk/platform-tools"}},{"path":{"index":583,"text":"/Users/rbates/.sentinel/current/bin"}}]]
2023-07-18 16:24:29.171 [trace] [ae3e8ec] terminalLocalLinkDetector#detect linkCandidates [["/usr/local/bin"]]
2023-07-18 16:24:29.177 [trace] [ae3e8ec] terminalLocalLinkDetector#detect verified link [{"text":"/usr/local/bin","uri":{"$mid":1,"path":"/usr/local/bin","scheme":"file"},"bufferRange":{"start":{"x":1,"y":11},"end":{"x":14,"y":11}},"type":"LocalFolderOutsideWorkspace","parsedLink":{"path":{"index":0,"text":"/usr/local/bin"}}}]
2023-07-18 16:24:29.177 [trace] [ae3e8ec] terminalLocalLinkDetector#detect linkCandidates [["/System/Cryptexes/App/usr/bin"]]
2023-07-18 16:24:29.178 [trace] [ae3e8ec] terminalLocalLinkDetector#detect verified link [{"text":"/System/Cryptexes/App/usr/bin","uri":{"$mid":1,"path":"/System/Cryptexes/App/usr/bin","scheme":"file"},"bufferRange":{"start":{"x":16,"y":11},"end":{"x":44,"y":11}},"type":"LocalFolderOutsideWorkspace","parsedLink":{"path":{"index":15,"text":"/System/Cryptexes/App/usr/bin"}}}]
2023-07-18 16:24:29.178 [trace] [ae3e8ec] terminalLocalLinkDetector#detect linkCandidates [["/usr/bin"]]
2023-07-18 16:24:29.179 [trace] [ae3e8ec] terminalLocalLinkDetector#detect verified link [{"text":"/usr/bin","uri":{"$mid":1,"path":"/usr/bin","scheme":"file"},"bufferRange":{"start":{"x":46,"y":11},"end":{"x":53,"y":11}},"type":"LocalFolderOutsideWorkspace","parsedLink":{"path":{"index":45,"text":"/usr/bin"}}}]
2023-07-18 16:24:29.180 [trace] [ae3e8ec] terminalLocalLinkDetector#detect linkCandidates [["/bin"]]
2023-07-18 16:24:29.181 [trace] [ae3e8ec] terminalLocalLinkDetector#detect verified link [{"text":"/bin","uri":{"$mid":1,"path":"/bin","scheme":"file"},"bufferRange":{"start":{"x":55,"y":11},"end":{"x":58,"y":11}},"type":"LocalFolderOutsideWorkspace","parsedLink":{"path":{"index":54,"text":"/bin"}}}]
2023-07-18 16:24:29.181 [trace] [ae3e8ec] terminalLocalLinkDetector#detect linkCandidates [["/usr/sbin"]]
2023-07-18 16:24:29.182 [trace] [ae3e8ec] terminalLocalLinkDetector#detect verified link [{"text":"/usr/sbin","uri":{"$mid":1,"path":"/usr/sbin","scheme":"file"},"bufferRange":{"start":{"x":60,"y":11},"end":{"x":68,"y":11}},"type":"LocalFolderOutsideWorkspace","parsedLink":{"path":{"index":59,"text":"/usr/sbin"}}}]
2023-07-18 16:24:29.182 [trace] [ae3e8ec] terminalLocalLinkDetector#detect linkCandidates [["/sbin"]]
2023-07-18 16:24:29.183 [trace] [ae3e8ec] terminalLocalLinkDetector#detect verified link [{"text":"/sbin","uri":{"$mid":1,"path":"/sbin","scheme":"file"},"bufferRange":{"start":{"x":70,"y":11},"end":{"x":74,"y":11}},"type":"LocalFolderOutsideWorkspace","parsedLink":{"path":{"index":69,"text":"/sbin"}}}]
2023-07-18 16:24:29.183 [trace] [ae3e8ec] terminalLocalLinkDetector#detect linkCandidates [["/opt/X11/bin"]]
2023-07-18 16:24:29.184 [trace] [ae3e8ec] terminalLocalLinkDetector#detect verified link [{"text":"/opt/X11/bin","uri":{"$mid":1,"path":"/opt/X11/bin","scheme":"file"},"bufferRange":{"start":{"x":76,"y":11},"end":{"x":87,"y":11}},"type":"LocalFolderOutsideWorkspace","parsedLink":{"path":{"index":75,"text":"/opt/X11/bin"}}}]
2023-07-18 16:24:29.184 [trace] [ae3e8ec] terminalLocalLinkDetector#detect linkCandidates [["/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/local/bin"]]
2023-07-18 16:24:29.187 [trace] [ae3e8ec] terminalLocalLinkDetector#detect linkCandidates [["/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/bin"]]
2023-07-18 16:24:29.189 [trace] [ae3e8ec] terminalLocalLinkDetector#detect linkCandidates [["/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/appleinternal/bin"]]
2023-07-18 16:24:39.439 [trace] [ae3e8ec] terminalMultiLineLinkDetector#detect text ["/usr/local/bin:/System/Cryptexes/App/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin:/opt/X11/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/local/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/appleinternal/bin:/Users/rbates/.asdf/shims:/usr/local/opt/asdf/libexec/bin:/usr/local/opt/postgresql/bin:/Users/rbates/.rbenv/shims:/Users/rbates/.oh-my-zsh/custom/plugins/rbates/bin:/usr/local/sbin:/Users/rbates/Library/Android/sdk/tools:/Users/rbates/Library/Android/sdk/platform-tools:/Users/rbates/.sentinel/current/bin"]
2023-07-18 16:24:39.439 [trace] [ae3e8ec] terminalLocalLinkDetector#detect text ["/usr/local/bin:/System/Cryptexes/App/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin:/opt/X11/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/local/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/appleinternal/bin:/Users/rbates/.asdf/shims:/usr/local/opt/asdf/libexec/bin:/usr/local/opt/postgresql/bin:/Users/rbates/.rbenv/shims:/Users/rbates/.oh-my-zsh/custom/plugins/rbates/bin:/usr/local/sbin:/Users/rbates/Library/Android/sdk/tools:/Users/rbates/Library/Android/sdk/platform-tools:/Users/rbates/.sentinel/current/bin"]
2023-07-18 16:24:39.440 [trace] [ae3e8ec] terminalLocalLinkDetector#detect parsedLinks [[{"path":{"index":0,"text":"/usr/local/bin"}},{"path":{"index":15,"text":"/System/Cryptexes/App/usr/bin"}},{"path":{"index":45,"text":"/usr/bin"}},{"path":{"index":54,"text":"/bin"}},{"path":{"index":59,"text":"/usr/sbin"}},{"path":{"index":69,"text":"/sbin"}},{"path":{"index":75,"text":"/opt/X11/bin"}},{"path":{"index":88,"text":"/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/local/bin"}},{"path":{"index":162,"text":"/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/bin"}},{"path":{"index":230,"text":"/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/appleinternal/bin"}},{"path":{"index":312,"text":"/Users/rbates/.asdf/shims"}},{"path":{"index":338,"text":"/usr/local/opt/asdf/libexec/bin"}},{"path":{"index":370,"text":"/usr/local/opt/postgresql/bin"}},{"path":{"index":400,"text":"/Users/rbates/.rbenv/shims"}},{"path":{"index":427,"text":"/Users/rbates/.oh-my-zsh/custom/plugins/rbates/bin"}},{"path":{"index":478,"text":"/usr/local/sbin"}},{"path":{"index":494,"text":"/Users/rbates/Library/Android/sdk/tools"}},{"path":{"index":534,"text":"/Users/rbates/Library/Android/sdk/platform-tools"}},{"path":{"index":583,"text":"/Users/rbates/.sentinel/current/bin"}}]]
2023-07-18 16:24:39.440 [trace] [ae3e8ec] terminalLocalLinkDetector#detect linkCandidates [["/usr/local/bin"]]
2023-07-18 16:24:39.446 [trace] [ae3e8ec] terminalLocalLinkDetector#detect verified link [{"text":"/usr/local/bin","uri":{"$mid":1,"path":"/usr/local/bin","scheme":"file"},"bufferRange":{"start":{"x":1,"y":3},"end":{"x":14,"y":3}},"type":"LocalFolderOutsideWorkspace","parsedLink":{"path":{"index":0,"text":"/usr/local/bin"}}}]
2023-07-18 16:24:39.447 [trace] [ae3e8ec] terminalLocalLinkDetector#detect linkCandidates [["/System/Cryptexes/App/usr/bin"]]
2023-07-18 16:24:39.449 [trace] [ae3e8ec] terminalLocalLinkDetector#detect verified link [{"text":"/System/Cryptexes/App/usr/bin","uri":{"$mid":1,"path":"/System/Cryptexes/App/usr/bin","scheme":"file"},"bufferRange":{"start":{"x":16,"y":3},"end":{"x":44,"y":3}},"type":"LocalFolderOutsideWorkspace","parsedLink":{"path":{"index":15,"text":"/System/Cryptexes/App/usr/bin"}}}]
2023-07-18 16:24:39.449 [trace] [ae3e8ec] terminalLocalLinkDetector#detect linkCandidates [["/usr/bin"]]
2023-07-18 16:24:39.450 [trace] [ae3e8ec] terminalLocalLinkDetector#detect verified link [{"text":"/usr/bin","uri":{"$mid":1,"path":"/usr/bin","scheme":"file"},"bufferRange":{"start":{"x":46,"y":3},"end":{"x":53,"y":3}},"type":"LocalFolderOutsideWorkspace","parsedLink":{"path":{"index":45,"text":"/usr/bin"}}}]
2023-07-18 16:24:39.450 [trace] [ae3e8ec] terminalLocalLinkDetector#detect linkCandidates [["/bin"]]
2023-07-18 16:24:39.451 [trace] [ae3e8ec] terminalLocalLinkDetector#detect verified link [{"text":"/bin","uri":{"$mid":1,"path":"/bin","scheme":"file"},"bufferRange":{"start":{"x":55,"y":3},"end":{"x":58,"y":3}},"type":"LocalFolderOutsideWorkspace","parsedLink":{"path":{"index":54,"text":"/bin"}}}]
2023-07-18 16:24:39.452 [trace] [ae3e8ec] terminalLocalLinkDetector#detect linkCandidates [["/usr/sbin"]]
2023-07-18 16:24:39.453 [trace] [ae3e8ec] terminalLocalLinkDetector#detect verified link [{"text":"/usr/sbin","uri":{"$mid":1,"path":"/usr/sbin","scheme":"file"},"bufferRange":{"start":{"x":60,"y":3},"end":{"x":68,"y":3}},"type":"LocalFolderOutsideWorkspace","parsedLink":{"path":{"index":59,"text":"/usr/sbin"}}}]
2023-07-18 16:24:39.453 [trace] [ae3e8ec] terminalLocalLinkDetector#detect linkCandidates [["/sbin"]]
2023-07-18 16:24:39.454 [trace] [ae3e8ec] terminalLocalLinkDetector#detect verified link [{"text":"/sbin","uri":{"$mid":1,"path":"/sbin","scheme":"file"},"bufferRange":{"start":{"x":70,"y":3},"end":{"x":74,"y":3}},"type":"LocalFolderOutsideWorkspace","parsedLink":{"path":{"index":69,"text":"/sbin"}}}]
2023-07-18 16:24:39.454 [trace] [ae3e8ec] terminalLocalLinkDetector#detect linkCandidates [["/opt/X11/bin"]]
2023-07-18 16:24:39.455 [trace] [ae3e8ec] terminalLocalLinkDetector#detect verified link [{"text":"/opt/X11/bin","uri":{"$mid":1,"path":"/opt/X11/bin","scheme":"file"},"bufferRange":{"start":{"x":76,"y":3},"end":{"x":87,"y":3}},"type":"LocalFolderOutsideWorkspace","parsedLink":{"path":{"index":75,"text":"/opt/X11/bin"}}}]
2023-07-18 16:24:39.455 [trace] [ae3e8ec] terminalLocalLinkDetector#detect linkCandidates [["/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/local/bin"]]
2023-07-18 16:24:39.456 [trace] [ae3e8ec] terminalLocalLinkDetector#detect linkCandidates [["/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/bin"]]
2023-07-18 16:24:39.458 [trace] [ae3e8ec] terminalLocalLinkDetector#detect linkCandidates [["/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/appleinternal/bin"]]

Note the logs included some sensitive env vars that I redacted.

meganrogge commented 1 year ago

thanks for the logs.

@Tyriar I find it weird that right after createProcess, it gets shutdown and then starts again - unless @ryanb you reloaded the window?

2023-07-18 16:24:11.410 [trace] [RPC Request] PtyService#createProcess({"name":"echo path","type":"Task","executable":"/bin/zsh","args":["-l","-c","echo $PATH"],"env":{},"icon":{"id":"tools"},"color":null,"initialText":" ","cwd":{"$mid":1,"fsPath":"/Users/rbates/code/test","external":"file:///Users/rbates/code/test","path":"/Users/rbates/code/test","scheme":"file"},"isFeatureTerminal":true,"useShellEnvironment":true}, "/Users/rbates/code/test", 164, 15, "11", {"MallocNanoZone":"0","USER":"rbates","COMMAND_MODE":"unix2003","__CFBundleIdentifier":"com.microsoft.VSCodeInsiders","PATH":"/Users/rbates/.asdf/shims:/usr/local/opt/asdf/libexec/bin:/usr/local/opt/postgresql/bin:/Users/rbates/.rbenv/shims:/Users/rbates/.oh-my-zsh/custom/plugins/rbates/bin:/usr/local/sbin:/usr/local/bin:/usr/local/bin:/System/Cryptexes/App/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin:/opt/X11/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/local/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/appleinternal/bin:/Users/rbates/Library/Android/sdk/tools:/Users/rbates/Library/Android/sdk/platform-tools:/Users/rbates/.sentinel/current/bin","LOGNAME":"rbates","DISPLAY":"/private/tmp/com.apple.launchd.wiLmUwcMdf/org.macosforge.xquartz:0","SSH_AUTH_SOCK":"...","HOME":"/Users/rbates","SHELL":"/bin/zsh","TMPDIR":"/var/folders/7b/p3z3qsvj03d3pbn9pnngh8hh0000gn/T/","__CF_USER_TEXT_ENCODING":"0x1F5:0x0:0x0","XPC_SERVICE_NAME":"application.com.microsoft.VSCodeInsiders.201961085.201961091","XPC_FLAGS":"0x0","ORIGINAL_XDG_CURRENT_DESKTOP":"undefined","SHLVL":"0","PWD":"/","OLDPWD":"/","EDITOR":"code -w","PAGER":"less","LESS":"-R","LC_CTYPE":"","LSCOLORS":"Gxfxcxdxbxegedabagacad","RBENV_SHELL":"zsh","RUBYLIB":"/usr/local/lib/ruby/site_ruby:","ANDROID_HOME":"/Users/rbates/Library/Android/sdk","JRUBY_OPTS":"--1.9","_SENTI_C_PRINT":"1","ASDF_DIR":"/usr/local/opt/asdf/libexec","_":"/Applications/Visual Studio Code - Insiders.app/Contents/MacOS/Electron","TERM_PROGRAM":"vscode","TERM_PROGRAM_VERSION":"1.81.0-insider","LANG":"en_US.UTF-8","COLORTERM":"truecolor","GIT_ASKPASS":"/Applications/Visual Studio Code - Insiders.app/Contents/Resources/app/extensions/git/dist/askpass.sh","VSCODE_GIT_ASKPASS_NODE":"/Applications/Visual Studio Code - Insiders.app/Contents/Frameworks/Code - Insiders Helper (Plugin).app/Contents/MacOS/Code - Insiders Helper (Plugin)","VSCODE_GIT_ASKPASS_EXTRA_ARGS":"--ms-enable-electron-run-as-node","VSCODE_GIT_ASKPASS_MAIN":"/Applications/Visual Studio Code - Insiders.app/Contents/Resources/app/extensions/git/dist/askpass-main.js","VSCODE_GIT_IPC_HANDLE":"/var/folders/7b/p3z3qsvj03d3pbn9pnngh8hh0000gn/T/vscode-git-49a0914403.sock"}, {"MallocNanoZone":"0","USER":"rbates","COMMAND_MODE":"unix2003","__CFBundleIdentifier":"com.microsoft.VSCodeInsiders","PATH":"/Users/rbates/.asdf/shims:/usr/local/opt/asdf/libexec/bin:/usr/local/opt/postgresql/bin:/Users/rbates/.rbenv/shims:/Users/rbates/.oh-my-zsh/custom/plugins/rbates/bin:/usr/local/sbin:/usr/local/bin:/usr/local/bin:/System/Cryptexes/App/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin:/opt/X11/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/local/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/appleinternal/bin:/Users/rbates/Library/Android/sdk/tools:/Users/rbates/Library/Android/sdk/platform-tools:/Users/rbates/.sentinel/current/bin","LOGNAME":"rbates","DISPLAY":"/private/tmp/com.apple.launchd.wiLmUwcMdf/org.macosforge.xquartz:0","SSH_AUTH_SOCK":"...","HOME":"/Users/rbates","SHELL":"/bin/zsh","TMPDIR":"/var/folders/7b/p3z3qsvj03d3pbn9pnngh8hh0000gn/T/","__CF_USER_TEXT_ENCODING":"0x1F5:0x0:0x0","XPC_SERVICE_NAME":"application.com.microsoft.VSCodeInsiders.201961085.201961091","XPC_FLAGS":"0x0","ORIGINAL_XDG_CURRENT_DESKTOP":"undefined","VSCODE_CWD":"/","VSCODE_NLS_CONFIG":"{\"locale\":\"en-us\",\"osLocale\":\"en-us\",\"availableLanguages\":{},\"_languagePackSupport\":true}","VSCODE_CODE_CACHE_PATH":"/Users/rbates/Library/Application Support/Code - Insiders/CachedData/dc142e4cd111b8f370d0549d8c207df7de55facd","VSCODE_IPC_HOOK":"/Users/rbates/Library/Application Support/Code - Insiders/1.81-main.sock","VSCODE_PID":"74823","SHLVL":"0","PWD":"/","OLDPWD":"/","EDITOR":"code -w","PAGER":"less","LESS":"-R","LC_CTYPE":"","LSCOLORS":"Gxfxcxdxbxegedabagacad","RBENV_SHELL":"zsh","RUBYLIB":"/usr/local/lib/ruby/site_ruby:","ANDROID_HOME":"/Users/rbates/Library/Android/sdk","JRUBY_OPTS":"--1.9","_SENTI_C_PRINT":"1","ASDF_DIR":"/usr/local/opt/asdf/libexec","_":"/Applications/Visual Studio Code - Insiders.app/Contents/MacOS/Electron"}, {"shellIntegration":{"enabled":true,"suggestEnabled":false,"nonce":"dc877b42-e21d-41e3-8e1a-77f8103c1c6c"},"windowsEnableConpty":true,"environmentVariableCollections":[["vscode.git",[["GIT_ASKPASS",{"variable":"GIT_ASKPASS","value":"/Applications/Visual Studio Code - Insiders.app/Contents/Resources/app/extensions/git/dist/askpass.sh","type":1,"options":{"applyAtProcessCreation":true,"applyAtShellIntegration":false}}],["VSCODE_GIT_ASKPASS_NODE",{"variable":"VSCODE_GIT_ASKPASS_NODE","value":"/Applications/Visual Studio Code - Insiders.app/Contents/Frameworks/Code - Insiders Helper (Plugin).app/Contents/MacOS/Code - Insiders Helper (Plugin)","type":1,"options":{"applyAtProcessCreation":true,"applyAtShellIntegration":false}}],["VSCODE_GIT_ASKPASS_EXTRA_ARGS",{"variable":"VSCODE_GIT_ASKPASS_EXTRA_ARGS","value":"--ms-enable-electron-run-as-node","type":1,"options":{"applyAtProcessCreation":true,"applyAtShellIntegration":false}}],["VSCODE_GIT_ASKPASS_MAIN",{"variable":"VSCODE_GIT_ASKPASS_MAIN","value":"/Applications/Visual Studio Code - Insiders.app/Contents/Resources/app/extensions/git/dist/askpass-main.js","type":1,"options":{"applyAtProcessCreation":true,"applyAtShellIntegration":false}}],["VSCODE_GIT_IPC_HANDLE",{"variable":"VSCODE_GIT_IPC_HANDLE","value":"/var/folders/7b/p3z3qsvj03d3pbn9pnngh8hh0000gn/T/vscode-git-49a0914403.sock","type":1,"options":{"applyAtProcessCreation":true,"applyAtShellIntegration":false}}]],[["",{"description":"Enables the following features: git auth provider"}]]]],"workspaceFolder":{"uri":{"$mid":1,"fsPath":"/Users/rbates/code/test","external":"file:///Users/rbates/code/test","path":"/Users/rbates/code/test","scheme":"file"},"name":"test","index":0}}, false, "ae3e8ec2622c0063caf309f8dbb069bf", "test")
2023-07-18 16:24:11.411 [debug] MutationLogger "Persistent process "2" interaction state" set to "None", reason: initialized
2023-07-18 16:24:11.412 [debug] MutationLogger "Persistent process "2" interaction state" set to "Session", reason: setTitle
2023-07-18 16:24:11.412 [trace] [RPC Response] PtyService#createProcess 2
2023-07-18 16:24:11.421 [trace] [RPC Request] PtyService#shutdown(1, false)
2023-07-18 16:24:11.421 [trace] [RPC Response] PtyService#shutdown undefined
2023-07-18 16:24:11.421 [trace] [RPC Request] PtyService#start(2)
ryanb commented 1 year ago

I find it weird that right after createProcess, it gets shutdown and then starts again - unless @ryanb you reloaded the window?

@meganrogge I tested it again and same create/shutdown lines in the log. I didn't reload the window.

ryanb commented 1 year ago

@meganrogge

On a hunch, I simplified my ~/.zshrc file to this one line to see if there was something in there causing the restart.

PATH="/test:$PATH"

It still appends the path to the end instead of the beginning.

 *  Executing task: echo $PATH 

/usr/local/bin:/System/Cryptexes/App/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin:/opt/X11/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/local/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/appleinternal/bin:/test

However there's no longer a shutdown line in the log.

2023-07-19 10:25:05.019 [info] Revived process, old id ae3e8ec2622c0063caf309f8dbb069bf-3 -> new id 1
2023-07-19 10:25:05.202 [info] Expanding terminal instance, old id ae3e8ec2622c0063caf309f8dbb069bf-1 -> new id undefined
2023-07-19 10:25:05.203 [info] Expanding terminal instance, old id ae3e8ec2622c0063caf309f8dbb069bf-3 -> new id 1
2023-07-19 10:25:05.203 [warning] Couldn't get layout info, a terminal was probably disconnected Terminal 1 has already been expanded
2023-07-19 10:25:09.293 [warning] Persistent process "1": Process had no disconnect runners but was an orphan
2023-07-19 10:25:09.293 [info] Persistent process reconnection "1"
2023-07-19 10:25:09.359 [info] Persistent process "1": Replaying 80 chars and 1 size events
2023-07-19 10:25:17.903 [trace] [RPC Request] PtyService#getDefaultSystemShell(2)
2023-07-19 10:25:17.903 [trace] [RPC Response] PtyService#getDefaultSystemShell /bin/zsh
2023-07-19 10:25:17.960 [trace] [RPC Request] PtyService#createProcess({"name":"echo path","type":"Task","executable":"/bin/zsh","args":["-l","-c","echo $PATH"],"env":{},"icon":{"id":"tools"},"color":null,"initialText":"\u001b]633;A\u0007\u001b]633;P;Task=True\u0007\u001b]633;P;Cwd=/Users/rbates/code/test\u0007\u001b]633;B\u0007\u001b[0m\u001b[7m * \u001b[0m Executing task: echo $PATH \u001b[0m\n\r\u001b]633;C\u0007","cwd":{"$mid":1,"fsPath":"/Users/rbates/code/test","external":"file:///Users/rbates/code/test","path":"/Users/rbates/code/test","scheme":"file"},"isFeatureTerminal":true,"useShellEnvironment":true}, "/Users/rbates/code/test", 142, 15, "11", {"MallocNanoZone":"0","USER":"rbates","COMMAND_MODE":"unix2003","__CFBundleIdentifier":"com.microsoft.VSCodeInsiders","PATH":"/test:/usr/local/bin:/System/Cryptexes/App/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin:/opt/X11/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/local/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/appleinternal/bin","LOGNAME":"rbates","DISPLAY":"/private/tmp/com.apple.launchd.wiLmUwcMdf/org.macosforge.xquartz:0","SSH_AUTH_SOCK":"/private/tmp/com.apple.launchd.XjrTyH5z6f/Listeners","HOME":"/Users/rbates","SHELL":"/bin/zsh","TMPDIR":"/var/folders/7b/p3z3qsvj03d3pbn9pnngh8hh0000gn/T/","__CF_USER_TEXT_ENCODING":"0x1F5:0x0:0x0","XPC_SERVICE_NAME":"application.com.microsoft.VSCodeInsiders.202483063.202483069","XPC_FLAGS":"0x0","ORIGINAL_XDG_CURRENT_DESKTOP":"undefined","SHLVL":"0","PWD":"/","OLDPWD":"/","_":"/Applications/Visual Studio Code - Insiders.app/Contents/MacOS/Electron","TERM_PROGRAM":"vscode","TERM_PROGRAM_VERSION":"1.81.0-insider","LANG":"en_US.UTF-8","COLORTERM":"truecolor","GIT_ASKPASS":"/Applications/Visual Studio Code - Insiders.app/Contents/Resources/app/extensions/git/dist/askpass.sh","VSCODE_GIT_ASKPASS_NODE":"/Applications/Visual Studio Code - Insiders.app/Contents/Frameworks/Code - Insiders Helper (Plugin).app/Contents/MacOS/Code - Insiders Helper (Plugin)","VSCODE_GIT_ASKPASS_EXTRA_ARGS":"--ms-enable-electron-run-as-node","VSCODE_GIT_ASKPASS_MAIN":"/Applications/Visual Studio Code - Insiders.app/Contents/Resources/app/extensions/git/dist/askpass-main.js","VSCODE_GIT_IPC_HANDLE":"/var/folders/7b/p3z3qsvj03d3pbn9pnngh8hh0000gn/T/vscode-git-49a0914403.sock"}, {"MallocNanoZone":"0","USER":"rbates","COMMAND_MODE":"unix2003","__CFBundleIdentifier":"com.microsoft.VSCodeInsiders","PATH":"/test:/usr/local/bin:/System/Cryptexes/App/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin:/opt/X11/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/local/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/appleinternal/bin","LOGNAME":"rbates","DISPLAY":"/private/tmp/com.apple.launchd.wiLmUwcMdf/org.macosforge.xquartz:0","SSH_AUTH_SOCK":"/private/tmp/com.apple.launchd.XjrTyH5z6f/Listeners","HOME":"/Users/rbates","SHELL":"/bin/zsh","TMPDIR":"/var/folders/7b/p3z3qsvj03d3pbn9pnngh8hh0000gn/T/","__CF_USER_TEXT_ENCODING":"0x1F5:0x0:0x0","XPC_SERVICE_NAME":"application.com.microsoft.VSCodeInsiders.202483063.202483069","XPC_FLAGS":"0x0","ORIGINAL_XDG_CURRENT_DESKTOP":"undefined","VSCODE_CWD":"/","VSCODE_NLS_CONFIG":"{\"locale\":\"en-us\",\"osLocale\":\"en-us\",\"availableLanguages\":{},\"_languagePackSupport\":true}","VSCODE_CODE_CACHE_PATH":"/Users/rbates/Library/Application Support/Code - Insiders/CachedData/4390ebc406732e5b4eed22a1d7aa4fc0ef4a9460","VSCODE_IPC_HOOK":"/Users/rbates/Library/Application Support/Code - Insiders/1.81-main.sock","VSCODE_PID":"57942","SHLVL":"0","PWD":"/","OLDPWD":"/","_":"/Applications/Visual Studio Code - Insiders.app/Contents/MacOS/Electron"}, {"shellIntegration":{"enabled":true,"suggestEnabled":false,"nonce":"a4b9e599-dae8-4721-aeac-61ff4276edb2"},"windowsEnableConpty":true,"environmentVariableCollections":[["vscode.git",[["GIT_ASKPASS",{"variable":"GIT_ASKPASS","value":"/Applications/Visual Studio Code - Insiders.app/Contents/Resources/app/extensions/git/dist/askpass.sh","type":1,"options":{"applyAtProcessCreation":true,"applyAtShellIntegration":false}}],["VSCODE_GIT_ASKPASS_NODE",{"variable":"VSCODE_GIT_ASKPASS_NODE","value":"/Applications/Visual Studio Code - Insiders.app/Contents/Frameworks/Code - Insiders Helper (Plugin).app/Contents/MacOS/Code - Insiders Helper (Plugin)","type":1,"options":{"applyAtProcessCreation":true,"applyAtShellIntegration":false}}],["VSCODE_GIT_ASKPASS_EXTRA_ARGS",{"variable":"VSCODE_GIT_ASKPASS_EXTRA_ARGS","value":"--ms-enable-electron-run-as-node","type":1,"options":{"applyAtProcessCreation":true,"applyAtShellIntegration":false}}],["VSCODE_GIT_ASKPASS_MAIN",{"variable":"VSCODE_GIT_ASKPASS_MAIN","value":"/Applications/Visual Studio Code - Insiders.app/Contents/Resources/app/extensions/git/dist/askpass-main.js","type":1,"options":{"applyAtProcessCreation":true,"applyAtShellIntegration":false}}],["VSCODE_GIT_IPC_HANDLE",{"variable":"VSCODE_GIT_IPC_HANDLE","value":"/var/folders/7b/p3z3qsvj03d3pbn9pnngh8hh0000gn/T/vscode-git-49a0914403.sock","type":1,"options":{"applyAtProcessCreation":true,"applyAtShellIntegration":false}}]],[["",{"description":"Enables the following features: git auth provider"}]]]],"workspaceFolder":{"uri":{"$mid":1,"fsPath":"/Users/rbates/code/test","external":"file:///Users/rbates/code/test","path":"/Users/rbates/code/test","scheme":"file"},"name":"test","index":0}}, false, "ae3e8ec2622c0063caf309f8dbb069bf", "test")
2023-07-19 10:25:17.960 [debug] MutationLogger "Persistent process "2" interaction state" set to "None", reason: initialized
2023-07-19 10:25:17.961 [debug] MutationLogger "Persistent process "2" interaction state" set to "Session", reason: setTitle
2023-07-19 10:25:17.961 [trace] [RPC Response] PtyService#createProcess 2
2023-07-19 10:25:17.982 [trace] [RPC Request] PtyService#start(2)
2023-07-19 10:25:17.982 [trace] [RPC Event] PtyService#_onDidChangeProperty.fire({"id":2,"property":{"type":"initialCwd","value":"/Users/rbates/code/test"}})
2023-07-19 10:25:17.982 [trace] [RPC Event] PtyService#_onDidChangeProperty.fire({"id":2,"property":{"type":"failedShellIntegrationActivation","value":true}})
2023-07-19 10:25:17.982 [trace] node-pty.IPty#spawn /bin/zsh ["-l","-c","echo $PATH"] {"name":"xterm-256color","cwd":"/Users/rbates/code/test","env":{"MallocNanoZone":"0","USER":"rbates","COMMAND_MODE":"unix2003","__CFBundleIdentifier":"com.microsoft.VSCodeInsiders","PATH":"/test:/usr/local/bin:/System/Cryptexes/App/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin:/opt/X11/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/local/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/appleinternal/bin","LOGNAME":"rbates","DISPLAY":"/private/tmp/com.apple.launchd.wiLmUwcMdf/org.macosforge.xquartz:0","SSH_AUTH_SOCK":"/private/tmp/com.apple.launchd.XjrTyH5z6f/Listeners","HOME":"/Users/rbates","SHELL":"/bin/zsh","TMPDIR":"/var/folders/7b/p3z3qsvj03d3pbn9pnngh8hh0000gn/T/","__CF_USER_TEXT_ENCODING":"0x1F5:0x0:0x0","XPC_SERVICE_NAME":"application.com.microsoft.VSCodeInsiders.202483063.202483069","XPC_FLAGS":"0x0","ORIGINAL_XDG_CURRENT_DESKTOP":"undefined","SHLVL":"0","PWD":"/","OLDPWD":"/","_":"/Applications/Visual Studio Code - Insiders.app/Contents/MacOS/Electron","TERM_PROGRAM":"vscode","TERM_PROGRAM_VERSION":"1.81.0-insider","LANG":"en_US.UTF-8","COLORTERM":"truecolor","GIT_ASKPASS":"/Applications/Visual Studio Code - Insiders.app/Contents/Resources/app/extensions/git/dist/askpass.sh","VSCODE_GIT_ASKPASS_NODE":"/Applications/Visual Studio Code - Insiders.app/Contents/Frameworks/Code - Insiders Helper (Plugin).app/Contents/MacOS/Code - Insiders Helper (Plugin)","VSCODE_GIT_ASKPASS_EXTRA_ARGS":"--ms-enable-electron-run-as-node","VSCODE_GIT_ASKPASS_MAIN":"/Applications/Visual Studio Code - Insiders.app/Contents/Resources/app/extensions/git/dist/askpass-main.js","VSCODE_GIT_IPC_HANDLE":"/var/folders/7b/p3z3qsvj03d3pbn9pnngh8hh0000gn/T/vscode-git-49a0914403.sock"},"cols":142,"rows":15,"useConpty":false,"conptyInheritCursor":false}
2023-07-19 10:25:17.983 [trace] [RPC Event] PtyService#_onProcessReady.fire({"id":2,"event":{"pid":58102,"cwd":"/Users/rbates/code/test"}})
2023-07-19 10:25:17.984 [trace] [RPC Response] PtyService#start undefined
2023-07-19 10:25:17.985 [trace] [RPC Event] PtyService#_onDidChangeProperty.fire({"id":2,"property":{"type":"title","value":"/bin/zsh"}})
2023-07-19 10:25:17.985 [trace] [RPC Event] PtyService#_onDidChangeProperty.fire({"id":2,"property":{"type":"shellType"}})
2023-07-19 10:25:17.990 [trace] [RPC Request] PtyService#resize(1, 147, 15)
2023-07-19 10:25:17.990 [trace] node-pty.IPty#resize 147 15
2023-07-19 10:25:17.990 [trace] [RPC Response] PtyService#resize undefined
2023-07-19 10:25:17.991 [trace] node-pty.IPty#onData 

]633;Arbates@MacBook-Pro test % ]633;B
2023-07-19 10:25:17.996 [trace] [RPC Event] PtyService#_onProcessData.fire({"id":1,"event":"\r\r\u001b[0m\u001b[27m\u001b[24m\u001b[J\u001b]633;A\u0007rbates@MacBook-Pro test % \u001b]633;B\u0007"})
2023-07-19 10:25:17.997 [debug] CommandDetectionCapability#handlePromptStart 0 3
2023-07-19 10:25:17.997 [debug] CommandDetectionCapability#handleCommandStart 31 3
2023-07-19 10:25:18.002 [trace] node-pty.IPty#onData /usr/local/bin:/System/Cryptexes/App/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin:/opt/X11/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/local/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/appleinternal/bin:/test

2023-07-19 10:25:18.005 [trace] TerminalProcess#_queueProcessExit 
    at Ue.S (/Applications/Visual Studio Code - Insiders.app/Contents/Resources/app/out/vs/platform/terminal/node/ptyHostMain.js:26:18191)
    at /Applications/Visual Studio Code - Insiders.app/Contents/Resources/app/out/vs/platform/terminal/node/ptyHostMain.js:26:17893
    at EventEmitter2.fire (/Applications/Visual Studio Code - Insiders.app/Contents/Resources/app/node_modules.asar/node-pty/lib/eventEmitter2.js:41:22)
    at PipeSocket.<anonymous> (/Applications/Visual Studio Code - Insiders.app/Contents/Resources/app/node_modules.asar/node-pty/lib/terminal.js:93:76)
    at PipeSocket.emit (node:events:513:28)
    at Terminal.emit (/Applications/Visual Studio Code - Insiders.app/Contents/Resources/app/node_modules.asar/node-pty/lib/terminal.js:155:34)
    at PipeSocket.<anonymous> (/Applications/Visual Studio Code - Insiders.app/Contents/Resources/app/node_modules.asar/node-pty/lib/unixTerminal.js:98:27)
    at Object.onceWrapper (node:events:628:26)
    at PipeSocket.emit (node:events:525:35)
    at Pipe.<anonymous> (node:net:757:14)
2023-07-19 10:25:18.007 [trace] [RPC Event] PtyService#_onProcessData.fire({"id":2,"event":"/usr/local/bin:/System/Cryptexes/App/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin:/opt/X11/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/local/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/appleinternal/bin:/test\r\n"})
2023-07-19 10:25:18.015 [trace] [RPC Request] PtyService#resize(2, 147, 15)
2023-07-19 10:25:18.015 [trace] node-pty.IPty#resize 147 15
2023-07-19 10:25:18.015 [trace] node-pty.IPty#resize exception ioctl(2) failed, EBADF
2023-07-19 10:25:18.016 [trace] [RPC Response] PtyService#resize undefined
2023-07-19 10:25:18.060 [trace] [RPC Request] PtyService#getLatency()
2023-07-19 10:25:18.060 [trace] [RPC Response] PtyService#getLatency []
2023-07-19 10:25:18.061 [trace] [RPC Request] PtyService#getLatency()
2023-07-19 10:25:18.061 [trace] [RPC Response] PtyService#getLatency []
2023-07-19 10:25:18.258 [trace] node-pty.IPty#kill
2023-07-19 10:25:18.258 [trace] [RPC Event] PtyService#_onProcessExit.fire({"id":2,"event":0})
2023-07-19 10:25:18.517 [trace] [RPC Request] PtyService#setTerminalLayoutInfo({"workspaceId":"ae3e8ec2622c0063caf309f8dbb069bf","tabs":[{"isActive":false,"activePersistentProcessId":1,"terminals":[{"relativeSize":1,"terminal":1}]},{"isActive":true,"terminals":[]}]})
2023-07-19 10:25:18.518 [trace] [RPC Response] PtyService#setTerminalLayoutInfo undefined

This is all on Insiders build.

ryanb commented 1 year ago

@meganrogge here's some more testing to try to make sense of what it's doing.

# ~/.zshrc
PATH="/a:$PATH"
PATH="$PATH:/b"
PATH="/c:$PATH"

Here's the output:

# VS Code Task for `echo $PATH`
/usr/local/bin:...:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/appleinternal/bin:/c:/a:/b

# VS Code Terminal
% echo $PATH
/c:/a:/usr/local/bin:...:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/appleinternal/bin:/c:/a:/b:/b

# OS X Terminal
% echo $PATH
/c:/a:/usr/local/bin:...:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/appleinternal/bin:/b

It's as if $PATH is empty when it runs ~/.zshrc the first time for the task. Then it prepends the system $PATH to it. Perhaps it runs the profiles out of order?

The VS Code terminal seems to use the resulting $PATH and runs ~/.zshrc again causing duplicates.

I tried disabling inheritEnv setting and it has the same output.

meganrogge commented 1 year ago

oh, what happens if you disable shell integration terminal.integrated.shellIntegration.enabled?

Tyriar commented 1 year ago

@meganrogge shutdown and relaunch is expected if an extension changes an environment variable collection

ryanb commented 1 year ago

@meganrogge

oh, what happens if you disable shell integration terminal.integrated.shellIntegration.enabled?

Disabled shell integration and restarted Insiders app. Same output.

# VS Code Task
/usr/local/bin:...:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/appleinternal/bin:/c:/a:/b

# VS Code Terminal
echo $PATH
/c:/a:/usr/local/bin:...:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/appleinternal/bin:/c:/a:/b:/b

Another interesting note. OS X uses /etc/profile to set the system $PATH which calls /usr/libexec/path_helper -s to generate the paths. If this is run at any time in the terminal session it will set $PATH to the same as the Task output.

# OS X Terminal
% . /etc/profile
% echo $PATH
/usr/local/bin:...:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/appleinternal/bin:/c:/a:/b

This is because path_helper prepends the system paths and dedups them.

ryanb commented 1 year ago

@Tyriar

shutdown and relaunch is expected if an extension changes an environment variable collection

This is a fresh Insiders install with no extensions enabled. Interestingly the relaunch was related to something in my ~/.zshrc setup.

Tyriar commented 1 year ago

@ryanb in which case I think it is expected since the builtin git extension uses this API

ryanb commented 1 year ago

@Tyriar I suspect https://github.com/microsoft/vscode/commit/ca9192e80b096d715378e905fc074723924bad10 is the cause of this issue. What do you think? What was the reason for removing the getShellEnvironment call?

Tyriar commented 1 year ago

@ryanb that only removes its use from TerminalProfileResolverService, all that's used for is checking $PATH to resolve shell executables (in VS Code's proc, not the task's proc).

The actual shell proc's environment is sourced here:

https://github.com/microsoft/vscode/blob/ce2579718d6c6defd3382aaa3114ffac20c8a3c1/src/vs/workbench/contrib/terminal/browser/terminalProcessManager.ts#L430-L436

VSCodeTriageBot commented 11 months ago

This issue has been closed automatically because it needs more information and has not had recent activity. See also our issue reporting guidelines.

Happy Coding!

ryanb commented 11 months ago

@meganrogge @Tyriar can you reopen this issue? It's still a problem. What information do you need from me to help resolve it?

yozachar commented 11 months ago

I have the same issue.

Version: 1.81.1
Date: 2023-08-09T22:18:39.991Z
Electron: 22.3.18
ElectronBuildId: 22689846
Chromium: 108.0.5359.215
Node.js: 16.17.1
V8: 10.8.168.25-electron.0
OS: Linux x64 6.4.11-arch2-1

Commit: 6c3e3dba23e8fadc360aed75ce363ba185c49794

.vscode/tasks.json

{
  "version": "2.0.0",
  "tasks": [
    {
      "label": "echo PATH",
      "type": "shell",
      "command": "echo $PATH | tr ':' '\\n'"
    }
  ],
}

Executing the task

 *  Executing task: echo $PATH | tr ':' '\n' 

/usr/local/bin
/usr/bin
/usr/local/sbin
/var/lib/flatpak/exports/bin
/usr/bin/site_perl
/usr/bin/vendor_perl
/usr/bin/core_perl
 *  Terminal will be reused by tasks, press any key to close it. 

From terminal

$ echo $PATH | tr ':' '\n'
/home/us-er/.local/share/rtx/installs/node/18.17.1/bin
/home/us-er/.local/share/rtx/installs/go/1.21.0/go/bin
/home/us-er/.local/share/rtx/installs/go/1.21.0/packages/bin
/home/us-er/.local/share/rtx/installs/java/openjdk-17/bin
/home/us-er/.local/share/rtx/installs/nim/2.0.0/bin
/home/us-er/.local/share/rtx/installs/nim/2.0.0/nimble/bin
/home/us-er/.local/share/rtx/installs/rust/1.72.0/bin
/home/us-er/.local/share/rtx/installs/bin/0.17.0/bin
/home/us-er/.local/share/rtx/installs/pipx/1.2.0/bin
/home/us-er/.local/share/rtx/installs/zig/0.11.0/bin
/home/us-er/.local/share/rtx/installs/shfmt/3.7.0/bin
/home/us-er/.local/share/rtx/installs/ninja/1.11.1/bin
/home/us-er/.local/share/rtx/installs/neovim/0.9.1/bin
/home/us-er/.local/share/rtx/installs/kotlin/1.9.10/kotlinc/bin
/home/us-er/.local/share/rtx/installs/kotlin/1.9.10/kotlin-native/bin
/home/us-er/.local/share/rtx/installs/cmake/3.27.4/bin
/home/us-er/.local/share/rtx/installs/meson/1.2.1/bin
/home/us-er/.local/share/rtx/installs/shellcheck/0.9.0/bin
/usr/local/bin
/usr/bin
/usr/local/sbin
/var/lib/flatpak/exports/bin
/usr/bin/site_perl
/usr/bin/vendor_perl
/usr/bin/core_perl
/home/us-er/.local/bin

Current work around:

~/.zprofile

# ~/.zprofile

# Import the default profile
if [ -f "/etc/profile" ]; then
    # shellcheck disable=SC1091
    . "/etc/profile"
fi

# Append "$1" to $PATH when not already in.
append_path() {
    case ":$PATH:" in
    *:"$1":*) ;;
    *)
        export PATH="${PATH:+$PATH:}$1"
        ;;
    esac
}

# user-paths
append_path "$HOME/.local/bin"
eval "$(/usr/bin/rtx activate zsh)"
#append_path "$HOME/.local/share/rtx/shims" # slower

unset -f append_path
thyrrestrup commented 11 months ago

This is also a problem for me when using Conda python environments because the system version of python is selected instead of the version used in the environment.

macOS terminal:

> echo $PATH | tr ':' '\n'
/Users/*****/miniconda3/envs/test/bin
/Users/*****/miniconda3/condabin
/usr/local/bin
/System/Cryptexes/App/usr/bin
/usr/bin
/bin
/usr/sbin
/sbin
/Library/Apple/usr/bin
/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/local/bin
/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/bin
/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/appleinternal/bin
> conda info --env
# conda environments:
#
base                     /Users/*****/miniconda3
test                  *  /Users/*****/miniconda3/envs/test
> which -a python3
/Users/*****/miniconda3/envs/test/bin/python3
/usr/bin/python3

Inside vscode task:

> echo $PATH | tr ':' '\n'
/usr/local/bin
/System/Cryptexes/App/usr/bin
/usr/bin
/bin
/usr/sbin
/sbin
/Library/Apple/usr/bin
/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/local/bin
/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/bin
/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/appleinternal/bin
/Users/*****/miniconda3/envs/test/bin
/Users/*****/miniconda3/condabin
> conda info --env
# conda environments:
#
base                     /Users/*****/miniconda3
test                  *  /Users/*****/miniconda3/envs/test
> which -a python3
/usr/bin/python3
/Users/*****/miniconda3/envs/test/bin/python3
mclean25 commented 9 months ago

Also having the same issues

VSCode integrated Terminal:

/Users/alex/Library/pnpm
/Users/alex/Library/ngrok
/Users/alex/Library/Android/sdk/cmdline-tools
/Users/alex/development/flutter/bin
/Users/alex/.yarn/bin
/Users/alex/.config/yarn/global/node_modules/.bin
/usr/local/opt/postgresql@13/bin
/Users/alex/.nvm/versions/node/v18.17.1/bin
/Users/alex/.poetry/bin
/Users/alex/.pyenv/shims
/Users/alex/.orbstack/bin
/usr/local/bin
/System/Cryptexes/App/usr/bin
/usr/bin
/bin
/usr/sbin
/sbin
/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/local/bin
/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/bin
/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/appleinternal/bin
/Library/Apple/usr/bin
/usr/local/share/dotnet
~/.dotnet/tools
/usr/local/go/bin
/Users/alex/Library/pnpm
/Users/alex/Library/ngrok
/Users/alex/Library/Android/sdk/cmdline-tools
/Users/alex/development/flutter/bin
/Users/alex/.yarn/bin
/Users/alex/.config/yarn/global/node_modules/.bin
/usr/local/opt/postgresql@13/bin
/Users/alex/.nvm/versions/node/v18.17.1/bin
/Users/alex/.poetry/bin
/Users/alex/.orbstack/bin
/Users/alex/.fig/bin
/Users/alex/.local/bin
/Users/alex/.pub-cache/bin
/Users/alex/.pub-cache/bin

tasks.json

/Users/alex/.orbstack/bin
/usr/local/bin
/System/Cryptexes/App/usr/bin
/usr/bin
/bin
/usr/sbin
/sbin
/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/local/bin
/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/bin
/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/appleinternal/bin
/Library/Apple/usr/bin
/usr/local/share/dotnet
~/.dotnet/tools
/usr/local/go/bin
/Users/alex/Library/pnpm
/Users/alex/Library/ngrok
/Users/alex/Library/Android/sdk/cmdline-tools
/Users/alex/development/flutter/bin
/Users/alex/.yarn/bin
/Users/alex/.config/yarn/global/node_modules/.bin
/usr/local/opt/postgresql@13/bin
/Users/alex/.nvm/versions/node/v18.17.1/bin
/Users/alex/.poetry/bin
/Users/alex/.pyenv/shims
/Users/alex/.orbstack/bin
/Users/alex/.fig/bin
/Users/alex/.local/bin
/Users/alex/.pub-cache/bin
thyrrestrup commented 5 months ago

This worked as expected with the following version of vscode:

Version: 1.79.2
Commit: 695af097c7bd098fbf017ce3ac85e09bbc5dda06
Date: 2023-06-14T08:58:33.551Z
Electron: 22.5.7
Chromium: 108.0.5359.215
Node.js: 16.17.1
V8: 10.8.168.25-electron.0
OS: Darwin arm64 23.3.0

And was broken on the following version:

Version: 1.80.2
Commit: 2ccd690cbff1569e4a83d7c43d45101f817401dc
Date: 2023-07-27T20:57:59.134Z
Electron: 22.3.14
ElectronBuildId: 22695494
Chromium: 108.0.5359.215
Node.js: 16.17.1
V8: 10.8.168.25-electron.0
OS: Darwin arm64 23.3.0
meganrogge commented 5 months ago

@ryanb can you pls test in insider's to see if this is still an issue for you?

thyrrestrup commented 5 months ago

This does not work for me on latest insider:

Version: 1.87.0-insider
Commit: 442c133fe92b5e2606c8242caae4e68938faccc7
Date: 2024-02-01T09:51:07.293Z
Electron: 27.2.3
ElectronBuildId: 26495564
Chromium: 118.0.5993.159
Node.js: 18.17.1
V8: 11.8.172.18-electron.0
OS: Darwin arm64 23.3.0
ryanb commented 5 months ago

@ryanb can you pls test in insider's to see if this is still an issue for you?

@meganrogge yes, it's still an issue for me. Since this original post I've got a new MacBook Pro (M3 Silicon) and simplified my ZSH dot files.

Here's the output of echo $PATH task in VS Code Insiders (split on :)

/opt/homebrew/bin
/opt/homebrew/sbin
/usr/local/bin
/System/Cryptexes/App/usr/bin
/usr/bin
/bin
/usr/sbin
/sbin
/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/local/bin
/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/bin
/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/appleinternal/bin
/Users/rbates/.asdf/shims
/Users/rbates/.asdf/bin
/Users/rbates/.bin
/Users/rbates/.local/bin
/Users/rbates/.yarn/bin
/opt/homebrew/opt/llvm@16/bin
/opt/homebrew/bin
/opt/homebrew/sbin
/Users/rbates/.sentinel/current/bin

Here's the output of echo $PATH in my terminal.

/Users/rbates/.asdf/shims
/Users/rbates/.asdf/bin
/Users/rbates/.bin
/Users/rbates/.local/bin
/usr/local/bin
/Users/rbates/.yarn/bin
/opt/homebrew/opt/llvm@16/bin
/opt/homebrew/bin
/opt/homebrew/sbin
/usr/local/bin
/System/Cryptexes/App/usr/bin
/usr/bin
/bin
/usr/sbin
/sbin
/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/local/bin
/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/bin
/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/appleinternal/bin
/Users/rbates/.sentinel/current/bin

This is the version of VS Code.

Version: 1.87.0-insider (Universal)
Commit: 442c133fe92b5e2606c8242caae4e68938faccc7
Date: 2024-02-01T09:55:21.613Z
Electron: 27.2.3
ElectronBuildId: 26495564
Chromium: 118.0.5993.159
Node.js: 18.17.1
V8: 11.8.172.18-electron.0
OS: Darwin arm64 23.1.0
Jake-Carter commented 5 months ago

FYI I had the same issue in https://github.com/microsoft/vscode/issues/186244

My workaround is to explicitly source ~/.zshrc at the start of any MacOS tasks (https://github.com/microsoft/vscode/issues/186244#issuecomment-1622464565)

thyrrestrup commented 4 months ago

The source ~/.zshrc workaround did not work for me. However I came up with the following workaround, maybe it's useful for someone else.

This moves the conda environment path to the front of the PATH variable if a conda environment is activated. It does not rearrange any other paths so that might still be a problem.


/* tasks.json */
{
    "options": {
        "env": {
            "CONDA_VSCODE_FIX": "[[ $CONDA_SHLVL = 1 ]] && export -U PATH=$CONDA_PREFIX/bin:$PATH"
        }
    },
    "tasks": [
        {
            "label": "Run python command with fix",
            "type": "shell",
            "command": "eval",
            "args": [
                "${CONDA_VSCODE_FIX};",
                "python",
                "script.py"
            ],
            "group": "build",
        }
    ]
}
MatanBenN commented 4 months ago

This issue also happened to me when trying to set a task to run my project. source ~/.zshrc was the only thing that worked for me!

Thank you @coffenbacher !

LunarLanding commented 2 months ago

This also affects extensions that call out to executables, that need PATH to be in whatever state the user specified in their shell profile. For instance formatting by latexindent on latexworkshop, which is provided by a conda base environment.

parksj10 commented 1 month ago

same problem... I patched on my machine by adding the following to my settings.json (as I didn't want OS/shell specific tasks)

"terminal.integrated.profiles.osx": { "zsh": { "path": "/bin/zsh", "args": ["-l", "-i"] } }