In functions, block can be useful while performing work that should not be interrupted by the shell.
The block can be removed. Any events which triggered while the block was in place will then be delivered.
Event blocks should not be confused with code blocks, which are created with begin, if, while or for
The following parameters are available:
# 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