Skip to content

Commit

Permalink
vscodium: add patch to fix pwsh detection
Browse files Browse the repository at this point in the history
- Track AOSC OS patches at https://github.com/AOSC-Tracking/vscodium aosc/1.97.0.25037, current HEAD is e4b40d59cf1a89a6c089dd7a7eb58053329d3a5c.

Signed-off-by: Kexy Biscuit <[email protected]>
  • Loading branch information
KexyBiscuit committed Feb 11, 2025
1 parent c3b4b25 commit 38ef353
Show file tree
Hide file tree
Showing 2 changed files with 115 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,114 @@
From e4b40d59cf1a89a6c089dd7a7eb58053329d3a5c Mon Sep 17 00:00:00 2001
From: Kexy Biscuit <[email protected]>
Date: Tue, 11 Feb 2025 14:37:48 +0800
Subject: [PATCH] AOSCOS: add microsoft/vscode#240054

Signed-off-by: Kexy Biscuit <[email protected]>
---
patches/240054.patch.txt | 94 ++++++++++++++++++++++++++++++++++++++++
1 file changed, 94 insertions(+)
create mode 100644 patches/240054.patch.txt

diff --git a/patches/240054.patch.txt b/patches/240054.patch.txt
new file mode 100644
index 000000000000..427dae4f59a0
--- /dev/null
+++ b/patches/240054.patch.txt
@@ -0,0 +1,94 @@
+From 6832e5ceda5a85042d2d9001266c3b7fde78105e Mon Sep 17 00:00:00 2001
+From: Kexy Biscuit <[email protected]>
+Date: Sat, 8 Feb 2025 13:36:43 +0800
+Subject: [PATCH 1/2] Fix PowerShell executable name detection.
+
+The executable name can be `pwsh`, `pwsh-preview`, or `powershell`. The
+new regular expression matches them all.
+
+Fixes #240053.
+
+Fixes: 9fc5861de216 ("Speculative fix when pwsh is 'powershell' on mac/linux")
+Co-authored-by: Garfield Lee <[email protected]>
+Signed-off-by: Kexy Biscuit <[email protected]>
+---
+ src/vs/platform/shell/node/shellEnv.ts | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/src/vs/platform/shell/node/shellEnv.ts b/src/vs/platform/shell/node/shellEnv.ts
+index 31a1ebe1ecf11..0fde4b76e6e29 100644
+--- a/src/vs/platform/shell/node/shellEnv.ts
++++ b/src/vs/platform/shell/node/shellEnv.ts
+@@ -129,7 +129,7 @@ async function doResolveUnixShellEnv(logService: ILogService, token: Cancellatio
+ const name = basename(systemShellUnix);
+ let command: string, shellArgs: Array<string>;
+ const extraArgs = '';
+- if (/^(?:pwsh(?:-preview)|powershell)$/.test(name)) {
++ if (/^(?:pwsh(?:-preview)?|powershell)$/.test(name)) {
+ // Older versions of PowerShell removes double quotes sometimes so we use "double single quotes" which is how
+ // you escape single quotes inside of a single quoted string.
+ command = `& '${process.execPath}' ${extraArgs} -p '''${mark}'' + JSON.stringify(process.env) + ''${mark}'''`;
+
+From d4478add5e0868b20ec9a741da52622e4cb5cbfa Mon Sep 17 00:00:00 2001
+From: Kexy Biscuit <[email protected]>
+Date: Sat, 8 Feb 2025 14:15:54 +0800
+Subject: [PATCH 2/2] Detect the powershell-preview snap.
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+The powershell-preview snap provides `powershell-preview` command, make
+the regular expression detects that too.
+
+```shell
+kexybiscuit@ProArtB550-CREATOR:~$ snap info powershell-preview
+name: powershell-preview
+summary: PowerShell for every system!
+publisher: Microsoft PowerShell✓
+store-url: https://snapcraft.io/powershell-preview
+contact: https://github.com/powershell/powershell
+license: unset
+description: |
+ PowerShell is an automation and configuration management platform.
+ It consists of a cross-platform (Windows, Linux, and macOS)
+ command-line shell and associated scripting language.
+
+ See https://docs.microsoft.com/powershell/scripting/powershell-support-lifecycle for support
+ details.
+commands:
+ - powershell-preview
+snap-id: D0A7ph8R6LBXQ8rgs2ad06s8tjyeowsd
+tracking: latest/stable
+refresh-date: today at 14:12 CST
+channels:
+ latest/stable: 7.6.0-preview.2 2025-01-27 (165) 77MB classic
+ latest/candidate: ↑
+ latest/beta: ↑
+ latest/edge: 7.4.0-preview.3 2023-05-03 (142) 72MB classic
+installed: 7.6.0-preview.2 (165) 77MB classic
+kexybiscuit@ProArtB550-CREATOR:~$ sudo snap install powershell-preview --classic
+2025-02-08T14:12:33+08:00 INFO Waiting for automatic snapd restart...
+powershell-preview 7.6.0-preview.2 from Microsoft PowerShell✓ installed
+kexybiscuit@ProArtB550-CREATOR:~$ command -v powershell-preview
+/snap/bin/powershell-preview
+```
+
+Co-authored-by: Garfield Lee <[email protected]>
+Signed-off-by: Kexy Biscuit <[email protected]>
+---
+ src/vs/platform/shell/node/shellEnv.ts | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/src/vs/platform/shell/node/shellEnv.ts b/src/vs/platform/shell/node/shellEnv.ts
+index 0fde4b76e6e29..8f4fbf6c49502 100644
+--- a/src/vs/platform/shell/node/shellEnv.ts
++++ b/src/vs/platform/shell/node/shellEnv.ts
+@@ -129,7 +129,7 @@ async function doResolveUnixShellEnv(logService: ILogService, token: Cancellatio
+ const name = basename(systemShellUnix);
+ let command: string, shellArgs: Array<string>;
+ const extraArgs = '';
+- if (/^(?:pwsh(?:-preview)?|powershell)$/.test(name)) {
++ if (/^(?:pwsh|powershell)(?:-preview)?$/.test(name)) {
+ // Older versions of PowerShell removes double quotes sometimes so we use "double single quotes" which is how
+ // you escape single quotes inside of a single quoted string.
+ command = `& '${process.execPath}' ${extraArgs} -p '''${mark}'' + JSON.stringify(process.env) + ''${mark}'''`;
--
2.48.0.rc2.windows.1.472.g0c796d3013.20250123145154

1 change: 1 addition & 0 deletions app-editors/vscodium/spec
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
VER=1.97.0.25037
REL=1
SRCS="git::rename=vscodium;commit=tags/$VER::https://github.com/VSCodium/vscodium.git"
CHKSUMS="SKIP"
CHKUPDATE="anitya::id=326631"

0 comments on commit 38ef353

Please sign in to comment.