When a person disobeys the order, decree, judgment, or process of a court or a magistrate thereof, or is guilty of a contempt of such court or magistrate, and in consequence is imprisoned or confined by the order or judgment of such court or magistrate, such person shall be entitled to his or her writ of habeas corpus, returnable to the Supreme Court.
12 V.S.A. § 3979