FUNCTIONS(1)

πŸ’… FUNCTIONS(1) β€” fish-shell manual, bestie edition ✨

okay so this is page one of the fish-shell manual (yes, the FUNCTIONS(1) girlies) and we're about to get into it πŸŽ€


🌸 NAME 🌸

functions β€” print or erase functions. that's the whole vibe. printing, erasing, and honestly a little bit of everything else too πŸ’–


✨ SYNOPSIS ✨

functions [-a | --all] [-n | --names] [--color WHEN]
functions [-D | --details] [-v] [--color WHEN] FUNCTION
functions -c OLDNAME NEWNAME
functions -d DESCRIPTION FUNCTION
functions [-e | -q] FUNCTION ...

like. look at all these modes. she contains multitudes πŸ’…


πŸ¦‹ DESCRIPTION πŸ¦‹

functions prints or erases functions. simple as that, lowkey.

The following options are available:

  • -a or --all β€” Lists all functions, even those whose name starts with an underscore. yes even the shy ones that start with _ 🫢
  • -c or --copy OLDNAME NEWNAME β€” Creates a new function named NEWNAME, using the definition of the OLDNAME function. it's giving copy-paste but make it official πŸ’–
  • -d or --description DESCRIPTION β€” Changes the description of this function. little glow-up for your function's bio ✨
  • -e or --erase β€” Causes the specified functions to be erased. This also means that it is prevented from autoloading in the current session. Use funcsave to remove the saved copy. ⚠️ note that "erased" here means "won't autoload this session" β€” if you want the on-disk copy gone too, that's funcsave's job, not hers
  • -D or --details β€” Reports the path name where the specified function is defined or could be autoloaded, stdin if the function was defined interactively or on the command line or by reading standard input, - if the function was created via source, and n/a if the function isn't available. (Functions created via alias will return -, because alias uses source internally. Copied functions will return where the function was copied.) If the --verbose option is also specified then five lines are written:
    • the path name as already described,
    • if the function was copied, the path name to where the function was originally defined, otherwise autoloaded, not-autoloaded or n/a,
    • the line number within the file or zero if not applicable,
    • scope-shadowing if the function shadows the vars in the calling function (the normal case if it wasn't defined with --no-scope-shadowing), else no-scope-shadowing, or n/a if the function isn't defined,
    • the function description minimally escaped so it is a single line, or n/a if the function isn't defined or has no description.
🚨 real talk: You should not assume that only five lines will be written since we may add additional information to the output in the future. don't hardcode your parsing to five, bestie, that's how you get burned 😭
  • --no-details β€” Turns off function path reporting, so just the definition will be printed. back to basics πŸ’œ
  • -n or --names β€” Lists the names of all defined functions. just the names, no lore πŸŽ€
  • -q or --query β€” Tests if the specified functions exist. yes/no behavior check 🌸
  • -v or --verbose β€” Make some output more verbose. she has ✨more to say✨
  • -H or --handlers β€” Show all event handlers. πŸ‘€
  • -t or --handlers-type TYPE β€” Show all event handlers matching the given TYPE. filtered, curated, iconic 🌈
  • --color WHEN β€” Controls when to use syntax highlighting colors when printing function definitions. WHEN can be auto (the default, colorize if the output is a terminal), always, or never. so unbothered, so flexible πŸ’…
  • -h or --help β€” Displays help about using this command. the classic 🫢

The default behavior of functions, when called with no arguments, is to print the names of all defined functions. Unless the -a option is given, no functions starting with underscores are included in the output. ⭐

If any non-option parameters are given, the definition of the specified functions are printed.

Copying a function using -c copies only the body of the function, and does not attach any event notifications from the original function. like, the body but not the whole personality, yk? πŸ™ˆ

Only one function's description can be changed in a single invocation of functions -d. one at a time, don't be greedy πŸ’€

The exit status of functions is the number of functions specified in the argument list that do not exist, which can be used in concert with the -q option. so like, exit code = how many of your little guys were missing πŸ”₯


πŸ“ EXAMPLES πŸ“

functions -n
# Displays a list of currently-defined functions

functions -c foo bar
# Copies the 'foo' function to a new function called 'bar'

functions -e bar
# Erases the function ``bar``

🧚 SEE MORE 🧚

For more explanation of how functions fit into fish, see Functions <#syntax-function>. go read it, it's giving required reading πŸ‘‘


fish-shell developers. icons, all of them πŸ’œ


🌈 that's the whole page, bestie! this was FUNCTIONS(1) from fish-shell 4.9, dated Sep 08, 2026 β€” slay, go erase a function responsibly βœ¨πŸ’…

πŸ“¦ where this page comes from
  • arch rolling: fish 4.9.3-1 Β· GPL-2.0-only AND BSD-3-Clause AND ISC AND MIT AND PSF-2.0
  • πŸ’– girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms