I hate to say it, but in war-time that’s actually an established practice. It was done to Eugene V. Debbs for his anti-war views, and he ran for POTUS from his jail cell and garnered a few electoral votes from renegade electors. In fact, I agree with him that American involvement in WW I was a bad idea. Abraham Lincoln suspended Habeas Corpus and arrested editorialists for expressing dissenting opinions.
I’m not saying I like it, but there is precedent.
They were also doing this before the war started
It’s an established practice in totalitarian regimes throughout history as well. No war required.