-
Notifications
You must be signed in to change notification settings - Fork 32.7k
Simplify shell integration manual install by deferring to the code CLI #153921
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
Comments
Hi, I’m thinking about another way, in addition to the CLI mentioned above: how about creating a package (deb/rpm) with only https://github.com/microsoft/vscode/tree/main/src/vs/workbench/contrib/terminal/browser/media directory? This way I only need to install this on the server if I want to SSH to it without remote development (assuming that for some reason I don’t want remote development), since I don’t need the other part of VS Code. This can even go into Debian/Fedora because it is pure MIT, and the package doesn’t have any dependency. I understand that this won’t serve all users (e.g. Windows Server users), so the CLI-way still works as a catch-all. |
The deb/rpm approach isn't great as that's a bunch of overhead building and maintaining the packages, additionally if we keep the script bundled with VS Code then we're able to make breaking changes without many consequences, even new features could break old version of VS Code so it's best to keep them in sync using the same package. I'll think about how we can support SSH better when not using the Remote - SSH extension. Now that you remote, I realize the remote development case isn't covered by manual install currently as it uses desktop paths, we'll need to make sure that's covered as well. |
The installation instructions at the link below are broken for what I have tested (Linux local and Remote): When inside Remote - WSL or Remote - SSH (probably Containers too), the Resources Dir can be found with: - echo "$(readlink -f "$(which code)")../resources"
+ realpath "$(dirname "$(command -v code)")/../../resources"
In such case, the latter snippet also needs to be adjusted: if [ "$TERM_PROGRAM" == "vscode" ]; then
- . <InstallDir>/app/out/vs/workbench/contrib/terminal/browser/media/shellIntegration-bash.sh
+ . <InstallDir>/out/vs/workbench/contrib/terminal/browser/media/shellIntegration-bash.sh
fi And when not running through Remote, I wasn't able to find such a file in a Linux .deb installation. Even by following the original instructions, which would probably resolve to a path like: The correct path would be |
@felipecrs thanks for the info, this is what we're planning for the improved experience in #155046: # pwsh
if ($s=$(code --shell-integration pwsh)) { . $s } # bash
. "$(code --shell-integration bash)"
# zsh
. "$(code --shell-integration zsh)" This will also work on the server so the remote extensions will be covered the same. |
@Tyriar I'm actually worried about perf here. Running Given that this always returns the same value every time we execute it... could we perhaps do something similar to macOS's CLI install command? |
@joaomoreno installing it directly like the command there isn't portable across system though. We are looking into having the I also considered having it in the .sh file itself, but that wouldn't work unless the cli is sourced, not run, and it also wouldn't work at all in pwsh since our CLI is a batch script. |
Uh oh!
There was an error while loading. Please reload this page.
Currently install is a little cumbersome, for example:
It would be much nicer if this was encapsulated within the CLI, something like:
We should also make sure these cases are covered:
The text was updated successfully, but these errors were encountered: