|
4 | 4 | import os = require("os");
|
5 | 5 | import path = require("path");
|
6 | 6 | import vscode = require("vscode");
|
| 7 | +import { satisfies } from "semver"; |
7 | 8 |
|
8 | 9 | export const PowerShellLanguageId = "powershell";
|
9 | 10 |
|
10 | | -export const ShellIntegrationScript = path.join(vscode.env.appRoot, "out", "vs", "workbench", "contrib", "terminal", "browser", "media", "shellIntegration.ps1"); |
| 11 | +// Path to the shell integration script in the VS Code installation |
| 12 | +// See https://github.com/microsoft/vscode/pull/227244 |
| 13 | +const shellIntegrationMoved = satisfies(vscode.version, ">=1.94", { includePrerelease: true }); |
| 14 | +export const ShellIntegrationScript = path.join(vscode.env.appRoot, "out", "vs", "workbench", "contrib", "terminal", |
| 15 | + shellIntegrationMoved ? "common" : "browser", |
| 16 | + shellIntegrationMoved ? "scripts" : "media", |
| 17 | + "shellIntegration.ps1"); |
11 | 18 |
|
12 | 19 | export function escapeSingleQuotes(p: string): string {
|
13 | 20 | return p.replace(new RegExp("'", "g"), "''");
|
|
0 commit comments