fbin
Summary
Section titled “Summary”fbin'' creates a Zsh wrapper function that forwards calls to a binary via an
embedded path. The function lives only in the current shell session; no files are
written to disk. For a persistent, session-independent alternative use sbin''.
Syntax / Usage
Section titled “Syntax / Usage”fbin'[{g|n|c|N|E|O}:]{path-to-binary}[ -> {name-of-the-function}]'Multiple entries are separated by ;. The rename -> name is optional; without it
the function takes the last path segment of {path-to-binary} as its name.
Flags:
g– set$GEM_HOMEto the plugin directoryn– set$NODE_PATHto{plugin-dir}/node_modulesc–cdinto the plugin directory before running, thencdback afterwardN– redirect both stdout and stderr to/dev/nullE– redirect stderr to/dev/nullO– redirect stdout to/dev/null
Details
Section titled “Details”Unlike sbin'', fbin'' does not write anything to $ZPFX/bin. The wrapper is a
regular Zsh function defined at plugin-load time. It exists only within the running
shell; a new session or a non-interactive script will not have it unless the plugin is
loaded again.
Because the function is defined in the live session, the binary is available on the
command line without any $PATH change and without any persistent file on disk.
Empty ice: when fbin is given with no value, the annex auto-detects the binary
by checking (in order):
- trailing component of the
id_as''ice (e.g.id_as'exts/git-my'→git-my) - the plugin name (e.g.
paulirish/git-open→git-open) - trailing component of the snippet URL
- the alphabetically first executable file in the plugin directory
Examples
Section titled “Examples”# Basic usage — function named after the binaryzinit ice from"gh-r" fbin"fzf"zinit load junegunn/fzf-bin
# Rename the function and set GEM_HOMEzinit ice from"gh-r" fbin"g:fzf -> myfzf"zinit load junegunn/fzf-bin
# Inspect the generated function% which myfzfmyfzf () { local bindir="/home/sg/.zinit/plugins/junegunn---fzf-bin" local -x GEM_HOME="/home/sg/.zinit/plugins/junegunn---fzf-bin" "$bindir"/"fzf" "$@"}Caveats / Common Mistakes
Section titled “Caveats / Common Mistakes”- The wrapper function only exists in the current interactive shell session. Scripts
or other processes launched outside of Zinit will not have it. Use
sbin''when the command must be accessible from scripts or external tools. fbinandsbinare mutually exclusive approaches: use one or the other for a given binary, not both.
See Also
Section titled “See Also”- sbin
- annex-bin-gem-node
- as