PopClip JavaScript API Reference
    Preparing search index...

    Interface ShellTagOptions

    Options for configuring the $ tag. Unknown keys throw.

    interface ShellTagOptions {
        env?: Record<string, string>;
        interpreter?: string;
        prefix?: string | null;
        quote?: (text: string) => string;
        shellMode?: "none" | "login" | "nonlogin";
    }
    Index
    env?: Record<string, string>
    interpreter?: string

    What runs the script; a path or bare name, as for ShellScriptOptions.interpreter. Default /bin/zsh — the fixed path, not whatever zsh is on the PATH, so behavior is the same on every Mac. Note the default escaping and prefix assume a POSIX shell; for anything else, set quote and prefix to match.

    prefix?: string | null

    A line prepended to the script. Default "set -euo pipefail" — strict mode: a failed command, an unset variable (mind bare $VAR probes; use ${VAR:-} forms), or a failing pipeline head fails the run. Pass null (or "") for no prefix. Note the prefix shifts stderr line numbers by one. When quote is set, the default becomes no prefix.

    quote?: (text: string) => string

    Replaces the built-in POSIX shell escaping for this tag's interpolations. This redefines what interpolation means, so with a matching quote the tag can compose for any interpreter — JSON.stringify makes a passable quoter for several languages. Must return a string. Setting quote also changes the default prefix to none.

    shellMode?: "none" | "login" | "nonlogin"