Skip to content

Hook scripts fail on NixOS: hardcoded #!/bin/bash shebang not found #60

Description

@Zoz92

Summary

All hook scripts in the plugin use #!/bin/bash as their shebang. On NixOS (and other non-FHS Linux distros), /bin/bash does not exist — bash lives in the Nix store and is only reachable via $PATH. This causes every hook to fail at startup with:

PostToolUse:Bash hook error
Failed with non-blocking status code: /bin/sh: /path/to/scripts/on-post-tool-use.sh: /bin/bash: bad interpreter: No such file or directory

Affected files

All .sh scripts under scripts/ and scripts/legacy/:

  • on-post-tool-use.sh
  • on-session-start.sh
  • on-prompt-submit.sh
  • on-stop.sh
  • on-permission-request.sh
  • on-notification.sh
  • build-payload.sh
  • emit-terminal-sequence.sh
  • should-use-structured.sh
  • warp-notify.sh
  • legacy/on-session-start.sh
  • legacy/on-stop.sh
  • legacy/on-notification.sh
  • legacy/warp-notify.sh

Fix

Replace #!/bin/bash with #!/usr/bin/env bash in all scripts. /usr/bin/env is available on NixOS (and is the standard portable shebang for bash scripts on non-FHS systems).

find scripts/ -name "*.sh" | xargs sed -i 's|^#!/bin/bash|#!/usr/bin/env bash|'

Environment

  • OS: NixOS (non-FHS filesystem — no /bin/bash)
  • Claude Code: latest
  • Plugin: claude-code-warp 2.1.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions