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 withbegin,if,whileorfor. 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. π
π Copyright π
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