.\" Man page generated from reStructuredText. . . .nr rst2man-indent-level 0 . .de1 rstReportMargin \\$1 \\n[an-margin] level \\n[rst2man-indent-level] level margin: \\n[rst2man-indent\\n[rst2man-indent-level]] - \\n[rst2man-indent0] \\n[rst2man-indent1] \\n[rst2man-indent2] .. .de1 INDENT .\" .rstReportMargin pre: . RS \\$1 . nr rst2man-indent\\n[rst2man-indent-level] \\n[an-margin] . nr rst2man-indent-level +1 .\" .rstReportMargin post: .. .de UNINDENT . RE .\" indent \\n[an-margin] .\" old: \\n[rst2man-indent\\n[rst2man-indent-level]] .nr rst2man-indent-level -1 .\" new: \\n[rst2man-indent\\n[rst2man-indent-level]] .in \\n[rst2man-indent\\n[rst2man-indent-level]]u .. .TH "BLOCK" "1" "Nov 13, 2025" "4.2" "fish-shell" .SH NAME block \- temporarily block delivery of events .SH SYNOPSIS .nf \fBblock\fP [(\fB\-\-local\fP | \fB\-\-global\fP)] \fBblock\fP \fB\-\-erase\fP .fi .sp .SH DESCRIPTION .sp \fBblock\fP delays delivery of all events triggered by \fBfish\fP or the \fI\%emit\fP, thus delaying the execution of any function registered \fB\-\-on\-event\fP, \fB\-\-on\-process\-exit\fP, \fB\-\-on\-job\-exit\fP, \fB\-\-on\-variable\fP and \fB\-\-on\-signal\fP until after the block is removed. .sp Event blocks should not be confused with code blocks, which are created with \fBbegin\fP, \fBif\fP, \fBwhile\fP or \fBfor\fP .sp Without options, \fBblock\fP sets up a block that is released automatically at the end of the current function scope. .sp The following options are available: .INDENT 0.0 .TP \fB\-l\fP or \fB\-\-local\fP Release the block automatically at the end of the current innermost code block scope. .TP \fB\-g\fP or \fB\-\-global\fP Never automatically release the lock. .TP \fB\-e\fP or \fB\-\-erase\fP Release global block. .TP \fB\-h\fP or \fB\-\-help\fP Display help about using this command. .UNINDENT .SH EXAMPLE .INDENT 0.0 .INDENT 3.5 .sp .EX # Create a function that listens for events function \-\-on\-event foo foo; echo \(aqfoo fired\(aq; end # Block the delivery of events block \-g emit foo # No output will be produced block \-e # \(aqfoo fired\(aq will now be printed .EE .UNINDENT .UNINDENT .SH NOTES .sp Events are only received from the current fish process as there is no way to send events from one fish process to another. .SH COPYRIGHT fish-shell developers .\" Generated by docutils manpage writer. .