Change:
Currently install is a little cumbersome, for example: We should also make sure these cases are covered: Remote development extensions - injection works currently but manual install doesn't talk about the server paths Regular SSH - it's not so easy to get the shell integration script to the remote machine
Hi, I’m thinking about another way, in addition to the CLI mentioned above: how about creating a package (deb/rpm) with only 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): ,LINUX%20AND%20MACOS,-The%20script%20below When inside Remote - WSL or Remote - SSH (probably Containers too), the Resources Dir can be found with: vs : required to step back a folder from a file ( fails)calling is better than since it at least warns the user if the path can't be 't required In such case, the latter snippet also needs to be adjusted: 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: which isn't valid too. The correct path would be instead. And, in such case, the latter snippet would be correct.
thanks for the info, this is what we're planning for the improved experience in : This will also work on the server so the remote extensions will be covered the same.
I'm actually worried about perf here. Running will be slow in many systems, slow enough to notice lag when launching a shell. Given that this always returns the same value every time we execute it... could we perhaps do something similar to ?
installing it directly like the command there isn't portable across system though. We are looking into having the CLI redone in rust which will make it plenty fast enough as we won't need to launch node. 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.

Discussion:
import { homedir, release, tmpdir } from 'os'; import type { ProfilingSession, Target } from 'v8-inspect-profiler'; import { Event } from 'vs/base/common/event'; <del> import { isAbsolute, resolve } from 'vs/base/common/path'; </del> <ins> import { isAbsolute, resolve, join } from 'vs/base/common/path'; </ins> import { IProcessEnvironment, isMacintosh, isWindows } from 'vs/base/common/platform'; import { randomPort } from 'vs/base/common/ports'; import { isString } from 'vs/base/common/types';

import { CancellationTokenSource } from 'vs/base/common/cancellation'; import { randomPath } from 'vs/base/common/extpath'; import { Utils } from 'vs/platform/profiling/common/profiling'; <ins> import { dirname } from 'vs/base/common/resources'; import { FileAccess } from 'vs/base/common/network'; </ins> function shouldSpawnCliProcess(argv: NativeParsedArgs): boolean { return !!argv['install-source']

console.log(buildVersionMessage(product.version, product.commit)); } <ins> // Shell integration else if (args['shell-integration']) { // Silently fail when the terminal is not VS Code's integrated terminal if (process.env['TERM_PROGRAM'] !== 'vscode') { return; } let file: string; switch (args['shell-integration']) { // Usage: `[[ "$TERM_PROGRAM" == "vscode" ]] && . "$(code --shell-integration bash)"` case 'bash': file = 'shellIntegration-bash.sh'; break; // Usage: `if ($env:TERM_PROGRAM -eq "vscode") { . "$(code --shell-integration pwsh)" }` case 'pwsh': file = 'shellIntegration.ps1'; break; // Usage: `[[ "$TERM_PROGRAM" == "vscode" ]] && . "$(code --shell-integration zsh)"` case 'zsh': file = 'shellIntegration-rc.zsh'; break; default: throw new Error('Error using --shell-integration: Invalid shell type'); } console.log(join(dirname(FileAccess.asFileUri('', require)).fsPath, 'out', 'vs', 'workbench', 'contrib', 'terminal', 'browser', 'media', file)); } </ins> // Extensions Management else if (shouldSpawnCliProcess(args)) { const cli = await new Promise<IMainCli>((resolve, reject) => require(['vs/code/node/cliProcessMain'], resolve, reject));

'logsPath'?: string; '__enable-file-policy'?: boolean; editSessionId?: string; <ins> 'shell-integration'?: string; </ins> // chromium command line args: https://electronjs.org/docs/all#supported-chrome-command-line-switches 'no-proxy-server'?: boolean;

'waitMarkerFilePath': { type: 'string' }, 'locale': { type: 'string', cat: 'o', args: 'locale', description: localize('locale', "The locale to use (e.g. en-US or zh-TW).") }, 'user-data-dir': { type: 'string', cat: 'o', args: 'dir', description: localize('userDataDir', "Specifies the directory that user data is kept in. Can be used to open multiple distinct instances of Code.") }, <ins> 'shell-integration': { type: 'string', cat: 'o', args: ['bash', 'pwsh', 'zsh'], description: localize('shellIntergation', "Print the shell integration script file path for the specified shell.") }, </ins> 'help': { type: 'boolean', cat: 'o', alias: 'h', description: localize('help', "Print usage.") }, 'extensions-dir': { type: 'string', deprecates: ['extensionHomePath'], cat: 'e', args: 'dir', description: localize('extensionHomePath', "Set the root path for extensions.") },

'help': OPTIONS['help'], 'version': OPTIONS['version'], <ins> 'shell-integration': OPTIONS['shell-integration'], </ins> 'compatibility': { type: 'string' },

/* ----- server cli ----- */ help: boolean; version: boolean; <ins> 'shell-integration'?: string; </ins> compatibility: string;