A person in jail, on a criminal charge, shall be discharged from imprisonment if he be not indicted before the end of the second term of the court, at which he is held to answer, unless it appear to the court that material witnesses for the state have been enticed or kept away, or are prevented from attendance by sickness or inevitable accident, and except also that, when a person in jail, on a charge of having committed an indictable offense, is not indicted by reason of his insanity at the time of committing the act, the grand jury shall certify that fact to the court; whereupon the court may order him to be sent to a state hospital for the insane, or to be discharged.
W. Va. Code § 62-2-12