Support --locate-shell-integration-path in server CLI (#155870)

* Fix shell-integration remote cli

* Don't silently fail based on TERM_PROGRAM

We want this to work even in terminals where TERM_PROGRAM may not exist, such
as in a regular ssh session. The manual install recommends using an if before
sourcing anyway.

* Handle shell integration option on server cli

* Move shell integration option handling higher
This commit is contained in:
Daniel Imms
2022-07-25 08:39:27 -07:00
committed by GitHub
parent ba6088a21a
commit ac4d678fb9
2 changed files with 15 additions and 6 deletions
-4
View File
@@ -63,10 +63,6 @@ export async function main(argv: string[]): Promise<any> {
// Shell integration
else if (args['locate-shell-integration-path']) {
// Silently fail when the terminal is not VS Code's integrated terminal
if (process.env['TERM_PROGRAM'] !== 'vscode') {
return;
}
let file: string;
switch (args['locate-shell-integration-path']) {
// Usage: `[[ "$TERM_PROGRAM" == "vscode" ]] && . "$(code --locate-shell-integration-path bash)"`