From 56f114a02e6965ed405ae0eed5ac0105ca05a1a7 Mon Sep 17 00:00:00 2001 From: Petru Paler Date: Mon, 23 Feb 2026 06:37:57 +0000 Subject: [PATCH] fix: use portable shebang in native messaging host wrapper MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit On NixOS (and other non-FHS Linux distributions like Guix), /bin/bash doesn't exist — all binaries live in the Nix store. This causes Chrome's native messaging to fail with: LaunchProcess: failed to execvp: /home/user/.local/share/surf-cli/host-wrapper.sh The fix changes the generated shebang from #!/bin/bash to #!/usr/bin/env bash, which is portable across all Unix-like systems. --- scripts/install-native-host.cjs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/install-native-host.cjs b/scripts/install-native-host.cjs index 4708faa..37d43fb 100755 --- a/scripts/install-native-host.cjs +++ b/scripts/install-native-host.cjs @@ -129,7 +129,7 @@ function createWrapper(wrapperDir, nodePath, hostPath) { } else { const shPath = path.join(wrapperDir, "host-wrapper.sh"); const hostDir = path.dirname(hostPath); - const content = `#!/bin/bash + const content = `#!/usr/bin/env bash cd "${hostDir}" exec "${nodePath}" "${hostPath}" `;