It seems especially prone to occur when I have multiple Gnome terminal windows open
I still don’t have a surefire recipe for reproducing this, but it seems especially prone to occur when I have multiple Gnome terminal windows open, or one with multiple tabs in it, in addition to other apps. I have a gut feeling it’s triggered 4/5 times by switching from something else into the set of Gnome terminal windows (with the mouse, via launcher).