According to the official Fish documentation, you can use the $status variable:
How do I get the exit status of a command?
Use the
$statusvariable. This replaces the$?variable used in some other shells.
According to the official Fish documentation, you can use the $status variable:
How do I get the exit status of a command?
Use the
$statusvariable. This replaces the$?variable used in some other shells.