Skip to content

Commit

Permalink
Find shell integration script for VS Code 1.94+
Browse files Browse the repository at this point in the history
It got moved.
  • Loading branch information
andyleejordan committed Sep 18, 2024
1 parent efd6fd5 commit a1490e5
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,17 @@
import os = require("os");
import path = require("path");
import vscode = require("vscode");
import { satisfies } from "semver";

export const PowerShellLanguageId = "powershell";

export const ShellIntegrationScript = path.join(vscode.env.appRoot, "out", "vs", "workbench", "contrib", "terminal", "browser", "media", "shellIntegration.ps1");
// Path to the shell integration script in the VS Code installation
// See https://github.com/microsoft/vscode/pull/227244
const shellIntegrationMoved = satisfies(vscode.version, ">=1.94", { includePrerelease: true });
export const ShellIntegrationScript = path.join(vscode.env.appRoot, "out", "vs", "workbench", "contrib", "terminal",
shellIntegrationMoved ? "common" : "browser",
shellIntegrationMoved ? "scripts" : "media",
"shellIntegration.ps1");

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

0 comments on commit a1490e5

Please sign in to comment.