(no title)
pritambaral | 1 year ago
----
I work on a large C++ codebase that takes quite a lot of CPU and RAM to build. To ease development access, we set-up a beefy VM in the cloud, put LXD in that, and gave every developer an LXD container of their own. Access via SSH was simple: ProxyJump via the LXD host (VM) into you container.
Now, I don't use VSCode, I use Emacs, and my container was setup by me to do everything The Right Way™. Devtools like clangd and clang-format were installed via the OS package manager. Everything Just Worked™. The VSCode users on this team had their own containers, so however their setup was didn't affect me.
Until one of them connected their VSCode to my container. My dev setup broke because their VSC decided to download a Microsoft-built binary of clangd and install it onto the PATH in my container. I was horrified, but the coworker who had (inadvertently) done this didn't see the problem. Their VSC worked just fine. I had to write-off that container of mine and create a new one.
Today, we mandate use of the LLVM-provided clangd extension in VSCode in the team, which does not automatically download anything from the internet. But this habit of "helpfully" auto-downloading LSP servers is apparently still common among VSC extensions. To the point that the Emacs lsp-mode package also offers to do that. Thankfully, it's Emacs, so it's pretty easy to disable that behaviour.
----
As we SSH into machines quite a lot, we strongly discourage per-container SSH keys and strongly encourage SSH Agent Forwarding instead (with per-use confirmation). VS Code found a way to break that too. But we couldn't wait for the VSCode overlords to fix it — we were affected already, and urgently needed a fix — so we looked into what could be happening.
Turns out, VSC hijacks the way your shell loads, all so it can inject arbitrary stuff into the embedded terminal. You think you know how and when bash loads ~/.bash_profile and ~/.bashrc and so on. None of that matters because VSC uses its own homebrew init script for bash. A script that tries to, emulate how bash loads, though not entirely accurately.
If you're building a terminal emulator and you want shell integration, the correct way to do it is to ask your users to load your terminal's support code into their shells. The VSCode way is to never tell the user anything and just silently take over their shell for them.
----
Now, I no longer even try to support VSCode on the team. VSCode users are on their own. I help them setup Vim, NeoVim, Emacs, or even IntelliJ. If they have to have VSC, I might look into Eclipse Theia. But, as far as VSC is concerned, I expect nothing less than this malware-style behaviour and thus refuse to waste my time on it.
causal|1 year ago