Skip to content

Commit a1490e5

Browse files
committed
Find shell integration script for VS Code 1.94+
It got moved.
1 parent efd6fd5 commit a1490e5

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

src/utils.ts

+8-1
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,17 @@
44
import os = require("os");
55
import path = require("path");
66
import vscode = require("vscode");
7+
import { satisfies } from "semver";
78

89
export const PowerShellLanguageId = "powershell";
910

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");
1118

1219
export function escapeSingleQuotes(p: string): string {
1320
return p.replace(new RegExp("'", "g"), "''");

0 commit comments

Comments
 (0)