BLOCK(1)

πŸ’… BLOCK(1) β€” the fish-shell one, bestie

okay so this is block from the fish-shell manual, section 1, and it's genuinely one of those tiny commands that does one specific thing and does it iconically. let me put you on. 🫢


✨ NAME ✨

block β€” temporarily block delivery of events. yes literally that's it, that's the whole vibe. πŸŽ€


πŸ¦‹ SYNOPSIS πŸ¦‹

block [(--local | --global)]
block --erase

like, two modes. that's the whole thing. pick one, bestie. πŸ’…


🌸 DESCRIPTION 🌸

okay so block delays delivery of all events triggered by fish or by the emit <>, which means it delays the execution of any function registered with --on-event, --on-process-exit, --on-job-exit, --on-variable and --on-signal until after the block is removed. so everything just... waits. politely. in line. 🧚

⚠️ real talk: event blocks should not be confused with code blocks, which are created with begin, if, while or for. two completely different things with almost the same name β€” no cap, that's just how it is. 😭

without options, block sets up a block that is released automatically at the end of the current function scope. cute, self-cleaning, no notes. ✨

the following options are available:

πŸŽ€ OPTIONS πŸŽ€

  • -l, --local β€” release the block automatically at the end of the current innermost code block scope. very much local-girl behaviour. πŸ’–
  • -g, --global β€” never automatically release the lock. it just stays there. main character energy fr. πŸ‘‘
  • -e, --erase β€” release global block. this is your undo button, bestie. πŸ”₯
  • -h, --help β€” display help about using this command. the classic. πŸ’€

🌈 EXAMPLE 🌈

# Create a function that listens for events
function --on-event foo foo; echo 'foo fired'; end

# Block the delivery of events
block -g

emit foo
# No output will be produced

block -e
# 'foo fired' will now be printed

see what happened?? emit foo fired into the void because we had block -g up, and the second we did block -e the whole thing came through and printed 'foo fired'. the way that works. πŸ˜­πŸ’œ


⭐ NOTES ⭐

events are only received from the current fish process as there is no way to send events from one fish process to another. so like, no cross-process gossip. sorry. πŸ™ˆ


fish-shell developers. icons only. πŸŽ€


so yeah, that's block, from fish-shell 4.9, dated Sep 08, 2026 β€” go forth and block your events, bestie, i believe in you πŸ’–πŸ¦‹βœ¨

πŸ“¦ 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