How to set PATH and other env vars for apps with "Reopen windows when logging back in"?

I don't think you can solve the root problem. Every app/command can set/reset its own Environment variables. The problem is really complicated, if there's a way to set a path globally so that it works in every case i would like to know it too. Thing is when you're launching a deamon - you have to set paths in plist file, because it gets a reset. When you run 'sudo su' - a reset and you have to edit /etc/sudoers. When you run a shell - a reset.

The app decides what environment variables it likes to have, so you usually mess up with specific app's config or the launch config. If the problem is with vscode and you can fix it by editing vscode's config - do it.

The most generic place where variables are stored is '/private/etc/paths', but something like /usr/local/bin should already be there.