No person shall be discharged under the writ of habeas corpus who is in custody by virtue of a commitment for any offense exclusively cognizable by the courts of the United States, or by order or process issuing out of such courts in cases where they have jurisdiction, or who is held by virtue of any legal engagement or enlistment in the army, or who, being rightfully subject to the rules and articles of war, is confined by any one legally acting under the authority thereof, or who is held as a prisoner of war under the authority of the United States.
Tex. Code Crim. Proc. § 11.63