Skip to content

Script Runner: honor shebang instead of always running as bash #303

Description

@mxfng

Feature Description

Let the Script Runner pick the interpreter from a script's shebang instead of always running it through bash.

Problem Statement

Right now scripts run via executeBashScript, so anything that isn't bash (a .fish or .py script) doesn't really work even if that's what I want to write in.

Proposed Solution

When a script is run, write it to a temp file, mark it executable, and exec it directly so #!/usr/bin/env fish (or python, ruby, etc.) decides the interpreter. That covers everything in one go rather than special-casing each shell.

Use Cases

  1. Keep a Sol command in fish so it can share my existing fish functions.
  2. Drop in a quick .py script without rewriting it in bash.
  3. Reuse an existing script as-is regardless of what it's written in.

Alternatives Considered

A .sh wrapper that execs the real script works today, but it's an extra file per command.

Additional Context

The commented-out extension list in scripts.store.tsx already hints at this direction, so it might be on your radar.

Impact

Makes the Script Runner usable with whatever I already write in, instead of porting things to bash.

Priority

Low

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions