From 548b2a55869d47357a01cdc8b43b68681f937ef4 Mon Sep 17 00:00:00 2001 From: Bernd Schoolmann Date: Fri, 30 May 2025 17:51:40 +0200 Subject: [PATCH] Attempt to fix snap integration --- apps/desktop/src/main/native-messaging.main.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/apps/desktop/src/main/native-messaging.main.ts b/apps/desktop/src/main/native-messaging.main.ts index 1372f6b199f..5a56f2a6742 100644 --- a/apps/desktop/src/main/native-messaging.main.ts +++ b/apps/desktop/src/main/native-messaging.main.ts @@ -514,6 +514,10 @@ export class NativeMessagingMain { private homedir() { if (process.platform === "darwin") { return userInfo().homedir; + } else if (process.env.SNAP) { + // Snap mounts a different user directory, making it impossible to access the unsandboxed paths of native messaging hosts under that dir. + const username = userInfo().username; + return path.join("/home", username); } else { return homedir(); }