Would a war with North Korea and/or a terrorist attack boost the popularity of Trump and the GOP?

This would be my take as well. At this point we are so polarized that there is hardly anyone left who doesn’t have a strong opinion on Trump, and those opinions are going to color everything that he does. Bad events on the world stage are just going to reinforce the preexisting narrative that he has a dangerously belligerent stance on North Korea, and general incompetence in diplomatic affairs, So the majority of Americans that currently have a negative opinion of him will see any destruction on his watch to be his fault, while the minority who like him will rally around him and wave the flag.