Skip to content

Shebang in vdj files doesn't work on macOS, easy to fix #2869

@ilyagr

Description

@ilyagr

Small description

This is similar to, but should work better than the now-reverted
226d428

Currently, I get this error if I try to execute a vdj file on my Mac:

# Create any vdj file with visidata on macOS
$ chmod +x test.vdj
$ ./test.vdj
exec: Failed to execute process './test.vdj': The file specified the interpreter 'vd -p', which is not an executable command.

The problem is that the shebang currently says #!vd -p.

I've tested a fix, changing the shebang to:

#!/usr/bin/env -S vd -p

fixes the problem and should be cross-platform. See man env, there's also a good example
of using such shebangs in https://docs.astral.sh/uv/guides/scripts/#using-a-shebang-to-create-an-executable-file.

This should work better than the (now-reverted) 226d428.

Expected result

Executing the vdj file should work

Actual result with screenshot

See above.


I considered creating a quick PR for this, but then I read contributing docs, and I'm not sure that I can transfer copyright for my contributions. (Such a small patch is probably not copyrightable anyway, but it's simpler if I just make it an issue instead).

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions