Skip to content

Hook scripts shipped with CRLF line endings → "/bin/bash^M: bad interpreter" on macOS/Linux #63

@jenahl

Description

@jenahl

Summary

All shell scripts in the warp plugin (v2.1.0) are shipped with Windows CRLF (\r\n) line endings. On macOS/Linux the carriage return becomes part of the shebang, so the OS looks for an interpreter literally named /bin/bash\r and the hook fails:

Failed with non-blocking status code: /bin/sh:
/Users/<me>/.claude/plugins/cache/claude-code-warp/warp/2.1.0/scripts/on-post-tool-use.sh: /bin/bash^M: bad interpreter: No such file or directory

Affected files

Every .sh in scripts/ and scripts/legacy/ (14 files) has CRLF terminators, e.g.:

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

Confirmed via:

$ file scripts/on-post-tool-use.sh
... Bourne-Again shell script text executable, ASCII text, with CRLF line terminators
$ head -1 scripts/on-post-tool-use.sh | od -c
0000000   # ! / b i n / b a s h \r \n

Environment

  • Plugin: warp v2.1.0
  • OS: macOS (darwin, arm64); same failure mode applies to any Linux host

Suggested fix

  1. Re-commit all *.sh with LF line endings.

  2. Add a .gitattributes to keep them LF regardless of contributor platform / core.autocrlf:

    *.sh text eol=lf

Workaround

Strip the carriage returns locally (reverts on plugin reinstall):

find ~/.claude/plugins/cache/claude-code-warp -name '*.sh' -print0 | xargs -0 perl -i -pe 's/\r$//'

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions