Skip to content

Commit

Permalink
feat(linux): update XDG_RUNTIME_DIR for flatpak (#2071)
Browse files Browse the repository at this point in the history
  • Loading branch information
daiyam authored Oct 23, 2024
1 parent 3d2a91c commit 656d6ce
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions patches/linux/client/update-xdg-path.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
diff --git a/extensions/git/src/ipc/ipcServer.ts b/extensions/git/src/ipc/ipcServer.ts
index a7142fe..526ca17 100644
--- a/extensions/git/src/ipc/ipcServer.ts
+++ b/extensions/git/src/ipc/ipcServer.ts
@@ -20,3 +20,7 @@ function getIPCHandlePath(id: string): string {
if (process.platform !== 'darwin' && process.env['XDG_RUNTIME_DIR']) {
- return path.join(process.env['XDG_RUNTIME_DIR'] as string, `vscode-git-${id}.sock`);
+ if (!!process.env.FLATPAK_ID) {
+ return path.join(process.env['XDG_RUNTIME_DIR'] as string, 'app', process.env.FLATPAK_ID, `vscode-git-${id}.sock`);
+ } else {
+ return path.join(process.env['XDG_RUNTIME_DIR'] as string, `vscode-git-${id}.sock`);
+ }
}
diff --git a/src/vs/base/parts/ipc/node/ipc.net.ts b/src/vs/base/parts/ipc/node/ipc.net.ts
index 629f2c4..ec1acba 100644
--- a/src/vs/base/parts/ipc/node/ipc.net.ts
+++ b/src/vs/base/parts/ipc/node/ipc.net.ts
@@ -774,3 +774,3 @@ function unmask(buffer: VSBuffer, mask: number): void {
// Related to https://github.com/microsoft/vscode/issues/30624
-export const XDG_RUNTIME_DIR = <string | undefined>process.env['XDG_RUNTIME_DIR'];
+export const XDG_RUNTIME_DIR = <string | undefined>(!!process.env.FLATPAK_ID ? join(process.env['XDG_RUNTIME_DIR'] as string, 'app', process.env.FLATPAK_ID) : process.env['XDG_RUNTIME_DIR']);

0 comments on commit 656d6ce

Please sign in to comment.